Skip to content

Commit

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

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

PiperOrigin-RevId: 681861299
  • Loading branch information
sdasgup3 authored and Google-ML-Automation committed Oct 3, 2024
1 parent 8af9774 commit 5635baf
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions xla/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ cc_library(
srcs = ["client.cc"],
hdrs = ["client.h"],
deps = [
":xla_computation",
"//xla:execution_options_util",
"//xla:literal",
"//xla:shape_util",
Expand All @@ -64,6 +63,7 @@ cc_library(
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla:xla_proto_cc",
"//xla/hlo/builder:xla_computation",
"//xla/service",
"//xla/service:hlo_proto_cc",
"@com_google_absl//absl/status",
Expand Down Expand Up @@ -108,14 +108,14 @@ cc_library(
deps = [
":client",
":executable_build_options",
":xla_computation",
"//xla:debug_options_flags",
"//xla:executable_run_options",
"//xla:literal",
"//xla:shape_tree",
"//xla:shape_util",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/builder:xla_computation",
"//xla/service:backend",
"//xla/service:compiler",
"//xla/service:computation_layout",
Expand Down Expand Up @@ -145,11 +145,11 @@ cc_library(
hdrs = ["compile_only_client.h"],
deps = [
":client",
":xla_computation",
"//xla:shape_util",
"//xla:status_macros",
"//xla:xla_data_proto_cc",
"//xla:xla_proto_cc",
"//xla/hlo/builder:xla_computation",
"//xla/service:compile_only_service",
"//xla/service:compiler",
"//xla/service:hlo_module_config",
Expand Down
2 changes: 1 addition & 1 deletion xla/client/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ limitations under the License.

#include "absl/status/status.h"
#include "absl/types/span.h"
#include "xla/client/xla_computation.h"
#include "xla/execution_options_util.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/layout.h"
#include "xla/literal.h"
#include "xla/service/hlo.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "xla/client/xla_computation.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/layout.h"
#include "xla/literal.h"
#include "xla/service/hlo.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/client/compile_only_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "xla/client/client.h"
#include "xla/client/xla_computation.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/service/compile_only_service.h"
#include "xla/service/compiler.h"
#include "xla/service/hlo_module_config.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/client/local_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ limitations under the License.
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "xla/client/executable_build_options.h"
#include "xla/client/xla_computation.h"
#include "xla/debug_options_flags.h"
#include "xla/executable_run_options.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/literal.h"
#include "xla/service/backend.h"
#include "xla/service/compiler.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/client/local_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ limitations under the License.
#include "absl/types/span.h"
#include "xla/client/client.h"
#include "xla/client/executable_build_options.h"
#include "xla/client/xla_computation.h"
#include "xla/executable_run_options.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/literal.h"
#include "xla/service/backend.h"
#include "xla/service/compiler.h"
Expand Down
20 changes: 10 additions & 10 deletions xla/hlo/translate/mhlo_to_hlo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cc_library(
deps = [
"//xla:shape_util",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -117,13 +117,13 @@ cc_library(
"//xla:status_macros",
"//xla:types",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/client/lib:approx_topk",
"//xla/client/lib:approx_topk_shape",
"//xla/client/lib:matrix",
"//xla/client/lib:quantize",
"//xla/client/lib:slicing",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/builder/lib:approx_topk",
"//xla/hlo/builder/lib:approx_topk_shape",
"//xla/hlo/builder/lib:matrix",
"//xla/hlo/builder/lib:quantize",
"//xla/hlo/builder/lib:slicing",
"//xla/hlo/ir:hlo",
"//xla/mlir/utils:error_util",
"//xla/mlir/utils:type_util",
Expand Down Expand Up @@ -217,8 +217,8 @@ cc_library(
":type_to_shape",
"//xla:debug_options_flags",
"//xla:shape_util",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/mlir_hlo:hlo_dialect_registration",
"//xla/service:hlo_module_config",
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/mhlo_to_hlo/layout_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/mhlo_to_hlo/layout_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/ir/hlo_sharding.h"
#include "xla/shape.h"
#include "xla/xla_data.pb.h"
Expand Down
12 changes: 6 additions & 6 deletions xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ limitations under the License.
#include "mlir/Transforms/RegionUtils.h"
#include "stablehlo/dialect/Base.h"
#include "xla/array.h"
#include "xla/client/lib/approx_topk.h"
#include "xla/client/lib/approx_topk_shape.h"
#include "xla/client/lib/matrix.h" // IWYU pragma: keep
#include "xla/client/lib/slicing.h"
#include "xla/client/xla_builder.h"
#include "xla/client/xla_computation.h"
#include "xla/comparison_util.h"
#include "xla/debug_options_flags.h"
#include "xla/hlo/builder/lib/approx_topk.h"
#include "xla/hlo/builder/lib/approx_topk_shape.h"
#include "xla/hlo/builder/lib/matrix.h" // IWYU pragma: keep
#include "xla/hlo/builder/lib/slicing.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/dynamic_parameter_binding.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_opcode.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/hlo/translate/mhlo_to_hlo/mlir_hlo_to_hlo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/BuiltinOps.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/translate/mhlo_to_hlo/layout_util.h"
#include "xla/service/hlo.pb.h"
Expand Down
4 changes: 2 additions & 2 deletions xla/hlo/translate/mhlo_to_hlo/translate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ limitations under the License.
#include "mlir/Parser/Parser.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Support/LogicalResult.h"
#include "xla/client/xla_builder.h"
#include "xla/client/xla_computation.h"
#include "xla/debug_options_flags.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_input_output_alias_config.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
Expand Down
4 changes: 2 additions & 2 deletions xla/pjrt/cpu/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ cc_library(
"//xla/backends/cpu/runtime:thunk",
"//xla/backends/cpu/runtime:thunk_executor",
"//xla/client:executable_build_options",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/pjrt:compile_options_proto_cc",
"//xla/pjrt:host_memory_spaces",
Expand Down Expand Up @@ -232,9 +232,9 @@ xla_cc_test(
"//xla:types",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/client:xla_computation",
"//xla/ffi",
"//xla/ffi:ffi_api",
"//xla/hlo/builder:xla_computation",
"//xla/pjrt:host_memory_spaces",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_executable",
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/cpu/cpu_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ limitations under the License.
#include "xla/backends/cpu/runtime/thunk.h"
#include "xla/backends/cpu/runtime/thunk_executor.h"
#include "xla/client/executable_build_options.h"
#include "xla/client/xla_computation.h"
#include "xla/debug_options_flags.h"
#include "xla/executable_run_options.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/pjrt/cpu/cpu_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ limitations under the License.
#include "absl/types/span.h"
#include "unsupported/Eigen/CXX11/Tensor"
#include "mlir/IR/BuiltinOps.h"
#include "xla/client/xla_computation.h"
#include "xla/executable_run_options.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/layout.h"
#include "xla/literal.h"
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 @@ -36,9 +36,9 @@ limitations under the License.
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/notification.h"
#include "xla/client/xla_computation.h"
#include "xla/ffi/ffi.h"
#include "xla/ffi/ffi_api.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/literal.h"
#include "xla/literal_util.h"
#include "xla/pjrt/host_memory_spaces.h"
Expand Down
6 changes: 3 additions & 3 deletions xla/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ xla_cc_binary(
"//xla/client:client_library",
"//xla/client:executable_build_options",
"//xla/client:local_client",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/service",
"//xla/service:hlo_proto_cc",
Expand Down Expand Up @@ -227,7 +227,7 @@ xla_cc_binary(
"//xla/client:client_library",
"//xla/client:executable_build_options",
"//xla/client:local_client",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/service",
"//xla/service:hlo_proto_cc",
Expand Down Expand Up @@ -784,7 +784,7 @@ tsl_gpu_library(
"//xla:debug_options_flags",
"//xla:shape_util",
"//xla:util",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_module_group",
"//xla/mlir_hlo",
Expand Down
2 changes: 1 addition & 1 deletion xla/tools/dumped_computation_to_operation_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ limitations under the License.
#include "xla/client/client_library.h"
#include "xla/client/executable_build_options.h"
#include "xla/client/local_client.h"
#include "xla/client/xla_computation.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/dfs_hlo_visitor_with_default.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/tools/dumped_computation_to_text.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ limitations under the License.
#include "xla/client/client_library.h"
#include "xla/client/executable_build_options.h"
#include "xla/client/local_client.h"
#include "xla/client/xla_computation.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/service/hlo.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/tools/xla_compile_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ limitations under the License.
#include "mlir/IR/OwningOpRef.h"
#include "mlir/Parser/Parser.h"
#include "stablehlo/dialect/Register.h"
#include "xla/client/xla_computation.h"
#include "xla/debug_options_flags.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_module.h"
#include "xla/hlo/ir/hlo_module_group.h"
#include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"
Expand Down

0 comments on commit 5635baf

Please sign in to comment.