From 541eb123a5606b2b36b2f4dbb2786804f1e84155 Mon Sep 17 00:00:00 2001 From: David Dunleavy Date: Fri, 24 Jan 2025 15:43:30 -0800 Subject: [PATCH] Update users of TSL headers and targets to new location in XLA Updating: - `env.h` - `env_time.h` - `errors.h` - `file_statistics.h` - `file_system.h` - `file_system_helper.h` - `logging.h` - `macros.h` - `status.h` - `status_matchers.h` - `status_to_from_proto.h` - `statusor.h` - `test.h` - `test_benchmark.h` - `threadpool.h` - `threadpool_async_executor.h` - `threadpool_interface.h` - `threadpool_options.h` - `types.h` and associated targets. PiperOrigin-RevId: 719457663 --- xla/backends/cpu/testlib/BUILD | 4 ++++ xla/backends/cpu/testlib/kernel_runner_test.cc | 1 + .../cpu/testlib/llvm_ir_kernel_emitter_test.cc | 1 + xla/backends/profiler/cpu/BUILD | 12 ++++++------ xla/backends/profiler/cpu/host_tracer.cc | 2 +- xla/backends/profiler/cpu/host_tracer_test.cc | 8 ++++---- xla/backends/profiler/cpu/python_tracer.cc | 4 ++-- xla/hlo/parser/BUILD | 17 +++++++++-------- xla/hlo/parser/hlo_lexer.h | 2 +- xla/hlo/parser/hlo_parser.cc | 6 +++--- xla/hlo/parser/hlo_parser_test.cc | 8 ++++---- 11 files changed, 36 insertions(+), 29 deletions(-) diff --git a/xla/backends/cpu/testlib/BUILD b/xla/backends/cpu/testlib/BUILD index 2881e869945cb..aa3851dd37f3e 100644 --- a/xla/backends/cpu/testlib/BUILD +++ b/xla/backends/cpu/testlib/BUILD @@ -58,6 +58,8 @@ xla_cc_test( "//xla/runtime:buffer_use", "//xla/stream_executor:launch_dim", "//xla/tsl/platform:statusor", + "//xla/tsl/platform:test", + "//xla/tsl/platform:test_main", "@com_google_absl//absl/status", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", @@ -138,6 +140,8 @@ xla_cc_test( "//xla/runtime:buffer_use", "//xla/stream_executor:launch_dim", "//xla/tsl/platform:statusor", + "//xla/tsl/platform:test", + "//xla/tsl/platform:test_main", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", "@llvm-project//llvm:JITLink", diff --git a/xla/backends/cpu/testlib/kernel_runner_test.cc b/xla/backends/cpu/testlib/kernel_runner_test.cc index e96fc50608718..0256311db26de 100644 --- a/xla/backends/cpu/testlib/kernel_runner_test.cc +++ b/xla/backends/cpu/testlib/kernel_runner_test.cc @@ -36,6 +36,7 @@ limitations under the License. #include "xla/shape_util.h" #include "xla/stream_executor/launch_dim.h" #include "xla/tsl/platform/statusor.h" +#include "xla/tsl/platform/test.h" namespace xla::cpu { diff --git a/xla/backends/cpu/testlib/llvm_ir_kernel_emitter_test.cc b/xla/backends/cpu/testlib/llvm_ir_kernel_emitter_test.cc index 8668553c71b90..08cc45a363146 100644 --- a/xla/backends/cpu/testlib/llvm_ir_kernel_emitter_test.cc +++ b/xla/backends/cpu/testlib/llvm_ir_kernel_emitter_test.cc @@ -29,6 +29,7 @@ limitations under the License. #include "xla/runtime/buffer_use.h" #include "xla/stream_executor/launch_dim.h" #include "xla/tsl/platform/statusor.h" +#include "xla/tsl/platform/test.h" #include "tsl/platform/casts.h" namespace xla::cpu { diff --git a/xla/backends/profiler/cpu/BUILD b/xla/backends/profiler/cpu/BUILD index f313e71cb65b6..64a1d8ff49f33 100644 --- a/xla/backends/profiler/cpu/BUILD +++ b/xla/backends/profiler/cpu/BUILD @@ -33,6 +33,7 @@ cc_library( # copybara:uncomment "//tensorflow/core/profiler:internal", ]), deps = [ + "//xla/tsl/platform:errors", "//xla/tsl/profiler/backends/cpu:host_tracer_utils", "//xla/tsl/profiler/backends/cpu:threadpool_listener", "//xla/tsl/profiler/backends/cpu:traceme_recorder", @@ -41,7 +42,6 @@ cc_library( "//xla/tsl/profiler/utils:xplane_utils", "@com_google_absl//absl/log", "@com_google_absl//absl/status", - "@tsl//tsl/platform:errors", "@tsl//tsl/profiler/lib:profiler_collection", "@tsl//tsl/profiler/lib:profiler_interface", "@tsl//tsl/profiler/protobuf:xplane_proto_cc", @@ -76,10 +76,10 @@ cc_library( ]), deps = [ "//xla/python/profiler/internal:python_hooks", + "//xla/tsl/platform:errors", + "//xla/tsl/platform:logging", "@com_google_absl//absl/log", "@com_google_absl//absl/status", - "@tsl//tsl/platform:errors", - "@tsl//tsl/platform:logging", "@tsl//tsl/profiler/lib:profiler_interface", "@tsl//tsl/profiler/protobuf:xplane_proto_cc", ], @@ -130,6 +130,9 @@ xla_cc_test( deps = [ ":host_tracer_impl", "//xla/tsl/lib/core:status_test_util", + "//xla/tsl/platform:env", + "//xla/tsl/platform:test", + "//xla/tsl/platform:types", "//xla/tsl/profiler/utils:tf_xplane_visitor", "//xla/tsl/profiler/utils:timespan", "//xla/tsl/profiler/utils:xplane_schema", @@ -137,9 +140,6 @@ xla_cc_test( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest_main", - "@tsl//tsl/platform:env", - "@tsl//tsl/platform:test", - "@tsl//tsl/platform:types", "@tsl//tsl/profiler/lib:profiler_interface", "@tsl//tsl/profiler/lib:traceme", "@tsl//tsl/profiler/protobuf:xplane_proto_cc", diff --git a/xla/backends/profiler/cpu/host_tracer.cc b/xla/backends/profiler/cpu/host_tracer.cc index 0dc8800a25ac1..7b766a8f82b77 100644 --- a/xla/backends/profiler/cpu/host_tracer.cc +++ b/xla/backends/profiler/cpu/host_tracer.cc @@ -22,13 +22,13 @@ limitations under the License. #include "absl/log/log.h" #include "absl/status/status.h" +#include "xla/tsl/platform/errors.h" #include "xla/tsl/profiler/backends/cpu/host_tracer_utils.h" #include "xla/tsl/profiler/backends/cpu/threadpool_listener.h" #include "xla/tsl/profiler/backends/cpu/traceme_recorder.h" #include "xla/tsl/profiler/utils/time_utils.h" #include "xla/tsl/profiler/utils/xplane_schema.h" #include "xla/tsl/profiler/utils/xplane_utils.h" -#include "tsl/platform/errors.h" #include "tsl/profiler/lib/profiler_collection.h" #include "tsl/profiler/lib/profiler_interface.h" #include "tsl/profiler/protobuf/xplane.pb.h" diff --git a/xla/backends/profiler/cpu/host_tracer_test.cc b/xla/backends/profiler/cpu/host_tracer_test.cc index 7f7a12ff52b52..05e8616e9544f 100644 --- a/xla/backends/profiler/cpu/host_tracer_test.cc +++ b/xla/backends/profiler/cpu/host_tracer_test.cc @@ -24,14 +24,14 @@ limitations under the License. #include "absl/synchronization/blocking_counter.h" #include "absl/types/optional.h" #include "xla/tsl/lib/core/status_test_util.h" +#include "xla/tsl/platform/env.h" +#include "xla/tsl/platform/test.h" +#include "xla/tsl/platform/threadpool.h" +#include "xla/tsl/platform/types.h" #include "xla/tsl/profiler/utils/tf_xplane_visitor.h" #include "xla/tsl/profiler/utils/timespan.h" #include "xla/tsl/profiler/utils/xplane_schema.h" #include "xla/tsl/profiler/utils/xplane_visitor.h" -#include "tsl/platform/env.h" -#include "tsl/platform/test.h" -#include "tsl/platform/threadpool.h" -#include "tsl/platform/types.h" #include "tsl/profiler/lib/profiler_interface.h" #include "tsl/profiler/lib/traceme.h" #include "tsl/profiler/protobuf/xplane.pb.h" diff --git a/xla/backends/profiler/cpu/python_tracer.cc b/xla/backends/profiler/cpu/python_tracer.cc index 22704dec28756..f17390af47833 100644 --- a/xla/backends/profiler/cpu/python_tracer.cc +++ b/xla/backends/profiler/cpu/python_tracer.cc @@ -19,8 +19,8 @@ limitations under the License. #include "absl/log/log.h" #include "absl/status/status.h" #include "xla/python/profiler/internal/python_hooks.h" -#include "tsl/platform/errors.h" -#include "tsl/platform/logging.h" +#include "xla/tsl/platform/errors.h" +#include "xla/tsl/platform/logging.h" #include "tsl/profiler/lib/profiler_interface.h" #include "tsl/profiler/protobuf/xplane.pb.h" diff --git a/xla/hlo/parser/BUILD b/xla/hlo/parser/BUILD index 8591a3f7ff732..8db79548d8ebf 100644 --- a/xla/hlo/parser/BUILD +++ b/xla/hlo/parser/BUILD @@ -44,6 +44,9 @@ cc_library( "//xla/service:name_uniquer", "//xla/service:shape_inference", "//xla/tsl/lib/gtl:map_util", + "//xla/tsl/platform:errors", + "//xla/tsl/platform:logging", + "//xla/tsl/platform:status", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/base", "@com_google_absl//absl/container:flat_hash_map", @@ -56,9 +59,6 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:span", "@eigen_archive//:eigen3", - "@tsl//tsl/platform:errors", - "@tsl//tsl/platform:logging", - "@tsl//tsl/platform:status", ], ) @@ -81,6 +81,11 @@ xla_cc_test( "//xla/service:hlo_module_config", "//xla/service:pattern_matcher", "//xla/tsl/lib/core:status_test_util", + "//xla/tsl/platform:errors", + "//xla/tsl/platform:status_matchers", + "//xla/tsl/platform:statusor", + "//xla/tsl/platform:test", + "//xla/tsl/platform:test_main", "@com_google_absl//absl/log", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", @@ -88,10 +93,6 @@ xla_cc_test( "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", - "@tsl//tsl/platform:errors", - "@tsl//tsl/platform:status_matchers", - "@tsl//tsl/platform:statusor", - "@tsl//tsl/platform:test", ], ) @@ -105,12 +106,12 @@ cc_library( "//xla:shape_util", "//xla:util", "//xla:xla_data_proto_cc", + "//xla/tsl/platform:logging", "@com_google_absl//absl/base", "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "@tsl//tsl/platform:logging", "@tsl//tsl/platform:numbers", "@tsl//tsl/platform:regexp", ], diff --git a/xla/hlo/parser/hlo_lexer.h b/xla/hlo/parser/hlo_lexer.h index f787392b39b37..9b034d7f7fe9a 100644 --- a/xla/hlo/parser/hlo_lexer.h +++ b/xla/hlo/parser/hlo_lexer.h @@ -22,8 +22,8 @@ limitations under the License. #include #include "absl/strings/string_view.h" +#include "xla/tsl/platform/logging.h" #include "xla/xla_data.pb.h" -#include "tsl/platform/logging.h" #include "tsl/platform/regexp.h" namespace xla { diff --git a/xla/hlo/parser/hlo_parser.cc b/xla/hlo/parser/hlo_parser.cc index 3fe33f02dc4cc..126a31bac8d2f 100644 --- a/xla/hlo/parser/hlo_parser.cc +++ b/xla/hlo/parser/hlo_parser.cc @@ -75,12 +75,12 @@ limitations under the License. #include "xla/shape_layout.h" #include "xla/shape_util.h" #include "xla/tsl/lib/gtl/map_util.h" +#include "xla/tsl/platform/errors.h" +#include "xla/tsl/platform/logging.h" +#include "xla/tsl/platform/status.h" #include "xla/types.h" #include "xla/util.h" #include "xla/xla_data.pb.h" -#include "tsl/platform/errors.h" -#include "tsl/platform/logging.h" -#include "tsl/platform/status.h" namespace xla { diff --git a/xla/hlo/parser/hlo_parser_test.cc b/xla/hlo/parser/hlo_parser_test.cc index c9129a09490a4..df7ba2501dbaf 100644 --- a/xla/hlo/parser/hlo_parser_test.cc +++ b/xla/hlo/parser/hlo_parser_test.cc @@ -50,12 +50,12 @@ limitations under the License. #include "xla/shape.h" #include "xla/shape_util.h" #include "xla/tsl/lib/core/status_test_util.h" +#include "xla/tsl/platform/errors.h" +#include "xla/tsl/platform/status_matchers.h" +#include "xla/tsl/platform/statusor.h" +#include "xla/tsl/platform/test.h" #include "xla/window_util.h" #include "xla/xla_data.pb.h" -#include "tsl/platform/errors.h" -#include "tsl/platform/status_matchers.h" -#include "tsl/platform/statusor.h" -#include "tsl/platform/test.h" namespace xla { namespace {