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: 715167258
  • Loading branch information
sdasgup3 authored and Google-ML-Automation committed Jan 14, 2025
1 parent 1f8540e commit 7d912e5
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 20 deletions.
5 changes: 2 additions & 3 deletions xla/hlo/transforms/collectives/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,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/strings:string_view",
"@com_google_googletest//:gtest_main",
Expand Down Expand Up @@ -189,11 +189,10 @@ xla_cc_test(
srcs = ["collectives_schedule_linearizer_test.cc"],
deps = [
":collectives_schedule_linearizer",
"//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:pattern_matcher",
"@com_google_googletest//:gtest_main",
],
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_opcode.h"
#include "xla/hlo/ir/hlo_schedule.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/side_effect_util.h"
#include "xla/tsl/lib/core/status_test_util.h"
#include "xla/util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,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_helpers.h"
#include "xla/service/pattern_matcher.h"
#include "xla/test.h"
#include "xla/test_helpers.h"
#include "xla/xla_data.pb.h"

namespace xla {
Expand Down
4 changes: 2 additions & 2 deletions xla/pjrt/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ xla_cc_test(
"//xla:literal_util",
"//xla:shape_util",
"//xla:status_macros",
"//xla:test",
"//xla:types",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/ffi",
"//xla/ffi:ffi_api",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/testlib:test",
"//xla/pjrt:host_memory_spaces",
"//xla/pjrt:mlir_to_hlo",
"//xla/pjrt:pjrt_client",
Expand Down Expand Up @@ -390,9 +390,9 @@ xla_test(
":se_gpu_pjrt_compiler_impl",
"//xla:literal",
"//xla:literal_util",
"//xla:test",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/testlib:test",
"//xla/mlir_hlo",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_compiler",
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/gpu/se_gpu_pjrt_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ limitations under the License.
#include "xla/ffi/ffi_api.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/testlib/test.h"
#include "xla/layout.h"
#include "xla/literal.h"
#include "xla/literal_util.h"
Expand All @@ -63,7 +64,6 @@ limitations under the License.
#include "xla/status_macros.h"
#include "xla/stream_executor/device_memory.h"
#include "xla/stream_executor/stream.h"
#include "xla/test.h"
#include "xla/tests/literal_test_util.h"
#include "xla/tsl/lib/core/status_test_util.h"
#include "xla/tsl/platform/subprocess.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/gpu/se_gpu_pjrt_compiler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ limitations under the License.
#include "mlir/Parser/Parser.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/testlib/test.h"
#include "xla/literal.h"
#include "xla/literal_util.h"
#include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
Expand All @@ -38,7 +39,6 @@ limitations under the License.
#include "xla/pjrt/pjrt_compiler.h"
#include "xla/pjrt/pjrt_executable.h"
#include "xla/pjrt/plugin/xla_gpu/xla_gpu_client_options.h"
#include "xla/test.h"
#include "xla/tests/literal_test_util.h"
#include "tsl/platform/status_matchers.h"
#include "tsl/platform/statusor.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/gpu/fusions/triton/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ xla_test(
"//xla:xla_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:filecheck",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/hlo/testlib:verified_hlo_module",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/service/gpu:backend_configs_cc",
"//xla/service/gpu:gpu_device_info_for_tests",
"//xla/service/gpu/model:tiled_hlo_instruction_or_computation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ limitations under the License.
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_instructions.h"
#include "xla/hlo/testlib/filecheck.h"
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
#include "xla/hlo/testlib/verified_hlo_module.h"
#include "xla/service/gpu/backend_configs.pb.h"
#include "xla/service/gpu/fusions/triton/triton_fusion_emitter.h"
Expand All @@ -43,7 +44,6 @@ limitations under the License.
#include "xla/service/gpu/model/tiled_hlo_computation.h"
#include "xla/service/gpu/tests/gpu_codegen_test.h"
#include "xla/service/pattern_matcher.h"
#include "xla/service/pattern_matcher_gmock.h"
#include "xla/stream_executor/device_description.h"
#include "xla/tsl/lib/core/status_test_util.h"
#include "xla/tsl/platform/env.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/llvm_ir/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ xla_cc_test(
":ir_array",
":llvm_util",
"//xla:shape_util",
"//xla:test",
"//xla:xla_data_proto_cc",
"//xla/hlo/testlib:filecheck",
"//xla/tests:xla_internal_test_main",
"@com_google_googletest//:gtest_main",
"@llvm-project//llvm:Support",
"@llvm-project//llvm:ir_headers",
"@tsl//tsl/platform:statusor",
Expand Down
2 changes: 1 addition & 1 deletion xla/service/llvm_ir/ir_array_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.

#include <string>

#include <gtest/gtest.h>
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/BasicBlock.h"
Expand All @@ -29,7 +30,6 @@ limitations under the License.
#include "xla/service/llvm_ir/llvm_util.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/test.h"
#include "xla/xla_data.pb.h"
#include "tsl/platform/statusor.h"

Expand Down
2 changes: 1 addition & 1 deletion xla/stream_executor/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cc_library(
hdrs = ["mock_context.h"],
deps = [
":context",
"//xla:test",
"//xla/hlo/testlib:test",
],
)

Expand Down
2 changes: 1 addition & 1 deletion xla/stream_executor/gpu/mock_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ limitations under the License.
#ifndef XLA_STREAM_EXECUTOR_GPU_MOCK_CONTEXT_H_
#define XLA_STREAM_EXECUTOR_GPU_MOCK_CONTEXT_H_

#include "xla/hlo/testlib/test.h"
#include "xla/stream_executor/gpu/context.h"
#include "xla/test.h"

namespace stream_executor::gpu {

Expand Down
2 changes: 1 addition & 1 deletion xla/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ xla_cc_test(
srcs = ["prepare_reference_module_test.cc"],
deps = [
":prepare_reference_module",
"//xla:test",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:test",
"//xla/tests:hlo_test_base",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:statusor",
Expand Down
2 changes: 1 addition & 1 deletion xla/tools/hlo_bisect/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ xla_cc_test(
":hlo_bisect_state",
"//xla:literal",
"//xla/hlo/ir:hlo",
"//xla/hlo/testlib:pattern_matcher_gmock",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
"//xla/tests:hlo_test_base",
"//xla/tests:xla_internal_test_main",
"@com_google_absl//absl/algorithm:container",
Expand Down
2 changes: 1 addition & 1 deletion xla/tools/hlo_bisect/hlo_bisect_state_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ limitations under the License.
#include "absl/status/statusor.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_opcode.h"
#include "xla/hlo/testlib/pattern_matcher_gmock.h"
#include "xla/literal.h"
#include "xla/service/pattern_matcher.h"
#include "xla/service/pattern_matcher_gmock.h"
#include "xla/tests/hlo_test_base.h"

namespace xla {
Expand Down
2 changes: 1 addition & 1 deletion xla/tools/prepare_reference_module_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#include "xla/tools/prepare_reference_module.h"

#include "xla/hlo/ir/hlo_module.h"
#include "xla/test.h"
#include "xla/hlo/testlib/test.h"
#include "xla/tests/hlo_test_base.h"
#include "tsl/platform/statusor.h"

Expand Down

0 comments on commit 7d912e5

Please sign in to comment.