Skip to content

Commit

Permalink
[HLO Componentization] Create hlo/parser 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  xla/service --> xla/hlo/parser

Phase I takes care of
1. Migrating xla/service --> xla/hlo/parser
2. Setting up build aliases in xla/service ensuring external dependencies are still satisfied.

PiperOrigin-RevId: 681196104
  • Loading branch information
sdasgup3 authored and Google-ML-Automation committed Oct 1, 2024
1 parent b30b420 commit 02d8355
Show file tree
Hide file tree
Showing 145 changed files with 185 additions and 185 deletions.
4 changes: 2 additions & 2 deletions xla/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ cc_library(
deps = [
":status_macros",
":util",
"//xla/service:hlo_lexer",
"//xla/hlo/parser:hlo_lexer",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
Expand Down Expand Up @@ -910,7 +910,7 @@ cc_library(
":types",
":util",
":xla_data_proto_cc",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"//xla/tsl/lib/io:buffered_inputstream",
"//xla/tsl/lib/io:random_inputstream",
"@com_google_absl//absl/log:check",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/builder/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ xla_cc_test(
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"//xla/service:hlo_proto_cc",
"//xla/service:pattern_matcher",
"//xla/service:pattern_matcher_gmock",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/builder/xla_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ limitations under the License.
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_opcode.h"
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/layout_util.h"
#include "xla/service/hlo.pb.h"
#include "xla/service/hlo_parser.h"
#include "xla/service/pattern_matcher.h"
#include "xla/service/pattern_matcher_gmock.h"
#include "xla/shape.h"
Expand Down
4 changes: 2 additions & 2 deletions xla/hlo/experimental/auto_sharding/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ xla_cc_binary(
deps = [
":auto_sharding",
"//xla/hlo/ir:hlo",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"//xla/tools:hlo_module_loader",
"@com_google_absl//absl/status",
"@tsl//tsl/platform:platform_port",
Expand Down Expand Up @@ -380,12 +380,12 @@ xla_cc_test(
":auto_sharding_strategy",
":auto_sharding_util",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/utils:hlo_live_range",
"//xla/hlo/utils:hlo_matchers",
"//xla/service:buffer_value",
"//xla/service:hlo_alias_analysis",
"//xla/service:hlo_memory_scheduler",
"//xla/service:hlo_parser",
"//xla/service:hlo_value",
"//xla/tests:hlo_test_base",
"//xla/tests:xla_internal_test_main",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/experimental/auto_sharding/auto_sharding_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
#include "absl/status/status.h"
#include "xla/hlo/experimental/auto_sharding/auto_sharding.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/service/hlo_parser.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/tools/hlo_module_loader.h"
#include "tsl/platform/init_main.h"

Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/experimental/auto_sharding/auto_sharding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ limitations under the License.
#include "xla/hlo/ir/hlo_opcode.h"
#include "xla/hlo/ir/hlo_schedule.h"
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/utils/hlo_live_range.h"
#include "xla/hlo/utils/hlo_matchers.h"
#include "xla/service/buffer_value.h"
#include "xla/service/hlo_alias_analysis.h"
#include "xla/service/hlo_memory_scheduler.h"
#include "xla/service/hlo_parser.h"
#include "xla/service/hlo_value.h"
#include "xla/tests/hlo_test_base.h"
#include "xla/tsl/lib/core/status_test_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/ir/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ cc_library(
"//xla:window_util",
"//xla:xla_data_proto_cc",
"//xla:xla_proto_cc",
"//xla/hlo/parser:hlo_lexer",
"//xla/service:compilation_environments",
"//xla/service:computation_layout",
"//xla/service:computation_placer_hdr",
"//xla/service:hlo_lexer",
"//xla/service:hlo_module_config",
"//xla/service:hlo_proto_cc",
"//xla/service:mapped_ptr_container_sorter",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/ir/hlo_instruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ limitations under the License.
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/hlo/ir/hlo_sharding_metadata.h"
#include "xla/hlo/ir/ptrvec.h"
#include "xla/hlo/parser/hlo_lexer.h"
#include "xla/layout.h"
#include "xla/literal.h"
#include "xla/map_util.h"
#include "xla/primitive_util.h"
#include "xla/printer.h"
#include "xla/service/hlo.pb.h"
#include "xla/service/hlo_lexer.h"
#include "xla/service/mapped_ptr_container_sorter.h"
#include "xla/service/name_uniquer.h"
#include "xla/shape.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/pass/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ xla_cc_test(
"//xla:util",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_module_group",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"//xla/tests:hlo_test_base",
"//xla/tests:xla_internal_test_main",
"//xla/tsl/lib/core:status_test_util",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/pass/hlo_pass_pipeline_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ limitations under the License.
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_module_group.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/pass/hlo_pass_interface.h"
#include "xla/service/hlo_parser.h"
#include "xla/test_helpers.h"
#include "xla/tests/hlo_test_base.h"
#include "xla/tsl/lib/core/status_test_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/transforms/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ xla_cc_test(
"//xla:test",
"//xla:util",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/service:hlo_dce",
"//xla/service:hlo_parser",
"//xla/tests:hlo_test_base",
"//xla/tests:xla_internal_test_main",
"//xla/tsl/lib/core:status_test_util",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/transforms/hlo_constant_splitter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ limitations under the License.
#include "xla/hlo/ir/hlo_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_opcode.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/service/hlo_dce.h"
#include "xla/service/hlo_parser.h"
#include "xla/test.h"
#include "xla/tests/hlo_test_base.h"
#include "xla/tsl/lib/core/status_test_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/hlo_to_mhlo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ cc_library(
hdrs = ["translate.h"],
deps = [
":hlo_to_mlir_hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/mlir_hlo",
"//xla/mlir_hlo:mhlo_passes",
"//xla/service:hlo_parser",
"//xla/service:hlo_proto_cc",
"//xla/service/llvm_ir:llvm_util",
"@com_google_absl//absl/status",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/hlo_to_mhlo/translate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ limitations under the License.
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Location.h"
#include "mlir/Pass/PassManager.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/translate/hlo_to_mhlo/hlo_to_mlir_hlo.h"
#include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
#include "xla/mlir_hlo/mhlo/transforms/passes.h"
#include "xla/service/hlo.pb.h"
#include "xla/service/hlo_parser.h"
#include "xla/service/llvm_ir/llvm_util.h"
#include "tsl/platform/protobuf.h"

Expand Down
4 changes: 2 additions & 2 deletions xla/hlo/translate/mhlo_to_hlo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ cc_library(
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/mlir_hlo",
"//xla/service:hlo_parser",
"//xla/service:hlo_proto_cc",
"//xla/stream_executor:dnn",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -125,13 +125,13 @@ cc_library(
"//xla/client/lib:quantize",
"//xla/client/lib:slicing",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/mlir/utils:error_util",
"//xla/mlir/utils:type_util",
"//xla/mlir_hlo",
"//xla/mlir_hlo:mhlo_passes",
"//xla/service:computation_layout",
"//xla/service:hlo_module_config",
"//xla/service:hlo_parser",
"//xla/service:hlo_proto_cc",
"//xla/service/gpu:backend_configs_cc",
"@com_google_absl//absl/log:check",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/mhlo_to_hlo/attribute_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ limitations under the License.
#include "mlir/Support/LLVM.h"
#include "stablehlo/dialect/Base.h"
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
#include "xla/service/hlo.pb.h"
#include "xla/service/hlo_parser.h"
#include "xla/shape_util.h"
#include "xla/util.h"
#include "xla/xla_data.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ limitations under the License.
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_opcode.h"
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/hlo/translate/mhlo_to_hlo/attribute_exporter.h"
#include "xla/hlo/translate/mhlo_to_hlo/layout_util.h"
#include "xla/hlo/translate/mhlo_to_hlo/location_exporter.h"
Expand All @@ -94,7 +95,6 @@ limitations under the License.
#include "xla/service/gpu/backend_configs.pb.h"
#include "xla/service/hlo.pb.h"
#include "xla/service/hlo_module_config.h"
#include "xla/service/hlo_parser.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/xla_data.pb.h"
Expand Down
4 changes: 2 additions & 2 deletions xla/hlo/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ cc_library(
"//xla:test",
"//xla:xla_data_proto_cc",
"//xla/hlo/ir:hlo",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"@com_google_absl//absl/strings",
],
)
Expand Down Expand Up @@ -172,7 +172,7 @@ xla_cc_test(
deps = [
":hlo_query",
"//xla/hlo/ir:hlo",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"//xla/tests:hlo_test_base",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/utils/hlo_matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ limitations under the License.
#include <utility>

#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/service/hlo_parser.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/test.h"
#include "xla/xla_data.pb.h"

Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/utils/hlo_query_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ limitations under the License.
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_opcode.h"
#include "xla/service/hlo_parser.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/tests/hlo_test_base.h"
#include "tsl/platform/statusor.h"

Expand Down
8 changes: 4 additions & 4 deletions xla/pjrt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ cc_library(
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"//xla/tests:literal_test_util",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/synchronization",
Expand Down Expand Up @@ -408,7 +408,7 @@ cc_library(
visibility = ["//xla:friends"],
deps = [
"//xla:shape_util",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status:statusor",
Expand All @@ -425,7 +425,7 @@ cc_library(
visibility = ["//xla:friends"],
deps = [
"//xla:shape_util",
"//xla/service:hlo_parser",
"//xla/hlo/parser:hlo_parser",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
Expand Down Expand Up @@ -891,8 +891,8 @@ xla_cc_test(
deps = [
":tf_pjrt_client",
"//xla:literal_util",
"//xla/hlo/parser:hlo_parser",
"//xla/pjrt/cpu:cpu_client",
"//xla/service:hlo_parser",
"@com_google_googletest//:gtest_main",
"@tsl//tsl/platform:env",
"@tsl//tsl/platform:test",
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/c/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,11 @@ cc_library(
"//xla:xla_proto_cc",
"//xla/client:executable_build_options",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/pjrt:compile_options_proto_cc",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_future",
"//xla/service:computation_placer_hdr",
"//xla/service:hlo_parser",
"//xla/service:hlo_proto_cc",
"//xla/tests:literal_test_util",
"@com_google_absl//absl/base:core_headers",
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/c/pjrt_c_api_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ limitations under the License.
#include "absl/types/span.h"
#include "xla/client/executable_build_options.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/literal.h"
#include "xla/literal_util.h"
#include "xla/pjrt/c/pjrt_c_api.h"
Expand All @@ -46,7 +47,6 @@ limitations under the License.
#include "xla/pjrt/pjrt_future.h"
#include "xla/service/computation_placer.h"
#include "xla/service/hlo.pb.h"
#include "xla/service/hlo_parser.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/tests/literal_test_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/cpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ xla_cc_test(
"//xla/client:xla_computation",
"//xla/ffi",
"//xla/ffi:ffi_api",
"//xla/hlo/parser:hlo_parser",
"//xla/pjrt:host_memory_spaces",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_executable",
"//xla/service:hlo_parser",
"//xla/service:hlo_proto_cc",
"//xla/tests:literal_test_util",
"//xla/tests:test_utils",
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/cpu/cpu_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ limitations under the License.
#include "xla/client/xla_computation.h"
#include "xla/ffi/ffi.h"
#include "xla/ffi/ffi_api.h"
#include "xla/hlo/parser/hlo_parser.h"
#include "xla/literal.h"
#include "xla/literal_util.h"
#include "xla/pjrt/host_memory_spaces.h"
#include "xla/pjrt/pjrt_client.h"
#include "xla/pjrt/pjrt_executable.h"
#include "xla/service/hlo_parser.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/tests/literal_test_util.h"
Expand Down
6 changes: 3 additions & 3 deletions xla/pjrt/gpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ xla_cc_test(
"//xla/client:xla_computation",
"//xla/ffi",
"//xla/ffi:ffi_api",
"//xla/hlo/parser:hlo_parser",
"//xla/pjrt:host_memory_spaces",
"//xla/pjrt:mlir_to_hlo",
"//xla/pjrt:pjrt_client",
Expand All @@ -165,7 +166,6 @@ xla_cc_test(
"//xla/pjrt:pjrt_stream_executor_client",
"//xla/pjrt/distributed:in_memory_key_value_store",
"//xla/service:gpu_plugin",
"//xla/service:hlo_parser",
"//xla/service:platform_util",
"//xla/stream_executor",
"//xla/tests:literal_test_util",
Expand Down Expand Up @@ -311,10 +311,10 @@ xla_test(
":se_gpu_pjrt_compiler",
"//xla:test",
"//xla/client:xla_computation",
"//xla/hlo/parser:hlo_parser",
"//xla/mlir_hlo",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_compiler",
"//xla/service:hlo_parser",
"//xla/tests:literal_test_util",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest",
Expand All @@ -339,12 +339,12 @@ xla_test(
"//xla:literal",
"//xla:literal_util",
"//xla/client:xla_computation",
"//xla/hlo/parser:hlo_parser",
"//xla/mlir_hlo",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_compiler",
"//xla/pjrt:pjrt_executable",
"//xla/service:compiler",
"//xla/service:hlo_parser",
"//xla/tests:literal_test_util",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
Expand Down
Loading

0 comments on commit 02d8355

Please sign in to comment.