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: 680744594
  • Loading branch information
sdasgup3 authored and Google-ML-Automation committed Oct 2, 2024
1 parent 8cb57d6 commit ed38531
Show file tree
Hide file tree
Showing 27 changed files with 119 additions and 119 deletions.
112 changes: 56 additions & 56 deletions xla/service/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ xla_cc_test(
"//xla:test",
"//xla:test_helpers",
"//xla:xla_data_proto_cc",
"//xla/client:padding",
"//xla/hlo/builder:padding",
"//xla/hlo/ir:hlo",
"//xla/tests:xla_internal_test_main", # fixdeps: keep
"@com_google_absl//absl/log",
Expand Down Expand Up @@ -1410,7 +1410,7 @@ cc_library(
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla:xla_proto_cc",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/evaluator:hlo_evaluator",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_module_group",
Expand Down Expand Up @@ -1448,7 +1448,7 @@ cc_library(
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/client:executable_build_options",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/stream_executor",
"//xla/stream_executor:device_memory_allocator",
"@com_google_absl//absl/status:statusor",
Expand All @@ -1475,7 +1475,7 @@ cc_library(
"//xla:xla_data_proto_cc",
"//xla:xla_proto_cc",
"//xla/client:executable_build_options",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -2387,9 +2387,9 @@ cc_library(
"//xla:status_macros",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/client/lib:comparators",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/builder/lib:comparators",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/log",
Expand Down Expand Up @@ -2576,12 +2576,12 @@ cc_library(
":op_expander_pass",
"//xla:shape_util",
"//xla:util",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/client/lib:constants",
"//xla/client/lib:math",
"//xla/client/lib:matrix",
"//xla/client/lib:slicing",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/builder/lib:constants",
"//xla/hlo/builder/lib:math",
"//xla/hlo/builder/lib:matrix",
"//xla/hlo/builder/lib:slicing",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -2619,13 +2619,13 @@ cc_library(
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/client:xla_builder",
"//xla/client/lib:arithmetic",
"//xla/client/lib:constants",
"//xla/client/lib:loops",
"//xla/client/lib:math",
"//xla/client/lib:matrix",
"//xla/client/lib:slicing",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder/lib:arithmetic",
"//xla/hlo/builder/lib:constants",
"//xla/hlo/builder/lib:loops",
"//xla/hlo/builder/lib:math",
"//xla/hlo/builder/lib:matrix",
"//xla/hlo/builder/lib:slicing",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status:statusor",
"@tsl//tsl/platform:errors",
Expand All @@ -2642,14 +2642,14 @@ cc_library(
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/client:xla_builder",
"//xla/client/lib:arithmetic",
"//xla/client/lib:constants",
"//xla/client/lib:loops",
"//xla/client/lib:math",
"//xla/client/lib:matrix",
"//xla/client/lib:qr",
"//xla/client/lib:slicing",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder/lib:arithmetic",
"//xla/hlo/builder/lib:constants",
"//xla/hlo/builder/lib:loops",
"//xla/hlo/builder/lib:math",
"//xla/hlo/builder/lib:matrix",
"//xla/hlo/builder/lib:qr",
"//xla/hlo/builder/lib:slicing",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status:statusor",
"@tsl//tsl/platform:errors",
Expand Down Expand Up @@ -2697,14 +2697,14 @@ cc_library(
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/client:xla_builder",
"//xla/client/lib:arithmetic",
"//xla/client/lib:comparators",
"//xla/client/lib:constants",
"//xla/client/lib:loops",
"//xla/client/lib:math",
"//xla/client/lib:matrix",
"//xla/client/lib:slicing",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder/lib:arithmetic",
"//xla/hlo/builder/lib:comparators",
"//xla/hlo/builder/lib:constants",
"//xla/hlo/builder/lib:loops",
"//xla/hlo/builder/lib:math",
"//xla/hlo/builder/lib:matrix",
"//xla/hlo/builder/lib:slicing",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status:statusor",
"@tsl//tsl/platform:errors",
Expand Down Expand Up @@ -2851,7 +2851,7 @@ cc_library(
"//xla:shape_util",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/client:padding",
"//xla/hlo/builder:padding",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -3075,11 +3075,11 @@ cc_library(
"//xla:status_macros",
"//xla:types",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/client/lib:arithmetic",
"//xla/client/lib:broadcast",
"//xla/client/lib:constants",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/builder/lib:arithmetic",
"//xla/hlo/builder/lib:broadcast",
"//xla/hlo/builder/lib:constants",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -4354,7 +4354,7 @@ cc_library(
"//xla:util",
"//xla:window_util",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/tsl/lib/monitoring:gauge",
Expand Down Expand Up @@ -4396,7 +4396,7 @@ xla_test(
"//xla:test_helpers",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/ir:hlo",
"//xla/hlo/utils:hlo_matchers",
"//xla/tests:client_library_test_base",
Expand Down Expand Up @@ -4431,7 +4431,7 @@ xla_cc_test(
"//xla:test",
"//xla:test_helpers",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/ir:hlo",
"//xla/hlo/utils:hlo_matchers",
"//xla/tests:filecheck",
Expand Down Expand Up @@ -4632,9 +4632,9 @@ xla_cc_test(
"//xla/client",
"//xla/client:client_library",
"//xla/client:local_client",
"//xla/client:padding",
"//xla/client:xla_builder",
"//xla/client:xla_computation",
"//xla/hlo/builder:padding",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/tests:hlo_test_base",
"//xla/tests:xla_internal_test_main",
Expand Down Expand Up @@ -6132,7 +6132,7 @@ xla_cc_test(
"//xla:test",
"//xla:test_helpers",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/ir:hlo",
"//xla/hlo/utils:hlo_matchers",
"//xla/service/gpu:ir_emission_utils",
Expand Down Expand Up @@ -6294,7 +6294,7 @@ cc_library(
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/client:xla_computation",
"//xla/hlo/builder:xla_computation",
"//xla/hlo/ir:hlo",
"//xla/pjrt:host_memory_spaces",
"//xla/pjrt:pjrt_client",
Expand Down Expand Up @@ -7467,8 +7467,8 @@ cc_library(
":op_expander_pass",
"//xla:literal_util",
"//xla:shape_util",
"//xla/client:xla_builder",
"//xla/client/lib:prng",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder/lib:prng",
],
)

Expand All @@ -7481,8 +7481,8 @@ cc_library(
"//xla:shape_util",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/client:xla_builder",
"//xla/client/lib:prng",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder/lib:prng",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -7594,8 +7594,8 @@ cc_library(
":pattern_matcher",
"//xla:shape_util",
"//xla:util",
"//xla/client:xla_builder",
"//xla/client/lib:comparators",
"//xla/hlo/builder:xla_builder",
"//xla/hlo/builder/lib:comparators",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"@com_google_absl//absl/algorithm:container",
Expand Down
10 changes: 5 additions & 5 deletions xla/service/bitcast_dtypes_expander.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ limitations under the License.
#include "xla/service/bitcast_dtypes_expander.h"

#include "absl/strings/str_format.h"
#include "xla/client/lib/arithmetic.h"
#include "xla/client/lib/broadcast.h"
#include "xla/client/lib/constants.h"
#include "xla/client/xla_builder.h"
#include "xla/client/xla_computation.h"
#include "xla/hlo/builder/lib/arithmetic.h"
#include "xla/hlo/builder/lib/broadcast.h"
#include "xla/hlo/builder/lib/constants.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_clone_context.h"
#include "xla/hlo/ir/hlo_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
Expand Down
14 changes: 7 additions & 7 deletions xla/service/cholesky_expander.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ limitations under the License.
#include <vector>

#include "absl/status/statusor.h"
#include "xla/client/lib/arithmetic.h"
#include "xla/client/lib/constants.h"
#include "xla/client/lib/loops.h"
#include "xla/client/lib/math.h"
#include "xla/client/lib/matrix.h"
#include "xla/client/lib/slicing.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/lib/arithmetic.h"
#include "xla/hlo/builder/lib/constants.h"
#include "xla/hlo/builder/lib/loops.h"
#include "xla/hlo/builder/lib/math.h"
#include "xla/hlo/builder/lib/matrix.h"
#include "xla/hlo/builder/lib/slicing.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/literal.h"
#include "xla/primitive_util.h"
#include "xla/shape_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/cholesky_expander.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
#define XLA_SERVICE_CHOLESKY_EXPANDER_H_

#include "absl/container/flat_hash_map.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/service/op_expander_pass.h"

namespace xla {
Expand Down
2 changes: 1 addition & 1 deletion xla/service/dynamic_dimension_inference_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.

#include "xla/service/dynamic_dimension_inference.h"

#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/ir/hlo_casting_utils.h"
#include "xla/hlo/ir/hlo_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/dynamic_padder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ limitations under the License.
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "xla/client/xla_builder.h"
#include "xla/comparison_util.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/ir/dfs_hlo_visitor_with_default.h"
#include "xla/hlo/ir/dynamic_parameter_binding.h"
#include "xla/hlo/ir/hlo_casting_utils.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/dynamic_padder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ limitations under the License.
#include "absl/status/statusor.h"
#include "absl/strings/str_replace.h"
#include "absl/types/span.h"
#include "xla/client/xla_builder.h"
#include "xla/error_spec.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/ir/hlo_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
Expand Down
16 changes: 8 additions & 8 deletions xla/service/eigh_expander.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ limitations under the License.
#include <vector>

#include "absl/status/statusor.h"
#include "xla/client/lib/arithmetic.h"
#include "xla/client/lib/comparators.h"
#include "xla/client/lib/constants.h"
#include "xla/client/lib/loops.h"
#include "xla/client/lib/math.h"
#include "xla/client/lib/matrix.h"
#include "xla/client/lib/slicing.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/lib/arithmetic.h"
#include "xla/hlo/builder/lib/comparators.h"
#include "xla/hlo/builder/lib/constants.h"
#include "xla/hlo/builder/lib/loops.h"
#include "xla/hlo/builder/lib/math.h"
#include "xla/hlo/builder/lib/matrix.h"
#include "xla/hlo/builder/lib/slicing.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/literal_util.h"
#include "xla/primitive_util.h"
#include "xla/shape_util.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/eigh_expander.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
#define XLA_SERVICE_EIGH_EXPANDER_H_

#include "absl/container/flat_hash_map.h"
#include "xla/client/xla_builder.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/service/op_expander_pass.h"

namespace xla {
Expand Down
6 changes: 3 additions & 3 deletions xla/service/hlo_cost_analysis_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ limitations under the License.
#include "xla/client/client.h"
#include "xla/client/client_library.h"
#include "xla/client/local_client.h"
#include "xla/client/padding.h"
#include "xla/client/xla_builder.h"
#include "xla/client/xla_computation.h"
#include "xla/hlo/builder/padding.h"
#include "xla/hlo/builder/xla_builder.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_parser.h"
Expand Down
6 changes: 3 additions & 3 deletions xla/service/hlo_creation_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ limitations under the License.
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "xla/client/lib/comparators.h"
#include "xla/client/xla_builder.h"
#include "xla/client/xla_computation.h"
#include "xla/comparison_util.h"
#include "xla/hlo/builder/lib/comparators.h"
#include "xla/hlo/builder/xla_builder.h"
#include "xla/hlo/builder/xla_computation.h"
#include "xla/hlo/ir/hlo_clone_context.h"
#include "xla/hlo/ir/hlo_instruction.h"
#include "xla/hlo/ir/hlo_module.h"
Expand Down
2 changes: 1 addition & 1 deletion xla/service/hlo_runner_pjrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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/hlo/ir/hlo_module.h"
#include "xla/layout.h"
#include "xla/pjrt/host_memory_spaces.h"
Expand Down
Loading

0 comments on commit ed38531

Please sign in to comment.