diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 114787116df..2e18d4cf0b2 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -639,7 +639,7 @@ tf_cc_shared_object( "//tensorflow/cc/saved_model:loader_lite_impl", "//tensorflow/core:core_cpu_impl", "//tensorflow/core:framework_internal_impl", - "//tensorflow/core:gpu_runtime_impl", + "//tensorflow/core/common_runtime/gpu:gpu_runtime_impl", "//tensorflow/core/grappler/optimizers:custom_graph_optimizer_registry_impl", "//tensorflow/core:lib_internal_impl", "//tensorflow/core/profiler:profiler_impl", diff --git a/tensorflow/compiler/jit/BUILD b/tensorflow/compiler/jit/BUILD index d0e8a2b35d2..28d922f9e3c 100644 --- a/tensorflow/compiler/jit/BUILD +++ b/tensorflow/compiler/jit/BUILD @@ -118,8 +118,8 @@ cc_library( "//tensorflow/compiler/tf2xla/kernels:xla_ops", "//tensorflow/compiler/xla/service:gpu_plugin", # buildcleaner: keep "//tensorflow/core:core_cpu_internal", - "//tensorflow/core:gpu_init", "//tensorflow/core:lib", + "//tensorflow/core/common_runtime/gpu:gpu_init", "@com_google_absl//absl/memory", "@com_google_absl//absl/strings", ], diff --git a/tensorflow/compiler/tf2tensorrt/BUILD b/tensorflow/compiler/tf2tensorrt/BUILD index 371a5804008..6291ea6cbda 100644 --- a/tensorflow/compiler/tf2tensorrt/BUILD +++ b/tensorflow/compiler/tf2tensorrt/BUILD @@ -68,7 +68,7 @@ tf_cuda_cc_test( "nomac", ], deps = [ - "//tensorflow/core:gpu_init", + "//tensorflow/core/common_runtime/gpu:gpu_init", "//tensorflow/core:lib", "//tensorflow/core:stream_executor", "//tensorflow/core:test", @@ -97,7 +97,6 @@ cc_library( "@com_google_absl//absl/memory", "@com_google_absl//absl/strings", "@local_config_cuda//cuda:cuda_headers", - "//tensorflow/core:core_cpu_lib_no_ops", "//tensorflow/core:framework", "//tensorflow/core:gpu_headers_lib", "//tensorflow/core:lib", @@ -105,6 +104,7 @@ cc_library( "//tensorflow/core:lib_proto_parsing", "//tensorflow/core:stream_executor", "//tensorflow/core:stream_executor_headers_lib", + "//tensorflow/core/common_runtime:core_cpu_lib_no_ops", "//tensorflow/core/grappler/costs:graph_properties", "//tensorflow/stream_executor/lib", ] + if_tensorrt([":tensorrt_lib"]) + tf_custom_op_library_additional_deps(), diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD index 55b193b859d..7c71b1c676f 100644 --- a/tensorflow/core/BUILD +++ b/tensorflow/core/BUILD @@ -1590,13 +1590,6 @@ alias( visibility = ["//visibility:public"], ) -alias( - name = "rocm", - actual = - "//tensorflow/core/common_runtime/gpu:rocm", - visibility = ["//visibility:public"], -) - # ----------------------------------------------------------------------------- # Clif-related proto libraries. @@ -2251,14 +2244,6 @@ cc_header_only_library( ], ) -cc_header_only_library( - name = "core_cpu_headers_lib", - visibility = ["//visibility:public"], - deps = [ - ":core_cpu_lib", - ], -) - tf_cuda_library( name = "framework_internal_impl", srcs = [ @@ -2420,7 +2405,7 @@ tf_cuda_library( "//tensorflow/core/public:session.h", ], copts = tf_copts(), - deps = [":core_cpu_base_no_ops"] + if_static([ + deps = ["//tensorflow/core/common_runtime:core_cpu_base_no_ops"] + if_static([ ":function_ops_op_lib", ":functional_grad", ":functional_ops_op_lib", @@ -2430,19 +2415,6 @@ tf_cuda_library( alwayslink = 1, ) -alias( - name = "core_cpu_base_no_ops", - actual = - "//tensorflow/core/common_runtime:core_cpu_base_no_ops", -) - -filegroup( - name = "core_cpu_lib_headers", - srcs = [ - "//tensorflow/core/common_runtime:core_cpu_lib_headers", - ], -) - alias( name = "core_cpu_impl", actual = @@ -2455,36 +2427,12 @@ alias( "//tensorflow/core/common_runtime:core_cpu_lib", ) -alias( - name = "core_cpu_lib_no_ops", - actual = - "//tensorflow/core/common_runtime:core_cpu_lib_no_ops", -) - alias( name = "core_cpu_internal", actual = "//tensorflow/core/common_runtime:core_cpu_internal", ) -# This is redundant with the "core_cpu_*" targets above. It's useful for -# applications that want to depend on a minimal subset of TensorFlow (e.g. XLA). -cc_library( - name = "bfc_allocator", - visibility = ["//visibility:public"], - deps = [ - "//tensorflow/core/common_runtime:bfc_allocator", - ], -) - -cc_library( - name = "shared_counter", - visibility = ["//visibility:public"], - deps = [ - "//tensorflow/core/common_runtime:shared_counter", - ], -) - alias( name = "regexp_internal", actual = @@ -2521,49 +2469,12 @@ tf_proto_library_cc( ], ) -alias( - name = "gpu_id", - actual = "//tensorflow/core/common_runtime/gpu:gpu_id", -) - -alias( - name = "gpu_runtime_impl", - actual = "//tensorflow/core/common_runtime/gpu:gpu_runtime_impl", -) - alias( name = "gpu_runtime", actual = "//tensorflow/core/common_runtime/gpu:gpu_runtime", ) -# This is redundant with the "gpu_runtime_*" targets above. It's useful for -# applications that want to depend on a minimal subset of TensorFlow (e.g. XLA). -alias( - name = "gpu_bfc_allocator", - actual = - "//tensorflow/core/common_runtime/gpu:gpu_bfc_allocator", - visibility = ["//visibility:public"], -) - -alias( - name = "gpu_mem_allocator", - actual = - "//tensorflow/core/common_runtime/gpu:gpu_mem_allocator", - visibility = ["//visibility:public"], -) - -alias( - name = "gpu_init", - actual = - "//tensorflow/core/common_runtime/gpu:gpu_init", -) - -alias( - name = "sycl_runtime", - actual = "//tensorflow/core/common_runtime/sycl:sycl_runtime", -) - # ----------------------------------------------------------------------------- # Tests diff --git a/tensorflow/core/common_runtime/BUILD b/tensorflow/core/common_runtime/BUILD index 93804bc8889..bbfed7f8f5b 100644 --- a/tensorflow/core/common_runtime/BUILD +++ b/tensorflow/core/common_runtime/BUILD @@ -1,5 +1,6 @@ load( "//tensorflow:tensorflow.bzl", + "cc_header_only_library", "tf_cc_test", "tf_cc_test_mkl", "tf_cc_tests", @@ -68,6 +69,14 @@ tf_cuda_library( ], ) +cc_header_only_library( + name = "core_cpu_headers_lib", + visibility = ["//visibility:public"], + deps = [ + ":core_cpu_lib", + ], +) + cc_library( name = "core", visibility = ["//visibility:public"], diff --git a/tensorflow/core/grappler/BUILD b/tensorflow/core/grappler/BUILD index b19211eb7f5..48c733c0987 100644 --- a/tensorflow/core/grappler/BUILD +++ b/tensorflow/core/grappler/BUILD @@ -71,7 +71,7 @@ tf_cuda_library( srcs = ["devices.cc"], hdrs = ["devices.h"], cuda_deps = [ - "//tensorflow/core:gpu_init", + "//tensorflow/core/common_runtime/gpu:gpu_init", "//tensorflow/core:stream_executor", ], visibility = ["//visibility:public"], diff --git a/tensorflow/core/grappler/clusters/BUILD b/tensorflow/core/grappler/clusters/BUILD index ab1c36010e9..08c0179fc52 100644 --- a/tensorflow/core/grappler/clusters/BUILD +++ b/tensorflow/core/grappler/clusters/BUILD @@ -28,7 +28,7 @@ tf_cuda_library( deps = [ "//third_party/eigen3", "//tensorflow/core:framework", - "//tensorflow/core:gpu_id", + "//tensorflow/core/common_runtime/gpu:gpu_id", "//tensorflow/core:lib", "//tensorflow/core:protos_all_cc", ] + select({ @@ -44,11 +44,11 @@ tf_cc_test( tags = tf_cuda_tests_tags(), deps = [ ":utils", - "//tensorflow/core:gpu_id", "//tensorflow/core:lib", "//tensorflow/core:protos_all_cc", "//tensorflow/core:test", "//tensorflow/core:test_main", + "//tensorflow/core/common_runtime/gpu:gpu_id", ], ) @@ -128,12 +128,12 @@ cc_library( ":utils", "//tensorflow/cc:coordinator", "//tensorflow/cc:queue_runner", - "//tensorflow/core:core_cpu", - "//tensorflow/core:core_cpu_lib", - "//tensorflow/core:direct_session", "//tensorflow/core:framework", - "//tensorflow/core:gpu_id", "//tensorflow/core:lib", + "//tensorflow/core/common_runtime:core_cpu", + "//tensorflow/core/common_runtime:core_cpu_lib", + "//tensorflow/core/common_runtime:direct_session_internal", + "//tensorflow/core/common_runtime/gpu:gpu_id", "//tensorflow/core/grappler:utils", "//tensorflow/core/kernels:ops_util", ], diff --git a/tensorflow/core/grappler/costs/BUILD b/tensorflow/core/grappler/costs/BUILD index 7b9ea7b1f9b..443b1918a0f 100644 --- a/tensorflow/core/grappler/costs/BUILD +++ b/tensorflow/core/grappler/costs/BUILD @@ -167,7 +167,7 @@ tf_cuda_library( "@com_google_absl//absl/strings:str_format", "//tensorflow/core:framework", "//tensorflow/core:graph", - "//tensorflow/core:gpu_id", + "//tensorflow/core/common_runtime/gpu:gpu_id", "//tensorflow/core:lib", "//tensorflow/core:lib_proto_parsing", "//tensorflow/core:protos_all_cc", diff --git a/tensorflow/core/grappler/utils/BUILD b/tensorflow/core/grappler/utils/BUILD index 127bf465b3f..8e04b573770 100644 --- a/tensorflow/core/grappler/utils/BUILD +++ b/tensorflow/core/grappler/utils/BUILD @@ -188,12 +188,12 @@ cc_library( hdrs = ["functions.h"], visibility = ["//visibility:public"], deps = [ - "//tensorflow/core:core_cpu_base_no_ops", "//tensorflow/core:framework", "//tensorflow/core:framework_internal", "//tensorflow/core:lib", "//tensorflow/core:lib_internal", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_base_no_ops", "//tensorflow/core/grappler:grappler_item", "//tensorflow/core/grappler:op_types", "//tensorflow/core/grappler:utils", diff --git a/tensorflow/core/kernels/BUILD b/tensorflow/core/kernels/BUILD index 9db59a287b2..c9788a4bdc0 100644 --- a/tensorflow/core/kernels/BUILD +++ b/tensorflow/core/kernels/BUILD @@ -982,7 +982,7 @@ ARRAY_DEPS = [ "//tensorflow/core:lib_internal", "//tensorflow/core:protos_all_cc", "//third_party/eigen3", -] + if_sycl(["//tensorflow/core:sycl_runtime"]) +] + if_sycl(["//tensorflow/core/common_runtime/sycl:sycl_runtime"]) tf_kernel_library( name = "immutable_constant_op", @@ -5624,7 +5624,7 @@ STATE_DEPS = [ "//tensorflow/core:framework", "//tensorflow/core:lib", "//tensorflow/core:lib_internal", -] + if_sycl(["//tensorflow/core:sycl_runtime"]) +] + if_sycl(["//tensorflow/core/common_runtime/sycl:sycl_runtime"]) tf_kernel_library( name = "count_up_to_op", diff --git a/tensorflow/core/nccl/BUILD b/tensorflow/core/nccl/BUILD index b21936167d2..3acf7579f62 100644 --- a/tensorflow/core/nccl/BUILD +++ b/tensorflow/core/nccl/BUILD @@ -72,6 +72,6 @@ tf_cuda_cc_test( "//tensorflow/core:cuda", ]) + if_rocm([ "@local_config_rocm//rocm:rccl", - "//tensorflow/core:rocm", + "//tensorflow/core/common_runtime/gpu:rocm", ]), ) diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index de3d86afa48..b48a2050205 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -403,11 +403,11 @@ tf_python_pybind_extension( deps = [ ":cost_analyzer_headers", ":pybind11_status", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:framework_headers_lib", - "//tensorflow/core:gpu_id", "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", + "//tensorflow/core/common_runtime/gpu:gpu_id", "@pybind11", ], ) @@ -566,8 +566,8 @@ cc_library( visibility = tf_external_workspace_visible(visibility), deps = [ "//tensorflow/c:tf_status_headers", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//third_party/python_runtime:headers", "@pybind11", ], @@ -646,7 +646,7 @@ tf_python_pybind_extension( "//third_party/python_runtime:headers", "//tensorflow/core:protos_all_cc", "//tensorflow/core:framework_headers_lib", - "//tensorflow/core:core_cpu_headers_lib", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//tensorflow/core:lib_headers_for_pybind", "@com_google_absl//absl/types:optional", ] + if_static( @@ -717,10 +717,10 @@ tf_python_pybind_extension( ":pybind11_lib", ":pybind11_proto", ":pybind11_status", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:framework_headers_lib", "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//third_party/python_runtime:headers", "@com_google_absl//absl/strings", "@pybind11", @@ -968,8 +968,8 @@ cc_library( deps = [ ":numpy_lib", "//tensorflow/c:tf_status_headers", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:framework_internal_headers_lib", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//third_party/py/numpy:headers", "//third_party/python_runtime:headers", ], @@ -5758,9 +5758,9 @@ tf_python_pybind_extension( deps = [ ":pybind11_proto", ":pybind11_status", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:framework_internal_headers_lib", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//third_party/python_runtime:headers", "@pybind11", ], @@ -5926,7 +5926,7 @@ filegroup( "//tensorflow/c:tf_status_helper", # tfe "//tensorflow/compiler/jit:flags", #tfe "//tensorflow/compiler/mlir/python:mlir", # mlir - "//tensorflow/core:core_cpu_base_no_ops", # tf_session + "//tensorflow/core/common_runtime:core_cpu_base_no_ops", # tf_session "//tensorflow/core:core_cpu_impl", # device_lib "//tensorflow/core/data/service:server_lib", # server_lib "//tensorflow/core:framework_internal_impl", # op_def_registry @@ -7468,9 +7468,9 @@ tf_python_pybind_extension( deps = [ ":pybind11_status", "@pybind11", - "//tensorflow/core:core_cpu_headers_lib", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//tensorflow/core:framework_headers_lib", - "//tensorflow/core:gpu_id", + "//tensorflow/core/common_runtime/gpu:gpu_id", "//tensorflow/core:protos_all_cc", ] + if_not_windows(["//tensorflow/core/grappler/costs:graph_properties"]), # b/148556093, ) @@ -7543,11 +7543,11 @@ tf_python_pybind_extension( module_name = "_pywrap_tf_cluster", deps = [ ":pybind11_status", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:framework_headers_lib", - "//tensorflow/core:gpu_id", "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", + "//tensorflow/core/common_runtime/gpu:gpu_id", "@com_google_absl//absl/types:span", "@pybind11", ], @@ -7604,11 +7604,11 @@ tf_python_pybind_extension( module_name = "_pywrap_tf_optimizer", deps = [ ":pybind11_status", - "//tensorflow/core:core_cpu_headers_lib", "//tensorflow/core:framework_headers_lib", - "//tensorflow/core:gpu_id", "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", + "//tensorflow/core/common_runtime/gpu:gpu_id", "@pybind11", ], ) @@ -7994,7 +7994,7 @@ tf_python_pybind_extension( "@pybind11", "//third_party/python_runtime:headers", "//tensorflow/compiler/jit:flags_headers_only", - "//tensorflow/core:core_cpu_headers_lib", + "//tensorflow/core/common_runtime:core_cpu_headers_lib", "//tensorflow/core:framework_headers_lib", "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", diff --git a/third_party/ngraph/ngraph_tf.BUILD b/third_party/ngraph/ngraph_tf.BUILD index b4b2511e6b1..3ce31feec27 100644 --- a/third_party/ngraph/ngraph_tf.BUILD +++ b/third_party/ngraph/ngraph_tf.BUILD @@ -59,8 +59,8 @@ cc_library( "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/types:variant", "@ngraph//:ngraph_core", - "@org_tensorflow//tensorflow/core:core_cpu_headers_lib", "@org_tensorflow//tensorflow/core:framework_headers_lib", + "@org_tensorflow//tensorflow/core/common_runtime:core_cpu_headers_lib", ], alwayslink = 1, )