Skip to content

Commit 7d912e5

Browse files
sdasgup3Google-ML-Automation
authored andcommitted
[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: 715167258
1 parent 1f8540e commit 7d912e5

16 files changed

+18
-20
lines changed

xla/hlo/transforms/collectives/BUILD

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ xla_cc_test(
8383
"//xla:util",
8484
"//xla/hlo/ir:hlo",
8585
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
86+
"//xla/hlo/testlib:pattern_matcher_gmock",
8687
"//xla/service:pattern_matcher",
87-
"//xla/service:pattern_matcher_gmock",
8888
"//xla/tsl/lib/core:status_test_util",
8989
"@com_google_absl//absl/strings:string_view",
9090
"@com_google_googletest//:gtest_main",
@@ -189,11 +189,10 @@ xla_cc_test(
189189
srcs = ["collectives_schedule_linearizer_test.cc"],
190190
deps = [
191191
":collectives_schedule_linearizer",
192-
"//xla:test",
193-
"//xla:test_helpers",
194192
"//xla:xla_data_proto_cc",
195193
"//xla/hlo/ir:hlo",
196194
"//xla/hlo/testlib:hlo_hardware_independent_test_base",
195+
"//xla/hlo/testlib:test_helpers",
197196
"//xla/service:pattern_matcher",
198197
"@com_google_googletest//:gtest_main",
199198
],

xla/hlo/transforms/collectives/async_collective_creator_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ limitations under the License.
2525
#include "xla/hlo/ir/hlo_opcode.h"
2626
#include "xla/hlo/ir/hlo_schedule.h"
2727
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
28+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
2829
#include "xla/service/pattern_matcher.h"
29-
#include "xla/service/pattern_matcher_gmock.h"
3030
#include "xla/side_effect_util.h"
3131
#include "xla/tsl/lib/core/status_test_util.h"
3232
#include "xla/util.h"

xla/hlo/transforms/collectives/collectives_schedule_linearizer_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ limitations under the License.
1919
#include "xla/hlo/ir/hlo_instruction.h"
2020
#include "xla/hlo/ir/hlo_module.h"
2121
#include "xla/hlo/testlib/hlo_hardware_independent_test_base.h"
22+
#include "xla/hlo/testlib/test_helpers.h"
2223
#include "xla/service/pattern_matcher.h"
23-
#include "xla/test.h"
24-
#include "xla/test_helpers.h"
2524
#include "xla/xla_data.pb.h"
2625

2726
namespace xla {

xla/pjrt/gpu/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ xla_cc_test(
167167
"//xla:literal_util",
168168
"//xla:shape_util",
169169
"//xla:status_macros",
170-
"//xla:test",
171170
"//xla:types",
172171
"//xla:util",
173172
"//xla:xla_data_proto_cc",
174173
"//xla/ffi",
175174
"//xla/ffi:ffi_api",
176175
"//xla/hlo/builder:xla_computation",
177176
"//xla/hlo/parser:hlo_parser",
177+
"//xla/hlo/testlib:test",
178178
"//xla/pjrt:host_memory_spaces",
179179
"//xla/pjrt:mlir_to_hlo",
180180
"//xla/pjrt:pjrt_client",
@@ -390,9 +390,9 @@ xla_test(
390390
":se_gpu_pjrt_compiler_impl",
391391
"//xla:literal",
392392
"//xla:literal_util",
393-
"//xla:test",
394393
"//xla/hlo/builder:xla_computation",
395394
"//xla/hlo/parser:hlo_parser",
395+
"//xla/hlo/testlib:test",
396396
"//xla/mlir_hlo",
397397
"//xla/pjrt:pjrt_client",
398398
"//xla/pjrt:pjrt_compiler",

xla/pjrt/gpu/se_gpu_pjrt_client_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ limitations under the License.
4242
#include "xla/ffi/ffi_api.h"
4343
#include "xla/hlo/builder/xla_computation.h"
4444
#include "xla/hlo/parser/hlo_parser.h"
45+
#include "xla/hlo/testlib/test.h"
4546
#include "xla/layout.h"
4647
#include "xla/literal.h"
4748
#include "xla/literal_util.h"
@@ -63,7 +64,6 @@ limitations under the License.
6364
#include "xla/status_macros.h"
6465
#include "xla/stream_executor/device_memory.h"
6566
#include "xla/stream_executor/stream.h"
66-
#include "xla/test.h"
6767
#include "xla/tests/literal_test_util.h"
6868
#include "xla/tsl/lib/core/status_test_util.h"
6969
#include "xla/tsl/platform/subprocess.h"

xla/pjrt/gpu/se_gpu_pjrt_compiler_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ limitations under the License.
2929
#include "mlir/Parser/Parser.h"
3030
#include "xla/hlo/builder/xla_computation.h"
3131
#include "xla/hlo/parser/hlo_parser.h"
32+
#include "xla/hlo/testlib/test.h"
3233
#include "xla/literal.h"
3334
#include "xla/literal_util.h"
3435
#include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
@@ -38,7 +39,6 @@ limitations under the License.
3839
#include "xla/pjrt/pjrt_compiler.h"
3940
#include "xla/pjrt/pjrt_executable.h"
4041
#include "xla/pjrt/plugin/xla_gpu/xla_gpu_client_options.h"
41-
#include "xla/test.h"
4242
#include "xla/tests/literal_test_util.h"
4343
#include "tsl/platform/status_matchers.h"
4444
#include "tsl/platform/statusor.h"

xla/service/gpu/fusions/triton/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,9 @@ xla_test(
564564
"//xla:xla_proto_cc",
565565
"//xla/hlo/ir:hlo",
566566
"//xla/hlo/testlib:filecheck",
567+
"//xla/hlo/testlib:pattern_matcher_gmock",
567568
"//xla/hlo/testlib:verified_hlo_module",
568569
"//xla/service:pattern_matcher",
569-
"//xla/service:pattern_matcher_gmock",
570570
"//xla/service/gpu:backend_configs_cc",
571571
"//xla/service/gpu:gpu_device_info_for_tests",
572572
"//xla/service/gpu/model:tiled_hlo_instruction_or_computation",

xla/service/gpu/fusions/triton/triton_fusion_emitter_device_legacy_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ limitations under the License.
3535
#include "xla/hlo/ir/hlo_instruction.h"
3636
#include "xla/hlo/ir/hlo_instructions.h"
3737
#include "xla/hlo/testlib/filecheck.h"
38+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
3839
#include "xla/hlo/testlib/verified_hlo_module.h"
3940
#include "xla/service/gpu/backend_configs.pb.h"
4041
#include "xla/service/gpu/fusions/triton/triton_fusion_emitter.h"
@@ -43,7 +44,6 @@ limitations under the License.
4344
#include "xla/service/gpu/model/tiled_hlo_computation.h"
4445
#include "xla/service/gpu/tests/gpu_codegen_test.h"
4546
#include "xla/service/pattern_matcher.h"
46-
#include "xla/service/pattern_matcher_gmock.h"
4747
#include "xla/stream_executor/device_description.h"
4848
#include "xla/tsl/lib/core/status_test_util.h"
4949
#include "xla/tsl/platform/env.h"

xla/service/llvm_ir/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ xla_cc_test(
338338
":ir_array",
339339
":llvm_util",
340340
"//xla:shape_util",
341-
"//xla:test",
342341
"//xla:xla_data_proto_cc",
343342
"//xla/hlo/testlib:filecheck",
344343
"//xla/tests:xla_internal_test_main",
344+
"@com_google_googletest//:gtest_main",
345345
"@llvm-project//llvm:Support",
346346
"@llvm-project//llvm:ir_headers",
347347
"@tsl//tsl/platform:statusor",

xla/service/llvm_ir/ir_array_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717

1818
#include <string>
1919

20+
#include <gtest/gtest.h>
2021
#include "llvm/ADT/ArrayRef.h"
2122
#include "llvm/IR/Argument.h"
2223
#include "llvm/IR/BasicBlock.h"
@@ -29,7 +30,6 @@ limitations under the License.
2930
#include "xla/service/llvm_ir/llvm_util.h"
3031
#include "xla/shape.h"
3132
#include "xla/shape_util.h"
32-
#include "xla/test.h"
3333
#include "xla/xla_data.pb.h"
3434
#include "tsl/platform/statusor.h"
3535

xla/stream_executor/gpu/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ cc_library(
9494
hdrs = ["mock_context.h"],
9595
deps = [
9696
":context",
97-
"//xla:test",
97+
"//xla/hlo/testlib:test",
9898
],
9999
)
100100

xla/stream_executor/gpu/mock_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ limitations under the License.
1616
#ifndef XLA_STREAM_EXECUTOR_GPU_MOCK_CONTEXT_H_
1717
#define XLA_STREAM_EXECUTOR_GPU_MOCK_CONTEXT_H_
1818

19+
#include "xla/hlo/testlib/test.h"
1920
#include "xla/stream_executor/gpu/context.h"
20-
#include "xla/test.h"
2121

2222
namespace stream_executor::gpu {
2323

xla/tools/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ xla_cc_test(
408408
srcs = ["prepare_reference_module_test.cc"],
409409
deps = [
410410
":prepare_reference_module",
411-
"//xla:test",
412411
"//xla/hlo/ir:hlo",
412+
"//xla/hlo/testlib:test",
413413
"//xla/tests:hlo_test_base",
414414
"@com_google_googletest//:gtest_main",
415415
"@tsl//tsl/platform:statusor",

xla/tools/hlo_bisect/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ xla_cc_test(
6363
":hlo_bisect_state",
6464
"//xla:literal",
6565
"//xla/hlo/ir:hlo",
66+
"//xla/hlo/testlib:pattern_matcher_gmock",
6667
"//xla/service:pattern_matcher",
67-
"//xla/service:pattern_matcher_gmock",
6868
"//xla/tests:hlo_test_base",
6969
"//xla/tests:xla_internal_test_main",
7070
"@com_google_absl//absl/algorithm:container",

xla/tools/hlo_bisect/hlo_bisect_state_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ limitations under the License.
2424
#include "absl/status/statusor.h"
2525
#include "xla/hlo/ir/hlo_module.h"
2626
#include "xla/hlo/ir/hlo_opcode.h"
27+
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
2728
#include "xla/literal.h"
2829
#include "xla/service/pattern_matcher.h"
29-
#include "xla/service/pattern_matcher_gmock.h"
3030
#include "xla/tests/hlo_test_base.h"
3131

3232
namespace xla {

xla/tools/prepare_reference_module_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616
#include "xla/tools/prepare_reference_module.h"
1717

1818
#include "xla/hlo/ir/hlo_module.h"
19-
#include "xla/test.h"
19+
#include "xla/hlo/testlib/test.h"
2020
#include "xla/tests/hlo_test_base.h"
2121
#include "tsl/platform/statusor.h"
2222

0 commit comments

Comments
 (0)