From b65296231ed6da36368466fd27b0b66f476b84ba Mon Sep 17 00:00:00 2001 From: Sandeep Dasgupta Date: Sat, 11 Jan 2025 13:43:44 -0800 Subject: [PATCH] [HLO Componentization] Populate hlo/testlib sub-component (Phase II). This CL takes care of 1. Migrating external projects dependencies from ``` tensorflow/compiler/xla:test tensorflow/compiler/xla:test_helpers tensorflow/compiler/xla/service:pattern_matcher_gmock ``` to `tensorflow/compiler/xla/hlo/testlib:*` PiperOrigin-RevId: 714495819 --- xla/hlo/transforms/BUILD | 42 +++++++++---------- .../transforms/bfloat16_propagation_test.cc | 4 +- .../expanders/convolution_4d_expander_test.cc | 2 +- .../convolution_pred_expander_test.cc | 2 +- .../expanders/dot_decomposer_test.cc | 2 +- .../expanders/dynamic_index_splitter_test.cc | 4 +- .../expanders/logistic_expander_test.cc | 4 +- .../expanders/real_imag_expander_test.cc | 4 +- .../expanders/reduce_decomposer_test.cc | 4 +- .../expanders/reshape_decomposer_test.cc | 4 +- .../expanders/stable_sort_expander_test.cc | 4 +- .../transforms/host_offload_legalize_test.cc | 2 +- xla/hlo/transforms/host_offloader_test.cc | 2 +- .../while_loop_trip_count_annotator_test.cc | 2 +- 14 files changed, 41 insertions(+), 41 deletions(-) diff --git a/xla/hlo/transforms/BUILD b/xla/hlo/transforms/BUILD index 2c8f45317a59e..9530c89d5494e 100644 --- a/xla/hlo/transforms/BUILD +++ b/xla/hlo/transforms/BUILD @@ -56,11 +56,11 @@ xla_cc_test( "//xla:comparison_util", "//xla:literal_util", "//xla:shape_util", - "//xla:test", - "//xla:test_helpers", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:test", + "//xla/hlo/testlib:test_helpers", "//xla/service:float_support", "//xla/service:hlo_verifier", "//xla/tests:literal_test_util", @@ -202,14 +202,14 @@ xla_cc_test( ":real_imag_expander", "//xla:literal", "//xla:shape_util", - "//xla:test", "//xla:types", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", + "//xla/hlo/testlib:test", "//xla/hlo/utils:hlo_matchers", "//xla/service:hlo_creation_utils", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "//xla/tsl/lib/core:status_test_util", "@com_google_googletest//:gtest", "@tsl//tsl/platform:test_main", @@ -268,9 +268,9 @@ xla_cc_test( srcs = ["expanders/convolution_4d_expander_test.cc"], deps = [ "convolution_4d_expander", - "//xla:test", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:test", "@com_google_googletest//:gtest", "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:test_main", @@ -304,8 +304,8 @@ xla_cc_test( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "@com_google_googletest//:gtest_main", "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:test_main", @@ -335,14 +335,14 @@ xla_cc_test( srcs = ["expanders/logistic_expander_test.cc"], deps = [ ":logistic_expander", - "//xla:test", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", + "//xla/hlo/testlib:test", "//xla/service:dynamic_padder", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", "@tsl//tsl/platform:statusor", @@ -417,9 +417,9 @@ xla_cc_test( srcs = ["while_loop_trip_count_annotator_test.cc"], deps = [ ":while_loop_trip_count_annotator", - "//xla:test", "//xla:xla_data_proto_cc", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:test", "@com_google_googletest//:gtest", "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:test_main", # fixdeps: keep @@ -512,9 +512,9 @@ xla_cc_test( ":dot_decomposer", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", "//xla/hlo/utils:hlo_matchers", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", "@tsl//tsl/platform:statusor", @@ -560,10 +560,10 @@ xla_cc_test( srcs = ["expanders/reduce_decomposer_test.cc"], deps = [ ":reduce_decomposer", - "//xla:test", - "//xla:test_helpers", "//xla/hlo/parser:hlo_parser", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:test", + "//xla/hlo/testlib:test_helpers", "@com_google_googletest//:gtest", "@tsl//tsl/platform:test_main", ], @@ -574,10 +574,10 @@ xla_cc_test( srcs = ["expanders/reshape_decomposer_test.cc"], deps = [ ":reshape_decomposer", - "//xla:test", - "//xla:test_helpers", "//xla/hlo/parser:hlo_parser", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:test", + "//xla/hlo/testlib:test_helpers", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", @@ -638,13 +638,13 @@ xla_cc_test( srcs = ["expanders/stable_sort_expander_test.cc"], deps = [ ":stable_sort_expander", - "//xla:test", "//xla/hlo/parser:hlo_parser", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", + "//xla/hlo/testlib:test", "//xla/hlo/transforms/simplifiers:algebraic_simplifier", "//xla/hlo/utils:hlo_matchers", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "//xla/tsl/lib/core:status_test_util", "@com_google_googletest//:gtest", "@tsl//tsl/platform:test_main", @@ -729,9 +729,9 @@ xla_cc_test( "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", "//xla/service:host_memory_offload_annotations_hdr", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "//xla/tsl/lib/core:status_test_util", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/status", @@ -790,12 +790,12 @@ xla_cc_test( "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", "//xla/hlo/testlib:verified_hlo_module", "//xla/service:hlo_verifier", "//xla/service:host_memory_offload_annotations_hdr", "//xla/service:host_offload_utils", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "//xla/tsl/lib/core:status_test_util", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/log", @@ -925,11 +925,11 @@ xla_cc_test( srcs = ["expanders/dynamic_index_splitter_test.cc"], deps = [ ":dynamic_index_splitter", - "//xla:test", - "//xla:test_helpers", "//xla:xla_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:test", + "//xla/hlo/testlib:test_helpers", "//xla/hlo/utils:hlo_matchers", "@com_google_googletest//:gtest", "@tsl//tsl/platform:test_main", @@ -1094,9 +1094,9 @@ xla_cc_test( "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/testlib:hlo_hardware_independent_test_base", + "//xla/hlo/testlib:pattern_matcher_gmock", "//xla/hlo/testlib:verified_hlo_module", "//xla/service:pattern_matcher", - "//xla/service:pattern_matcher_gmock", "//xla/tsl/lib/core:status_test_util", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", diff --git a/xla/hlo/transforms/bfloat16_propagation_test.cc b/xla/hlo/transforms/bfloat16_propagation_test.cc index cd6fb335fbf65..cf14c05d6a736 100644 --- a/xla/hlo/transforms/bfloat16_propagation_test.cc +++ b/xla/hlo/transforms/bfloat16_propagation_test.cc @@ -28,13 +28,13 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/test.h" +#include "xla/hlo/testlib/test_helpers.h" #include "xla/literal_util.h" #include "xla/service/float_support.h" #include "xla/service/hlo_verifier.h" #include "xla/shape.h" #include "xla/shape_util.h" -#include "xla/test.h" -#include "xla/test_helpers.h" #include "xla/tests/literal_test_util.h" #include "xla/xla_data.pb.h" #include "tsl/platform/statusor.h" diff --git a/xla/hlo/transforms/expanders/convolution_4d_expander_test.cc b/xla/hlo/transforms/expanders/convolution_4d_expander_test.cc index 82e0077bbec3f..3221a01c52868 100644 --- a/xla/hlo/transforms/expanders/convolution_4d_expander_test.cc +++ b/xla/hlo/transforms/expanders/convolution_4d_expander_test.cc @@ -23,7 +23,7 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" -#include "xla/test.h" +#include "xla/hlo/testlib/test.h" #include "tsl/platform/statusor.h" namespace xla { diff --git a/xla/hlo/transforms/expanders/convolution_pred_expander_test.cc b/xla/hlo/transforms/expanders/convolution_pred_expander_test.cc index 1c64a2b64f63e..f97744f4b71eb 100644 --- a/xla/hlo/transforms/expanders/convolution_pred_expander_test.cc +++ b/xla/hlo/transforms/expanders/convolution_pred_expander_test.cc @@ -22,8 +22,8 @@ limitations under the License. #include #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" #include "xla/xla_data.pb.h" #include "tsl/platform/statusor.h" diff --git a/xla/hlo/transforms/expanders/dot_decomposer_test.cc b/xla/hlo/transforms/expanders/dot_decomposer_test.cc index 38a62a8b268da..3a5c5e6112a0e 100644 --- a/xla/hlo/transforms/expanders/dot_decomposer_test.cc +++ b/xla/hlo/transforms/expanders/dot_decomposer_test.cc @@ -26,9 +26,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" #include "tsl/platform/statusor.h" #include "tsl/platform/test.h" diff --git a/xla/hlo/transforms/expanders/dynamic_index_splitter_test.cc b/xla/hlo/transforms/expanders/dynamic_index_splitter_test.cc index 4e32488eb12ba..a7727224a6ecd 100644 --- a/xla/hlo/transforms/expanders/dynamic_index_splitter_test.cc +++ b/xla/hlo/transforms/expanders/dynamic_index_splitter_test.cc @@ -20,9 +20,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/test.h" +#include "xla/hlo/testlib/test_helpers.h" #include "xla/hlo/utils/hlo_matchers.h" -#include "xla/test.h" -#include "xla/test_helpers.h" #include "xla/xla.pb.h" namespace xla { diff --git a/xla/hlo/transforms/expanders/logistic_expander_test.cc b/xla/hlo/transforms/expanders/logistic_expander_test.cc index 2b14f3b4f4c5d..a2314a50df282 100644 --- a/xla/hlo/transforms/expanders/logistic_expander_test.cc +++ b/xla/hlo/transforms/expanders/logistic_expander_test.cc @@ -24,10 +24,10 @@ limitations under the License. #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/parser/hlo_parser.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" +#include "xla/hlo/testlib/test.h" #include "xla/service/dynamic_padder.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" -#include "xla/test.h" #include "xla/xla_data.pb.h" #include "tsl/platform/statusor.h" diff --git a/xla/hlo/transforms/expanders/real_imag_expander_test.cc b/xla/hlo/transforms/expanders/real_imag_expander_test.cc index 31470dbaf30be..ab5c06f556cbc 100644 --- a/xla/hlo/transforms/expanders/real_imag_expander_test.cc +++ b/xla/hlo/transforms/expanders/real_imag_expander_test.cc @@ -21,13 +21,13 @@ limitations under the License. #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" +#include "xla/hlo/testlib/test.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/literal.h" #include "xla/service/hlo_creation_utils.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" #include "xla/shape_util.h" -#include "xla/test.h" #include "xla/tsl/lib/core/status_test_util.h" #include "xla/types.h" diff --git a/xla/hlo/transforms/expanders/reduce_decomposer_test.cc b/xla/hlo/transforms/expanders/reduce_decomposer_test.cc index 75a105606b4f2..e597519e306a0 100644 --- a/xla/hlo/transforms/expanders/reduce_decomposer_test.cc +++ b/xla/hlo/transforms/expanders/reduce_decomposer_test.cc @@ -19,8 +19,8 @@ limitations under the License. #include #include "xla/hlo/parser/hlo_parser.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" -#include "xla/test.h" -#include "xla/test_helpers.h" +#include "xla/hlo/testlib/test.h" +#include "xla/hlo/testlib/test_helpers.h" namespace xla { namespace { diff --git a/xla/hlo/transforms/expanders/reshape_decomposer_test.cc b/xla/hlo/transforms/expanders/reshape_decomposer_test.cc index 587b3e82fdc46..ae937ee77ce13 100644 --- a/xla/hlo/transforms/expanders/reshape_decomposer_test.cc +++ b/xla/hlo/transforms/expanders/reshape_decomposer_test.cc @@ -21,8 +21,8 @@ limitations under the License. #include "absl/strings/string_view.h" #include "xla/hlo/parser/hlo_parser.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" -#include "xla/test.h" -#include "xla/test_helpers.h" +#include "xla/hlo/testlib/test.h" +#include "xla/hlo/testlib/test_helpers.h" namespace xla { namespace { diff --git a/xla/hlo/transforms/expanders/stable_sort_expander_test.cc b/xla/hlo/transforms/expanders/stable_sort_expander_test.cc index f7f344ead0cbc..e577e8c557ba7 100644 --- a/xla/hlo/transforms/expanders/stable_sort_expander_test.cc +++ b/xla/hlo/transforms/expanders/stable_sort_expander_test.cc @@ -20,11 +20,11 @@ limitations under the License. #include #include "xla/hlo/parser/hlo_parser.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" +#include "xla/hlo/testlib/test.h" #include "xla/hlo/transforms/simplifiers/algebraic_simplifier.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" -#include "xla/test.h" #include "xla/tsl/lib/core/status_test_util.h" namespace xla { diff --git a/xla/hlo/transforms/host_offload_legalize_test.cc b/xla/hlo/transforms/host_offload_legalize_test.cc index a37a73fc149f9..12e3c6935cdab 100644 --- a/xla/hlo/transforms/host_offload_legalize_test.cc +++ b/xla/hlo/transforms/host_offload_legalize_test.cc @@ -26,9 +26,9 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" #include "xla/service/host_memory_offload_annotations.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" #include "xla/shape.h" #include "xla/shape_util.h" #include "xla/tsl/lib/core/status_test_util.h" diff --git a/xla/hlo/transforms/host_offloader_test.cc b/xla/hlo/transforms/host_offloader_test.cc index 9eff4508838fd..84e748747b68e 100644 --- a/xla/hlo/transforms/host_offloader_test.cc +++ b/xla/hlo/transforms/host_offloader_test.cc @@ -31,6 +31,7 @@ limitations under the License. #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" +#include "xla/hlo/testlib/pattern_matcher_gmock.h" #include "xla/hlo/testlib/verified_hlo_module.h" #include "xla/hlo/transforms/host_offload_legalize.h" #include "xla/layout.h" @@ -38,7 +39,6 @@ limitations under the License. #include "xla/service/host_memory_offload_annotations.h" #include "xla/service/host_offload_utils.h" #include "xla/service/pattern_matcher.h" -#include "xla/service/pattern_matcher_gmock.h" #include "xla/shape.h" #include "xla/shape_util.h" #include "xla/tsl/lib/core/status_test_util.h" diff --git a/xla/hlo/transforms/while_loop_trip_count_annotator_test.cc b/xla/hlo/transforms/while_loop_trip_count_annotator_test.cc index b170bc0d09e66..2391db7f81f5a 100644 --- a/xla/hlo/transforms/while_loop_trip_count_annotator_test.cc +++ b/xla/hlo/transforms/while_loop_trip_count_annotator_test.cc @@ -17,7 +17,7 @@ limitations under the License. #include #include "xla/hlo/testlib/hlo_hardware_independent_test_base.h" -#include "xla/test.h" +#include "xla/hlo/testlib/test.h" #include "xla/xla_data.pb.h" #include "tsl/platform/statusor.h"