Skip to content

Commit

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

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

PiperOrigin-RevId: 688037579
  • Loading branch information
sdasgup3 authored and Google-ML-Automation committed Oct 21, 2024
1 parent 7f2f6b7 commit 17f26ff
Show file tree
Hide file tree
Showing 36 changed files with 89 additions and 89 deletions.
76 changes: 38 additions & 38 deletions xla/service/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ cc_library(
":call_graph",
":collective_ops_utils",
":constant_value",
":tuple_points_to_analysis",
":value_range",
"//xla:comparison_util",
"//xla:literal",
"//xla:literal_util",
"//xla:shape_util",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:tuple_points_to_analysis",
"//xla/hlo/evaluator:hlo_evaluator",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_instruction_utils",
Expand Down Expand Up @@ -1127,16 +1127,16 @@ cc_library(
hdrs = ["latency_hiding_scheduler.h"],
deps = [
":dump",
":hlo_alias_analysis",
":hlo_buffer",
":hlo_cost_analysis",
":hlo_value",
"//xla:debug_options_flags",
"//xla:shape_util",
"//xla:util",
"//xla:xla_proto_cc",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"//xla/hlo/pass:hlo_pass",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -1185,8 +1185,8 @@ cc_library(
deps = [
":collective_ops_utils",
"//xla:util",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/utils:hlo_query",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -1636,16 +1636,16 @@ cc_library(
":buffer_assignment_proto_cc",
":buffer_value",
":call_graph",
":hlo_alias_analysis",
":hlo_buffer",
":hlo_dataflow_analysis",
":hlo_ordering",
":hlo_proto_cc",
":hlo_value",
":logical_buffer",
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/analysis:hlo_ordering",
"//xla/hlo/ir:hlo",
"//xla/hlo/utils:hlo_live_range",
"//xla/service/heap_simulator",
Expand Down Expand Up @@ -1678,9 +1678,7 @@ xla_cc_test(
":call_graph",
":copy_insertion",
":cpu_plugin",
":hlo_alias_analysis",
":hlo_buffer",
":hlo_ordering",
":hlo_proto_cc",
":hlo_proto_util",
":hlo_value",
Expand All @@ -1693,6 +1691,8 @@ xla_cc_test(
"//xla:test_helpers",
"//xla:types",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:hlo_ordering",
"//xla/hlo/ir:hlo",
"//xla/hlo/parser:hlo_parser",
"//xla/hlo/transforms:flatten_call_graph",
Expand Down Expand Up @@ -1744,11 +1744,11 @@ cc_library(
srcs = ["hlo_module_group_metadata.cc"],
hdrs = ["hlo_module_group_metadata.h"],
deps = [
":hlo_alias_analysis",
":tuple_points_to_analysis",
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:tuple_points_to_analysis",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
Expand Down Expand Up @@ -1783,8 +1783,8 @@ cc_library(
"//xla:status_macros",
"//xla:types",
"//xla:util",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/functional:function_ref",
Expand All @@ -1802,11 +1802,11 @@ xla_cc_test(
name = "hlo_schedule_test",
srcs = ["hlo_schedule_test.cc"],
deps = [
":hlo_ordering",
"//xla:shape_util",
"//xla:test_helpers",
"//xla:types",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_ordering",
"//xla/hlo/ir:hlo",
"//xla/hlo/transforms:hlo_dce",
"//xla/hlo/transforms:hlo_memory_scheduler",
Expand All @@ -1824,10 +1824,10 @@ xla_cc_test(
name = "hlo_input_output_alias_config_test",
srcs = ["hlo_input_output_alias_config_test.cc"],
deps = [
":hlo_ordering",
"//xla:shape_util",
"//xla:test_helpers",
"//xla:types",
"//xla/hlo/analysis:hlo_ordering",
"//xla/hlo/ir:hlo",
"//xla/tests:hlo_test_base",
"//xla/tests:xla_internal_test_main",
Expand Down Expand Up @@ -1861,15 +1861,15 @@ cc_library(
hdrs = ["instruction_fusion.h"],
deps = [
":fusion_queue",
":hlo_dataflow_analysis",
":hlo_graph_dumper",
":hlo_module_config",
":pattern_matcher",
"//xla:debug_options_flags",
"//xla:shape_util",
"//xla:util",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"//xla/hlo/pass:hlo_pass",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -1908,12 +1908,12 @@ cc_library(
srcs = ["multi_output_fusion.cc"],
hdrs = ["multi_output_fusion.h"],
deps = [
":hlo_dataflow_analysis",
"//xla:debug_options_flags",
"//xla:shape_util",
"//xla:util",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:hlo_dce",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -2320,8 +2320,8 @@ cc_library(
"//xla:shape_util",
"//xla:status_macros",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/functional:function_ref",
Expand Down Expand Up @@ -2430,10 +2430,10 @@ cc_library(
deps = [
":collective_ops_utils",
":hlo_module_config",
":hlo_replication_analysis",
"//xla:literal_util",
"//xla:shape_util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_replication_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -2707,14 +2707,14 @@ cc_library(
hdrs = ["scan_loop_accumulator_input_unification.h"],
deps = [
":call_graph",
":hlo_alias_analysis",
":hlo_dataflow_analysis",
":pattern_matcher",
":while_loop_simplifier",
":while_loop_unroller",
"//xla:literal_util",
"//xla:shape_util",
"//xla:util",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:tuple_simplifier",
Expand Down Expand Up @@ -2795,13 +2795,11 @@ cc_library(
deps = [
":call_inliner",
":collective_ops_utils",
":hlo_alias_analysis",
":hlo_buffer",
":hlo_creation_utils",
":hlo_cse",
":hlo_value",
":pattern_matcher",
":while_loop_analysis",
":while_loop_constant_sinking",
"//xla:comparison_util",
"//xla:literal",
Expand All @@ -2810,6 +2808,8 @@ cc_library(
"//xla:status_macros",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:while_loop_analysis",
"//xla/hlo/evaluator:hlo_evaluator",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
Expand Down Expand Up @@ -2865,14 +2865,14 @@ cc_library(
":call_inliner",
":hlo_creation_utils",
":pattern_matcher",
":while_loop_analysis",
"//xla:comparison_util",
"//xla:literal_util",
"//xla:shape_util",
"//xla:status_macros",
"//xla:union_find",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:while_loop_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:hlo_dce",
Expand Down Expand Up @@ -3059,7 +3059,6 @@ cc_library(
":call_inliner",
":dynamic_window_utils",
":hlo_creation_utils",
":hlo_dataflow_analysis",
":hlo_value",
":tuple_util",
":while_util",
Expand All @@ -3072,6 +3071,7 @@ cc_library(
"//xla:util",
"//xla:window_util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/ir:hlo",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -3678,14 +3678,14 @@ cc_library(
":computation_layout",
":hlo_graph_dumper",
":logical_buffer",
":tuple_points_to_analysis",
"//xla:permutation_util",
"//xla:shape_layout",
"//xla:shape_util",
"//xla:status_macros",
"//xla:types",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:tuple_points_to_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:hlo_dce",
Expand Down Expand Up @@ -3719,19 +3719,19 @@ cc_library(
deps = [
":call_graph",
":dump",
":hlo_alias_analysis",
":hlo_buffer",
":hlo_dataflow_analysis",
":hlo_graph_dumper",
":hlo_ordering",
":hlo_value",
"//xla:frontend_attributes",
"//xla:shape_tree",
"//xla:shape_util",
"//xla:status_macros",
"//xla:util",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/analysis:hlo_ordering",
"//xla/hlo/analysis:hlo_reachability",
"//xla/hlo/ir:hlo",
"//xla/hlo/ir:hlo_reachability",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:hlo_dce",
"//xla/hlo/transforms:tuple_simplifier",
Expand All @@ -3758,12 +3758,12 @@ cc_library(
srcs = ["loop_schedule_linearizer.cc"],
hdrs = ["loop_schedule_linearizer.h"],
deps = [
":hlo_alias_analysis",
":hlo_dataflow_analysis",
":hlo_graph_dumper",
":hlo_value",
"//xla:shape_tree",
"//xla:shape_util",
"//xla/hlo/analysis:hlo_alias_analysis",
"//xla/hlo/analysis:hlo_dataflow_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/utils:hlo_query",
Expand Down Expand Up @@ -3845,11 +3845,11 @@ cc_library(
srcs = ["hlo_module_dce.cc"],
hdrs = ["hlo_module_dce.h"],
deps = [
":hlo_liveness_analysis",
":while_loop_simplifier",
"//xla:status_macros",
"//xla:types",
"//xla:util",
"//xla/hlo/analysis:hlo_liveness_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:hlo_dce",
Expand Down Expand Up @@ -4804,10 +4804,10 @@ cc_library(
deps = [
":call_graph",
":collective_ops_utils",
":hlo_replication_analysis",
"//xla:literal_util",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/hlo/analysis:hlo_replication_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/utils:hlo_query",
Expand Down Expand Up @@ -4887,10 +4887,10 @@ cc_library(
"while_loop_invariant_code_motion.h",
],
deps = [
":while_loop_analysis",
":while_util",
"//xla:shape_util",
"//xla:util",
"//xla/hlo/analysis:while_loop_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"//xla/hlo/transforms:hlo_dce",
Expand Down Expand Up @@ -4932,10 +4932,10 @@ cc_library(
srcs = ["while_loop_expensive_invariant_code_motion.cc"],
hdrs = ["while_loop_expensive_invariant_code_motion.h"],
deps = [
":while_loop_analysis",
":while_util",
"//xla:shape_util",
"//xla:util",
"//xla/hlo/analysis:while_loop_analysis",
"//xla/hlo/ir:hlo",
"//xla/hlo/pass:hlo_pass",
"@com_google_absl//absl/algorithm:container",
Expand Down Expand Up @@ -6224,9 +6224,9 @@ xla_cc_test(
srcs = ["while_loop_pipeline_unroller_test.cc"],
deps = [
":copy_insertion",
":hlo_ordering",
":while_loop_pipeline_unroller",
"//xla:test_helpers",
"//xla/hlo/analysis:hlo_ordering",
"//xla/hlo/ir:hlo",
"//xla/tests:hlo_test_base",
"@com_google_absl//absl/container:inlined_vector",
Expand Down
2 changes: 1 addition & 1 deletion xla/service/all_reduce_simplifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ limitations under the License.
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "xla/hlo/analysis/hlo_replication_analysis.h"
#include "xla/hlo/ir/hlo_casting_utils.h"
#include "xla/hlo/ir/hlo_computation.h"
#include "xla/hlo/ir/hlo_instruction.h"
Expand All @@ -32,7 +33,6 @@ limitations under the License.
#include "xla/literal_util.h"
#include "xla/service/collective_ops_utils.h"
#include "xla/service/hlo_module_config.h"
#include "xla/service/hlo_replication_analysis.h"
#include "xla/shape_util.h"
#include "xla/xla_data.pb.h"
#include "tsl/platform/errors.h"
Expand Down
Loading

0 comments on commit 17f26ff

Please sign in to comment.