From a5a05231d1a3f787c88ff66e7c582ba30ccb0402 Mon Sep 17 00:00:00 2001 From: David Dunleavy Date: Tue, 26 Nov 2024 15:08:25 -0800 Subject: [PATCH] Move `tsl/platform/{build_config,build_config_root,rules_cc}.bzl` to `xla/tsl/platform` PiperOrigin-RevId: 700472724 --- third_party/llvm_openmp/openmp.bzl | 2 +- tsl/platform/BUILD | 23 ++------- tsl/platform/build_config.bzl | 78 ------------------------------ tsl/platform/build_config_root.bzl | 40 --------------- tsl/platform/rules_cc.bzl | 16 ------ tsl/profiler/lib/BUILD | 6 +-- tsl/profiler/protobuf/BUILD | 2 +- 7 files changed, 8 insertions(+), 159 deletions(-) delete mode 100644 tsl/platform/build_config.bzl delete mode 100644 tsl/platform/build_config_root.bzl delete mode 100644 tsl/platform/rules_cc.bzl diff --git a/third_party/llvm_openmp/openmp.bzl b/third_party/llvm_openmp/openmp.bzl index f30c2d511..6c73fe583 100644 --- a/third_party/llvm_openmp/openmp.bzl +++ b/third_party/llvm_openmp/openmp.bzl @@ -4,7 +4,7 @@ after the TF 2.4 branch cut has passed. """ load( - "@tsl//tsl/platform:rules_cc.bzl", + "@xla//xla/tsl/platform:rules_cc.bzl", "cc_binary", ) diff --git a/tsl/platform/BUILD b/tsl/platform/BUILD index 9702a9faf..a1eb8bd58 100644 --- a/tsl/platform/BUILD +++ b/tsl/platform/BUILD @@ -4,10 +4,6 @@ # The libraries in this package are not allowed to have ANY dependencies # to other TF components outside of TSL. -load( - "@bazel_skylib//:bzl_library.bzl", - "bzl_library", -) load( "@xla//xla/tsl:tsl.bzl", "if_not_fuchsia", @@ -16,13 +12,12 @@ load( ) load("@xla//xla/tsl:tsl.default.bzl", "get_compatible_with_portable") load( - "//tsl/platform:build_config.bzl", + "@xla//xla/tsl/platform:build_config.bzl", "tf_cuda_root_path_deps", "tf_error_logging_deps", "tf_fingerprint_deps", "tf_google_mobile_srcs_no_runtime", "tf_logging_deps", - "tf_platform_alias", "tf_platform_deps", "tf_protobuf_compiler_deps", "tf_resource_deps", @@ -32,9 +27,9 @@ load( "tsl_grpc_credentials_deps", "tsl_protobuf_deps", ) -load("//tsl/platform:build_config_root.bzl", "if_static") +load("@xla//xla/tsl/platform:build_config_root.bzl", "if_static") load( - "//tsl/platform:rules_cc.bzl", + "@xla//xla/tsl/platform:rules_cc.bzl", "cc_library", ) @@ -1749,18 +1744,6 @@ tsl_cc_test( ], ) -bzl_library( - name = "rules_cc_bzl", - srcs = ["rules_cc.bzl"], - deps = tf_platform_alias("rules_cc_bzl"), -) - -bzl_library( - name = "build_config_root_bzl", - srcs = ["build_config_root.bzl"], - deps = tf_platform_alias("build_config_root_bzl"), -) - cc_library( name = "retrying_utils", srcs = [ diff --git a/tsl/platform/build_config.bzl b/tsl/platform/build_config.bzl deleted file mode 100644 index f2ca9d905..000000000 --- a/tsl/platform/build_config.bzl +++ /dev/null @@ -1,78 +0,0 @@ -"""Provides a redirection point for platform specific implementations of starlark utilities.""" - -load( - "@xla//xla/tsl/platform/default:build_config.bzl", - _pyx_library = "pyx_library", - _tf_additional_all_protos = "tf_additional_all_protos", - _tf_additional_core_deps = "tf_additional_core_deps", - _tf_additional_device_tracer_srcs = "tf_additional_device_tracer_srcs", - _tf_additional_lib_deps = "tf_additional_lib_deps", - _tf_additional_lib_hdrs = "tf_additional_lib_hdrs", - _tf_additional_rpc_deps = "tf_additional_rpc_deps", - _tf_additional_tensor_coding_deps = "tf_additional_tensor_coding_deps", - _tf_additional_test_deps = "tf_additional_test_deps", - _tf_cuda_root_path_deps = "tf_cuda_root_path_deps", - _tf_error_logging_deps = "tf_error_logging_deps", - _tf_fingerprint_deps = "tf_fingerprint_deps", - _tf_google_mobile_srcs_no_runtime = "tf_google_mobile_srcs_no_runtime", - _tf_google_mobile_srcs_only_runtime = "tf_google_mobile_srcs_only_runtime", - _tf_jspb_proto_library = "tf_jspb_proto_library", - _tf_lib_proto_parsing_deps = "tf_lib_proto_parsing_deps", - _tf_logging_deps = "tf_logging_deps", - _tf_platform_alias = "tf_platform_alias", - _tf_platform_deps = "tf_platform_deps", - _tf_portable_deps_no_runtime = "tf_portable_deps_no_runtime", - _tf_portable_proto_lib = "tf_portable_proto_lib", - _tf_proto_library = "tf_proto_library", - _tf_proto_library_cc = "tf_proto_library_cc", - _tf_protobuf_compiler_deps = "tf_protobuf_compiler_deps", - _tf_protobuf_deps = "tf_protobuf_deps", - _tf_protos_grappler = "tf_protos_grappler", - _tf_protos_grappler_impl = "tf_protos_grappler_impl", - _tf_protos_profiler_service = "tf_protos_profiler_service", - _tf_py_clif_cc = "tf_py_clif_cc", - _tf_pyclif_proto_library = "tf_pyclif_proto_library", - _tf_resource_deps = "tf_resource_deps", - _tf_stream_executor_deps = "tf_stream_executor_deps", - _tf_windows_aware_platform_deps = "tf_windows_aware_platform_deps", - _tsl_cc_test = "tsl_cc_test", - _tsl_grpc_credentials_deps = "tsl_grpc_credentials_deps", - _tsl_protobuf_deps = "tsl_protobuf_deps", -) - -pyx_library = _pyx_library -tf_additional_all_protos = _tf_additional_all_protos -tf_additional_core_deps = _tf_additional_core_deps -tf_additional_device_tracer_srcs = _tf_additional_device_tracer_srcs -tf_additional_lib_deps = _tf_additional_lib_deps -tf_additional_lib_hdrs = _tf_additional_lib_hdrs -tf_additional_rpc_deps = _tf_additional_rpc_deps -tf_additional_tensor_coding_deps = _tf_additional_tensor_coding_deps -tf_additional_test_deps = _tf_additional_test_deps -tf_cuda_root_path_deps = _tf_cuda_root_path_deps -tf_error_logging_deps = _tf_error_logging_deps -tf_fingerprint_deps = _tf_fingerprint_deps -tf_google_mobile_srcs_no_runtime = _tf_google_mobile_srcs_no_runtime -tf_google_mobile_srcs_only_runtime = _tf_google_mobile_srcs_only_runtime -tf_jspb_proto_library = _tf_jspb_proto_library -tf_lib_proto_parsing_deps = _tf_lib_proto_parsing_deps -tf_logging_deps = _tf_logging_deps -tf_platform_alias = _tf_platform_alias -tf_platform_deps = _tf_platform_deps -tf_portable_proto_lib = _tf_portable_proto_lib -tf_portable_deps_no_runtime = _tf_portable_deps_no_runtime -tf_proto_library = _tf_proto_library -tf_proto_library_cc = _tf_proto_library_cc -tf_protobuf_compiler_deps = _tf_protobuf_compiler_deps -tf_protobuf_deps = _tf_protobuf_deps -tf_protos_grappler = _tf_protos_grappler -tf_protos_grappler_impl = _tf_protos_grappler_impl -tf_protos_profiler_service = _tf_protos_profiler_service -tf_py_clif_cc = _tf_py_clif_cc -tf_pyclif_proto_library = _tf_pyclif_proto_library -tf_resource_deps = _tf_resource_deps -tf_stream_executor_deps = _tf_stream_executor_deps -tf_windows_aware_platform_deps = _tf_windows_aware_platform_deps -tsl_protobuf_deps = _tsl_protobuf_deps -tsl_cc_test = _tsl_cc_test -tsl_grpc_credentials_deps = _tsl_grpc_credentials_deps diff --git a/tsl/platform/build_config_root.bzl b/tsl/platform/build_config_root.bzl deleted file mode 100644 index be6251dbd..000000000 --- a/tsl/platform/build_config_root.bzl +++ /dev/null @@ -1,40 +0,0 @@ -"""Provides a redirection point for platform specific implementations of starlark utilities.""" - -load( - "@xla//xla/tsl/platform/default:build_config_root.bzl", - _if_llvm_aarch32_available = "if_llvm_aarch32_available", - _if_llvm_aarch64_available = "if_llvm_aarch64_available", - _if_llvm_arm_available = "if_llvm_arm_available", - _if_llvm_powerpc_available = "if_llvm_powerpc_available", - _if_llvm_system_z_available = "if_llvm_system_z_available", - _if_llvm_x86_available = "if_llvm_x86_available", - _if_pywrap = "if_pywrap", - _if_static = "if_static", - _if_static_and_not_mobile = "if_static_and_not_mobile", - _tf_additional_grpc_deps_py = "tf_additional_grpc_deps_py", - _tf_additional_license_deps = "tf_additional_license_deps", - _tf_additional_profiler_deps = "tf_additional_profiler_deps", - _tf_additional_tpu_ops_deps = "tf_additional_tpu_ops_deps", - _tf_additional_xla_deps_py = "tf_additional_xla_deps_py", - _tf_cuda_tests_tags = "tf_cuda_tests_tags", - _tf_exec_properties = "tf_exec_properties", - _tf_gpu_tests_tags = "tf_gpu_tests_tags", -) - -if_llvm_aarch32_available = _if_llvm_aarch32_available -if_llvm_aarch64_available = _if_llvm_aarch64_available -if_llvm_arm_available = _if_llvm_arm_available -if_llvm_powerpc_available = _if_llvm_powerpc_available -if_llvm_system_z_available = _if_llvm_system_z_available -if_llvm_x86_available = _if_llvm_x86_available -if_static = _if_static -if_pywrap = _if_pywrap -if_static_and_not_mobile = _if_static_and_not_mobile -tf_additional_grpc_deps_py = _tf_additional_grpc_deps_py -tf_additional_license_deps = _tf_additional_license_deps -tf_additional_profiler_deps = _tf_additional_profiler_deps -tf_additional_tpu_ops_deps = _tf_additional_tpu_ops_deps -tf_additional_xla_deps_py = _tf_additional_xla_deps_py -tf_cuda_tests_tags = _tf_cuda_tests_tags -tf_exec_properties = _tf_exec_properties -tf_gpu_tests_tags = _tf_gpu_tests_tags diff --git a/tsl/platform/rules_cc.bzl b/tsl/platform/rules_cc.bzl deleted file mode 100644 index a69955635..000000000 --- a/tsl/platform/rules_cc.bzl +++ /dev/null @@ -1,16 +0,0 @@ -"""Provides an indirection layer to bazel cc_rules""" - -load( - "@xla//xla/tsl/platform/default:rules_cc.bzl", - _cc_binary = "cc_binary", - _cc_import = "cc_import", - _cc_library = "cc_library", - _cc_shared_library = "cc_shared_library", - _cc_test = "cc_test", -) - -cc_binary = _cc_binary -cc_import = _cc_import -cc_library = _cc_library -cc_shared_library = _cc_shared_library -cc_test = _cc_test diff --git a/tsl/profiler/lib/BUILD b/tsl/profiler/lib/BUILD index 77ea96716..1a38c776f 100644 --- a/tsl/profiler/lib/BUILD +++ b/tsl/profiler/lib/BUILD @@ -1,5 +1,8 @@ load("@xla//xla/tsl:tsl.bzl", "if_not_android", "if_oss", "internal_visibility", "nvtx_headers") load("@xla//xla/tsl:tsl.default.bzl", "filegroup", "get_compatible_with_portable") +load("@xla//xla/tsl/platform:build_config.bzl", "tsl_cc_test") +load("@xla//xla/tsl/platform:build_config_root.bzl", "if_static") +load("@xla//xla/tsl/platform:rules_cc.bzl", "cc_library") load( "@xla//xla/tsl/platform/default:cuda_build_defs.bzl", "if_cuda_is_configured", @@ -9,9 +12,6 @@ load( "tf_profiler_copts", "tf_profiler_pybind_cc_library_wrapper", ) -load("//tsl/platform:build_config.bzl", "tsl_cc_test") -load("//tsl/platform:build_config_root.bzl", "if_static") -load("//tsl/platform:rules_cc.bzl", "cc_library") # copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"]) diff --git a/tsl/profiler/protobuf/BUILD b/tsl/profiler/protobuf/BUILD index fa3c7a3e6..6fdc30432 100644 --- a/tsl/profiler/protobuf/BUILD +++ b/tsl/profiler/protobuf/BUILD @@ -1,7 +1,7 @@ # copybara:uncomment(oss-unused) load("//net/grpc/go/build_defs:go_grpc_library.bzl", "go_grpc_library") # Placeholder: load py_proto_library load("@xla//xla/tsl:tsl.bzl", "internal_visibility") -load("//tsl/platform:build_config.bzl", "tf_proto_library") +load("@xla//xla/tsl/platform:build_config.bzl", "tf_proto_library") # copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])