Skip to content

Commit

Permalink
[HLO Componentization] Populate hlo/testlib sub-component (Phase II).
Browse files Browse the repository at this point in the history
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: 718535002
  • Loading branch information
sdasgup3 authored and tensorflower-gardener committed Jan 22, 2025
1 parent ebd788d commit 47f7619
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 81 deletions.
70 changes: 25 additions & 45 deletions third_party/xla/xla/hlo/transforms/simplifiers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ xla_cc_test(
deps = [
":hlo_constant_splitter",
":hlo_dce",
"//xla:test",
"//xla:util",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
Expand Down Expand Up @@ -85,9 +84,9 @@ xla_cc_test(
srcs = ["all_reduce_folder_test.cc"],
deps = [
":all_reduce_folder",
"//xla:test",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:test",
"//xla/hlo/utils:hlo_matchers",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -119,8 +118,6 @@ xla_cc_test(
srcs = ["broadcast_canonicalizer_test.cc"],
deps = [
":broadcast_canonicalizer",
"//xla:test",
"//xla:test_helpers",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"@com_google_googletest//:gtest_main", # fixdeps: keep
],
Expand Down Expand Up @@ -155,11 +152,10 @@ xla_cc_test(
deps = [
":bfloat16_conversion_folding",
"//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_helpers",
"//xla/service:float_support",
"@com_google_absl//absl/status:statusor",
"@com_google_googletest//:gtest_main",
Expand Down Expand Up @@ -198,16 +194,16 @@ xla_cc_test(
deps = [
":float_normalization",
"//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:pattern_matcher_gmock",
"//xla/hlo/testlib:test",
"//xla/hlo/testlib:test_helpers",
"//xla/service:float_support",
"//xla/service:hlo_creation_utils",
"//xla/service:hlo_verifier",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings:string_view",
"@com_google_googletest//:gtest",
Expand Down Expand Up @@ -243,7 +239,6 @@ xla_cc_test(
":hlo_computation_deduplicator",
"//xla:literal_util",
"//xla:shape_util",
"//xla:test",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
Expand Down Expand Up @@ -279,7 +274,6 @@ xla_cc_test(
"//xla:comparison_util",
"//xla:literal_util",
"//xla:shape_util",
"//xla:test",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
Expand Down Expand Up @@ -404,24 +398,23 @@ xla_cc_test(
srcs = ["algebraic_simplifier_test.cc"],
deps = [
":algebraic_simplifier",
":hlo_constant_folding",
"//xla:comparison_util",
"//xla:literal",
"//xla:literal_util",
"//xla:shape_util",
"//xla:test",
"//xla:util",
"//xla:window_util",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/hlo/testlib:test",
"//xla/service:hlo_creation_utils",
"//xla/service:host_memory_offload_annotations_hdr",
"//xla/service:layout_assignment",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/service:shape_inference",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -495,9 +488,9 @@ xla_cc_test(
srcs = ["batch_dot_simplification_test.cc"],
deps = [
":batch_dot_simplification",
"//xla:test",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:test",
"//xla/hlo/utils:hlo_matchers",
"@com_google_googletest//:gtest_main", # fixdeps: keep
"@local_tsl//tsl/platform:statusor",
Expand Down Expand Up @@ -535,10 +528,10 @@ xla_cc_test(
srcs = ["convolution_group_converter_test.cc"],
deps = [
":convolution_group_converter",
"//xla:test",
"//xla:types",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:test",
"//xla/hlo/utils:hlo_matchers",
"@com_google_googletest//:gtest_main", # fixdeps: keep
],
Expand Down Expand Up @@ -614,8 +607,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",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/strings:string_view",
"@com_google_googletest//:gtest",
Expand Down Expand Up @@ -654,8 +647,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_absl//absl/strings:string_view",
"@com_google_googletest//:gtest_main",
"@local_tsl//tsl/platform:statusor",
Expand Down Expand Up @@ -684,9 +677,9 @@ xla_cc_test(
deps = [
":tuple_simplifier",
"//xla:shape_util",
"//xla:test",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:test",
"//xla/hlo/utils:hlo_matchers",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/strings",
Expand Down Expand Up @@ -716,20 +709,19 @@ xla_cc_test(
":dynamic_dimension_simplifier",
"//xla:literal",
"//xla:shape_util",
"//xla:test",
"//xla:types",
"//xla:window_util",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/pass:hlo_pass_pipeline",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/hlo/testlib:test",
"//xla/service:hlo_creation_utils",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/service:shape_inference",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest_main", # fixdeps: keep
],
)
Expand Down Expand Up @@ -767,9 +759,9 @@ xla_cc_test(
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/service:hlo_verifier",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest",
Expand Down Expand Up @@ -807,8 +799,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",
"//xla/tests:literal_test_util",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -935,14 +927,14 @@ xla_cc_test(
"//xla:literal_util",
"//xla:permutation_util",
"//xla:shape_util",
"//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/hlo/utils:hlo_matchers",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest_main",
Expand All @@ -959,9 +951,8 @@ xla_cc_test(
# "@com_google_googletest//:gtest",
# "@com_google_googletest//:gtest_main",
# "@com_google_absl//absl/strings:str_format",
# "//xla:test",
# "//xla/hlo/testlib:hlo_hardware_independent_test_base",
# "@local_tsl//tsl/platform:statusor",
# "//xla/tsl/platform:statusor",
# ],
# )
# copybara:uncomment_end
Expand Down Expand Up @@ -1063,7 +1054,6 @@ xla_cc_test(
":zero_sized_hlo_elimination",
"//xla:literal_util",
"//xla:shape_util",
"//xla:test",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
Expand Down Expand Up @@ -1100,13 +1090,11 @@ xla_cc_test(
srcs = ["sort_simplifier_test.cc"],
deps = [
":sort_simplifier",
"//xla:test",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/utils:hlo_matchers",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/hlo/testlib:test",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/tsl/lib/core:status_test_util",
"@com_google_googletest//:gtest_main",
"@local_tsl//tsl/platform:statusor",
],
Expand Down Expand Up @@ -1169,8 +1157,8 @@ 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:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/tsl/lib/core:status_test_util",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -1205,11 +1193,11 @@ xla_cc_test(
srcs = ["fusion_constant_sinking_test.cc"],
deps = [
":fusion_constant_sinking",
"//xla:test",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/hlo/testlib:test",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"@com_google_googletest//:gtest_main",
"@local_tsl//tsl/platform:statusor",
],
Expand Down Expand Up @@ -1241,8 +1229,6 @@ xla_cc_test(
deps = [
":optimize_input_output_buffer_alias",
"//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",
Expand Down Expand Up @@ -1323,17 +1309,12 @@ xla_cc_test(
name = "slice_sinker_test",
srcs = ["slice_sinker_test.cc"],
deps = [
":hlo_dce",
":slice_sinker",
"//xla:literal_util",
"//xla:shape_util",
"//xla:types",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/tsl/lib/core:status_test_util",
"@com_google_googletest//:gtest_main",
"@local_tsl//tsl/platform:statusor",
],
Expand Down Expand Up @@ -1431,7 +1412,6 @@ xla_cc_test(
srcs = ["reduce_window_rewriter_test.cc"],
deps = [
":reduce_window_rewriter",
"//xla:test",
"//xla:xla_data_proto_cc",
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
"@com_google_absl//absl/strings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ limitations under the License.
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/pass/hlo_pass_fix.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/layout_util.h"
#include "xla/literal.h"
#include "xla/literal_util.h"
Expand All @@ -53,11 +55,9 @@ limitations under the License.
#include "xla/service/host_memory_offload_annotations.h"
#include "xla/service/layout_assignment.h"
#include "xla/service/pattern_matcher.h"
#include "xla/service/pattern_matcher_gmock.h"
#include "xla/service/shape_inference.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/test.h"
#include "xla/tsl/lib/core/status_test_util.h"
#include "xla/util.h"
#include "xla/window_util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ 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/utils/hlo_matchers.h"
#include "xla/test.h"
#include "xla/tsl/lib/core/status_test_util.h"
#include "tsl/platform/statusor.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ limitations under the License.
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
#include "xla/hlo/testlib/test.h"
#include "xla/hlo/utils/hlo_matchers.h"
#include "xla/test.h"
#include "tsl/platform/statusor.h"

namespace xla {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ 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_helpers.h"
#include "xla/service/float_support.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/test.h"
#include "xla/test_helpers.h"
#include "xla/xla_data.pb.h"

namespace xla {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ limitations under the License.
#include <optional>

#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
#include "xla/test.h"
#include "xla/test_helpers.h"

namespace xla {
namespace {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ limitations under the License.
#include "absl/strings/string_view.h"
#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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ 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/utils/hlo_matchers.h"
#include "xla/test.h"
#include "xla/types.h"

namespace xla {
Expand Down
Loading

0 comments on commit 47f7619

Please sign in to comment.