From e911ef4f6174888b8c3e5fd5db1b98d74a8de60a Mon Sep 17 00:00:00 2001 From: Toli Yevtushenko Date: Mon, 23 Sep 2024 13:24:32 -0700 Subject: [PATCH] Add explicit includes to fix Kokoro compile issues. PiperOrigin-RevId: 677916620 --- xla/hlo/utils/BUILD | 7 ++-- xla/hlo/utils/hlo_live_range_test.cc | 7 ++++ xla/service/BUILD | 36 ++++++++++++++++++- xla/service/buffer_assignment_test.cc | 17 ++++++--- xla/service/collective_pipeliner_test.cc | 3 ++ xla/service/defuser_test.cc | 8 +++++ xla/service/hlo_alias_analysis_test.cc | 18 +++++++--- xla/service/hlo_dfs_reachability_test.cc | 11 ++++-- xla/service/hlo_reachability_test.cc | 7 ++++ .../hlo_rematerialization_test_utils.h | 3 ++ .../hlo_rematerialization_test_utils_test.cc | 2 ++ xla/tests/BUILD | 24 +++++++++++-- xla/tests/hlo_test_base.cc | 14 ++++++++ xla/tests/hlo_test_base.h | 35 +++++++++--------- 14 files changed, 158 insertions(+), 34 deletions(-) diff --git a/xla/hlo/utils/BUILD b/xla/hlo/utils/BUILD index b269d75013be7f..10d9358e44bf5a 100644 --- a/xla/hlo/utils/BUILD +++ b/xla/hlo/utils/BUILD @@ -46,16 +46,17 @@ xla_cc_test( srcs = ["hlo_live_range_test.cc"], deps = [ ":hlo_live_range", - "//xla:literal", - "//xla:status_macros", + "//xla:comparison_util", + "//xla:literal_util", + "//xla:shape_util", "//xla/hlo/ir:hlo", "//xla/service:hlo_alias_analysis", - "//xla/service:hlo_ordering", "//xla/service:hlo_value", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", "@com_google_absl//absl/container:flat_hash_map", + "@com_google_googletest//:gtest_main", "@tsl//tsl/platform:statusor", ], ) diff --git a/xla/hlo/utils/hlo_live_range_test.cc b/xla/hlo/utils/hlo_live_range_test.cc index 64e4ab5ee37d62..eba6cb81abc4bc 100644 --- a/xla/hlo/utils/hlo_live_range_test.cc +++ b/xla/hlo/utils/hlo_live_range_test.cc @@ -14,19 +14,26 @@ limitations under the License. ==============================================================================*/ #include "xla/hlo/utils/hlo_live_range.h" +#include #include #include #include #include #include +#include #include "absl/container/flat_hash_map.h" +#include "xla/comparison_util.h" #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_module.h" +#include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_schedule.h" +#include "xla/literal_util.h" #include "xla/service/hlo_alias_analysis.h" #include "xla/service/hlo_value.h" +#include "xla/shape.h" +#include "xla/shape_util.h" #include "xla/tests/hlo_test_base.h" #include "xla/tsl/lib/core/status_test_util.h" #include "tsl/platform/statusor.h" diff --git a/xla/service/BUILD b/xla/service/BUILD index 1c88a5fb887f15..42771d39848935 100644 --- a/xla/service/BUILD +++ b/xla/service/BUILD @@ -630,8 +630,11 @@ xla_cc_test( srcs = ["collective_pipeliner_test.cc"], deps = [ ":collective_pipeliner", + ":hlo_module_config", ":hlo_parser", + ":hlo_verifier", ":host_memory_offload_annotations_hdr", + "//xla:test_helpers", "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/pass:hlo_pass_pipeline", @@ -1062,12 +1065,16 @@ xla_cc_test( name = "hlo_dfs_reachability_test", srcs = ["hlo_dfs_reachability_test.cc"], deps = [ + ":computation_placer_hdr", + ":hlo_module_config", + "//xla:literal_util", + "//xla:shape_util", "//xla:test", "//xla/hlo/ir:hlo", "//xla/hlo/ir:hlo_dfs_reachability", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", - "@com_google_absl//absl/random", + "@tsl//tsl/platform:status", "@tsl//tsl/platform:test_benchmark", ], ) @@ -1077,6 +1084,9 @@ xla_cc_test( srcs = ["hlo_reachability_test.cc"], deps = [ ":computation_placer", + ":hlo_module_config", + "//xla:literal_util", + "//xla:shape_util", "//xla:test", "//xla:test_helpers", "//xla/hlo/ir:hlo", @@ -1084,6 +1094,7 @@ xla_cc_test( "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "@com_google_absl//absl/random", + "@tsl//tsl/platform:status", "@tsl//tsl/platform:test_benchmark", ], ) @@ -2023,24 +2034,36 @@ xla_cc_test( ":cpu_plugin", ":flatten_call_graph", ":hlo_alias_analysis", + ":hlo_buffer", ":hlo_dce", ":hlo_memory_scheduler", ":hlo_ordering", ":hlo_parser", ":hlo_proto_cc", ":hlo_proto_util", + ":hlo_value", + ":logical_buffer", + "//xla:comparison_util", "//xla:literal", + "//xla:literal_util", "//xla:shape_util", "//xla:test", "//xla:test_helpers", "//xla:types", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", + "//xla/service/memory_space_assignment", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", + "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_set", + "@com_google_absl//absl/log", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:span", + "@tsl//tsl/platform:status", "@tsl//tsl/platform:statusor", ], ) @@ -3888,10 +3911,13 @@ xla_cc_test( deps = [ ":defuser", "//xla:literal", + "//xla:literal_util", "//xla:shape_util", + "//xla/hlo/ir:hlo", "//xla/hlo/utils:hlo_matchers", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", + "@com_google_googletest//:gtest_main", ], ) @@ -5030,10 +5056,13 @@ xla_cc_test( deps = [ ":flatten_call_graph", ":hlo_alias_analysis", + ":hlo_buffer", ":hlo_graph_dumper", ":hlo_ordering", + ":hlo_value", ":instruction_fusion", "//xla:literal", + "//xla:literal_util", "//xla:shape_util", "//xla:test", "//xla:test_helpers", @@ -5043,7 +5072,10 @@ xla_cc_test( "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "//xla/tsl/lib/core:status_test_util", + "@com_google_absl//absl/container:flat_hash_set", + "@com_google_absl//absl/strings:string_view", "@tsl//tsl/platform:logging", + "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:test", ], ) @@ -5487,6 +5519,7 @@ cc_library( testonly = 1, hdrs = ["hlo_rematerialization_test_utils.h"], deps = [ + "//xla:literal_util", "//xla:shape_util", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", @@ -5502,6 +5535,7 @@ xla_cc_test( ":hlo_rematerialization_test_utils", "//xla/hlo/ir:hlo", "//xla/tests:xla_internal_test_main", + "@com_google_googletest//:gtest_main", ], ) diff --git a/xla/service/buffer_assignment_test.cc b/xla/service/buffer_assignment_test.cc index 04238c4fd39f5a..353c4c6bac1c19 100644 --- a/xla/service/buffer_assignment_test.cc +++ b/xla/service/buffer_assignment_test.cc @@ -15,15 +15,21 @@ limitations under the License. #include "xla/service/buffer_assignment.h" +#include #include #include -#include #include #include #include +#include "absl/algorithm/container.h" #include "absl/container/flat_hash_set.h" +#include "absl/log/log.h" +#include "absl/status/status.h" +#include "absl/status/statusor.h" #include "absl/strings/string_view.h" +#include "absl/types/span.h" +#include "xla/comparison_util.h" #include "xla/hlo/ir/dfs_hlo_visitor_with_default.h" #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" @@ -31,24 +37,27 @@ limitations under the License. #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/ir/hlo_schedule.h" #include "xla/literal.h" +#include "xla/literal_util.h" #include "xla/service/buffer_value.h" #include "xla/service/call_graph.h" #include "xla/service/copy_insertion.h" #include "xla/service/flatten_call_graph.h" #include "xla/service/hlo.pb.h" #include "xla/service/hlo_alias_analysis.h" -#include "xla/service/hlo_dce.h" +#include "xla/service/hlo_buffer.h" #include "xla/service/hlo_memory_scheduler.h" #include "xla/service/hlo_ordering.h" #include "xla/service/hlo_parser.h" -#include "xla/service/hlo_proto_util.h" +#include "xla/service/hlo_value.h" +#include "xla/service/logical_buffer.h" +#include "xla/service/memory_space_assignment/memory_space_assignment.h" #include "xla/shape_util.h" #include "xla/test.h" #include "xla/test_helpers.h" #include "xla/tests/hlo_test_base.h" #include "xla/tsl/lib/core/status_test_util.h" -#include "xla/types.h" #include "xla/xla_data.pb.h" +#include "tsl/platform/status.h" #include "tsl/platform/statusor.h" namespace xla { diff --git a/xla/service/collective_pipeliner_test.cc b/xla/service/collective_pipeliner_test.cc index 6c48208f65d8fd..9b3f9c9a54233a 100644 --- a/xla/service/collective_pipeliner_test.cc +++ b/xla/service/collective_pipeliner_test.cc @@ -38,8 +38,11 @@ limitations under the License. #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/pass/hlo_pass_pipeline.h" #include "xla/hlo/utils/hlo_matchers.h" +#include "xla/service/hlo_module_config.h" #include "xla/service/hlo_parser.h" +#include "xla/service/hlo_verifier.h" #include "xla/service/host_memory_offload_annotations.h" +#include "xla/test_helpers.h" #include "xla/tests/filecheck.h" #include "xla/tests/hlo_test_base.h" #include "xla/util.h" diff --git a/xla/service/defuser_test.cc b/xla/service/defuser_test.cc index ad70f7998c66a4..d2feaaf172f237 100644 --- a/xla/service/defuser_test.cc +++ b/xla/service/defuser_test.cc @@ -15,8 +15,16 @@ limitations under the License. #include "xla/service/defuser.h" +#include +#include +#include "xla/hlo/ir/hlo_computation.h" +#include "xla/hlo/ir/hlo_instruction.h" +#include "xla/hlo/ir/hlo_module.h" +#include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/utils/hlo_matchers.h" #include "xla/literal.h" +#include "xla/literal_util.h" +#include "xla/shape.h" #include "xla/shape_util.h" #include "xla/tests/hlo_test_base.h" diff --git a/xla/service/hlo_alias_analysis_test.cc b/xla/service/hlo_alias_analysis_test.cc index ea687b640a58ef..fe126db410bda3 100644 --- a/xla/service/hlo_alias_analysis_test.cc +++ b/xla/service/hlo_alias_analysis_test.cc @@ -15,15 +15,22 @@ limitations under the License. #include "xla/service/hlo_alias_analysis.h" -#include #include - +#include +#include + +#include "absl/container/flat_hash_set.h" +#include "absl/strings/string_view.h" +#include "xla/hlo/ir/hlo_computation.h" +#include "xla/hlo/ir/hlo_instruction.h" +#include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" -#include "xla/hlo/utils/hlo_matchers.h" -#include "xla/literal.h" +#include "xla/literal_util.h" #include "xla/service/flatten_call_graph.h" +#include "xla/service/hlo_buffer.h" #include "xla/service/hlo_ordering.h" -#include "xla/service/instruction_fusion.h" +#include "xla/service/hlo_value.h" +#include "xla/shape.h" #include "xla/shape_util.h" #include "xla/test.h" #include "xla/test_helpers.h" @@ -31,6 +38,7 @@ limitations under the License. #include "xla/tsl/lib/core/status_test_util.h" #include "xla/xla_data.pb.h" #include "tsl/platform/logging.h" +#include "tsl/platform/statusor.h" #include "tsl/platform/test.h" namespace xla { diff --git a/xla/service/hlo_dfs_reachability_test.cc b/xla/service/hlo_dfs_reachability_test.cc index 9bc77c75f42ea1..0b596b080e5a8e 100644 --- a/xla/service/hlo_dfs_reachability_test.cc +++ b/xla/service/hlo_dfs_reachability_test.cc @@ -16,14 +16,21 @@ limitations under the License. #include "xla/hlo/ir/hlo_dfs_reachability.h" #include -#include +#include +#include #include -#include "absl/random/random.h" #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" +#include "xla/hlo/ir/hlo_opcode.h" +#include "xla/literal_util.h" +#include "xla/service/computation_placer.h" +#include "xla/service/hlo_module_config.h" +#include "xla/shape.h" +#include "xla/shape_util.h" #include "xla/test.h" #include "xla/tests/hlo_test_base.h" +#include "tsl/platform/status.h" #include "tsl/platform/test_benchmark.h" namespace xla { diff --git a/xla/service/hlo_reachability_test.cc b/xla/service/hlo_reachability_test.cc index bc0d2b7293b47d..42d9ec789a5645 100644 --- a/xla/service/hlo_reachability_test.cc +++ b/xla/service/hlo_reachability_test.cc @@ -17,14 +17,21 @@ limitations under the License. #include #include +#include #include #include "absl/random/random.h" #include "xla/hlo/ir/hlo_instruction.h" +#include "xla/hlo/ir/hlo_opcode.h" +#include "xla/literal_util.h" #include "xla/service/computation_placer.h" +#include "xla/service/hlo_module_config.h" +#include "xla/shape.h" +#include "xla/shape_util.h" #include "xla/test.h" #include "xla/test_helpers.h" #include "xla/tests/hlo_test_base.h" +#include "tsl/platform/status.h" #include "tsl/platform/test_benchmark.h" namespace xla { diff --git a/xla/service/hlo_rematerialization_test_utils.h b/xla/service/hlo_rematerialization_test_utils.h index 069494536f2637..37bece3354b888 100644 --- a/xla/service/hlo_rematerialization_test_utils.h +++ b/xla/service/hlo_rematerialization_test_utils.h @@ -18,12 +18,15 @@ limitations under the License. #ifndef XLA_SERVICE_HLO_REMATERIALIZATION_TEST_UTILS_H_ #define XLA_SERVICE_HLO_REMATERIALIZATION_TEST_UTILS_H_ +#include #include #include #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_opcode.h" +#include "xla/literal_util.h" +#include "xla/shape.h" #include "xla/shape_util.h" #include "xla/tests/hlo_test_base.h" #include "xla/xla_data.pb.h" diff --git a/xla/service/hlo_rematerialization_test_utils_test.cc b/xla/service/hlo_rematerialization_test_utils_test.cc index 803a0704fde839..7ab66fa50892ba 100644 --- a/xla/service/hlo_rematerialization_test_utils_test.cc +++ b/xla/service/hlo_rematerialization_test_utils_test.cc @@ -17,6 +17,8 @@ limitations under the License. #include #include +#include +#include #include "xla/hlo/ir/hlo_computation.h" #include "xla/hlo/ir/hlo_instruction.h" diff --git a/xla/tests/BUILD b/xla/tests/BUILD index 1561843df8a7c4..be20715cbe4aed 100644 --- a/xla/tests/BUILD +++ b/xla/tests/BUILD @@ -183,7 +183,7 @@ cc_library( "//xla:literal", "//xla:shape_layout", "//xla:shape_util", - "//xla:types", + "//xla:util", "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/hlo/ir:hlo_module_group", @@ -191,9 +191,10 @@ cc_library( "//xla/hlo/utils:hlo_query", "//xla/service:backend", "//xla/service:computation_layout", + "//xla/service:computation_placer_hdr", + "//xla/service:executable", "//xla/service:hlo_module_config", "//xla/service:hlo_module_util", - "//xla/service:hlo_parser", "//xla/service:hlo_runner", "//xla/service:hlo_runner_interface", "//xla/service:hlo_runner_pjrt", @@ -214,6 +215,7 @@ cc_library( "@com_google_absl//absl/types:span", "@tsl//tsl/platform:errors", "@tsl//tsl/platform:logging", + "@tsl//tsl/platform:status", "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:test", ], @@ -936,17 +938,35 @@ xla_test( ":xla_internal_test_main", "//xla:array2d", "//xla:array3d", + "//xla:array4d", "//xla:error_spec", + "//xla:executable_run_options", + "//xla:literal", + "//xla:literal_util", "//xla:reference_util", "//xla:shape_util", + "//xla:test_helpers", + "//xla:types", + "//xla/client:client_library", + "//xla/client:executable_build_options", "//xla/client:local_client", "//xla/client:xla_builder", "//xla/client/lib:arithmetic", "//xla/client/lib:matrix", + "//xla/service", "//xla/service:hlo_parser", + "//xla/service:platform_util", + "//xla/service:shaped_buffer", + "//xla/stream_executor:device_description", + "//xla/stream_executor:platform", "//xla/stream_executor:stream_executor_memory_allocator", + "@com_google_absl//absl/log", "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:span", + "@com_google_googletest//:gtest_main", + "@eigen_archive//:eigen3", "@tsl//tsl/platform:ml_dtypes", + "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:test", "@tsl//tsl/platform:test_benchmark", ] + if_rocm_is_configured([ diff --git a/xla/tests/hlo_test_base.cc b/xla/tests/hlo_test_base.cc index 28985fd2ba33b7..ee8d4653b97089 100644 --- a/xla/tests/hlo_test_base.cc +++ b/xla/tests/hlo_test_base.cc @@ -15,6 +15,7 @@ limitations under the License. #include "xla/tests/hlo_test_base.h" +#include #include #include #include @@ -28,20 +29,31 @@ limitations under the License. #include "absl/log/check.h" #include "absl/status/status.h" #include "absl/status/statusor.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "xla/debug_options_flags.h" +#include "xla/error_spec.h" #include "xla/hlo/ir/hlo_instruction.h" +#include "xla/hlo/ir/hlo_module_group.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/pass/hlo_pass_interface.h" #include "xla/hlo/utils/hlo_query.h" +#include "xla/literal.h" +#include "xla/service/backend.h" +#include "xla/service/computation_placer.h" +#include "xla/service/executable.h" +#include "xla/service/hlo_module_config.h" #include "xla/service/hlo_module_util.h" +#include "xla/service/hlo_runner.h" #include "xla/service/hlo_runner_interface.h" #include "xla/service/hlo_runner_pjrt.h" +#include "xla/service/hlo_verifier.h" #include "xla/service/platform_util.h" #include "xla/shape.h" #include "xla/stream_executor/device_memory_allocator.h" +#include "xla/stream_executor/platform.h" #include "xla/stream_executor/stream_executor_memory_allocator.h" #include "xla/tests/filecheck.h" #include "xla/tests/literal_test_util.h" @@ -49,8 +61,10 @@ limitations under the License. #include "xla/tests/test_utils.h" #include "xla/tests/verified_hlo_module.h" #include "xla/tsl/lib/core/status_test_util.h" +#include "xla/util.h" #include "tsl/platform/errors.h" #include "tsl/platform/logging.h" +#include "tsl/platform/status.h" #include "tsl/platform/statusor.h" #include "tsl/platform/test.h" diff --git a/xla/tests/hlo_test_base.h b/xla/tests/hlo_test_base.h index c312fc35090d7c..bd0a628bac45f7 100644 --- a/xla/tests/hlo_test_base.h +++ b/xla/tests/hlo_test_base.h @@ -37,19 +37,23 @@ limitations under the License. #include "xla/hlo/ir/hlo_module_group.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/hlo/pass/hlo_pass_interface.h" +#include "xla/layout.h" #include "xla/literal.h" #include "xla/service/backend.h" #include "xla/service/computation_layout.h" +#include "xla/service/computation_placer.h" +#include "xla/service/executable.h" #include "xla/service/hlo_module_config.h" #include "xla/service/hlo_runner.h" +#include "xla/service/hlo_runner_interface.h" #include "xla/service/hlo_verifier.h" #include "xla/service/platform_util.h" #include "xla/shape_layout.h" +#include "xla/shape_util.h" #include "xla/stream_executor/device_memory_allocator.h" -#include "xla/stream_executor/stream_executor.h" #include "xla/tests/literal_test_util.h" #include "xla/tests/verified_hlo_module.h" -#include "xla/types.h" +#include "xla/util.h" #include "xla/xla_data.pb.h" #include "tsl/platform/test.h" @@ -147,7 +151,7 @@ class HloTestBase : public ::testing::Test { void MatchOptimizedHlo(absl::string_view hlo, absl::string_view pattern, bool print_operand_shape = false); - // LikeMatchOptimizedHlo, but checks operand shapes as well. + // Like MatchOptimizedHlo, but checks operand shapes as well. void MatchOptimizedHloWithShapes(absl::string_view hlo, absl::string_view pattern) { MatchOptimizedHlo(hlo, pattern, /*print_operand_shape=*/true); @@ -177,7 +181,7 @@ class HloTestBase : public ::testing::Test { bool allow_mixed_precision_in_hlo_verifier = true, HloPredicate instruction_can_change_layout_func = {}); - ~HloTestBase() override {} + ~HloTestBase() override = default; // Runs pass `hlo_pass` on input HLO module `hlo` with optional config, and // FileChecks the result against `expected`. @@ -287,16 +291,14 @@ class HloTestBase : public ::testing::Test { // reference backend. Note that the program shape of the module must not be // modified. [[nodiscard]] ::testing::AssertionResult RunAndCompare( - std::unique_ptr module, - const absl::Span arguments, + std::unique_ptr module, absl::Span arguments, const std::optional& error, const std::function& reference_preprocessor = nullptr); // Same as above, except that the module will be executed without Hlo // optimization. [[nodiscard]] ::testing::AssertionResult RunAndCompareNoHloPasses( - std::unique_ptr module, - const absl::Span arguments, + std::unique_ptr module, absl::Span arguments, const std::optional& error, const std::function& reference_preprocessor = nullptr, const std::function& test_preprocessor = nullptr); @@ -323,11 +325,11 @@ class HloTestBase : public ::testing::Test { // input. Module can be passed in directly, or parsed from an hlo_string, // or loaded from a file. [[nodiscard]] ::testing::AssertionResult RunAndCompare( - const absl::string_view hlo_string, const std::optional& error, + absl::string_view hlo_string, const std::optional& error, const std::function& reference_preprocessor = nullptr, std::optional args_max_bits_of_precision = std::nullopt); [[nodiscard]] ::testing::AssertionResult Run( - const absl::string_view hlo_string, bool run_hlo_passes = true, + absl::string_view hlo_string, bool run_hlo_passes = true, ExecutionProfile* profile = nullptr, const tsl::protobuf::Message* backend_config = nullptr, bool use_random_data = true); @@ -355,7 +357,7 @@ class HloTestBase : public ::testing::Test { // Same as below, except requires passing fake arguments. ::testing::AssertionResult RunAndCompareTwoModules( std::unique_ptr module_0, std::unique_ptr module_1, - const absl::Span arguments, + absl::Span arguments, const std::optional& error, bool run_hlo_passes = true); // Same as below, except requires passing the modules. @@ -390,14 +392,14 @@ class HloTestBase : public ::testing::Test { // Executes an hlo module with fake inputs on multiple replicas. [[nodiscard]] ::testing::AssertionResult RunReplicated( - const absl::string_view hlo_string, bool run_hlo_passes = true, + absl::string_view hlo_string, bool run_hlo_passes = true, int64_t num_replicas = 1, const tsl::protobuf::Message* backend_config = nullptr); // If assert_determinism is true, the assertion will fail unless all runs // produce exactly the same output. [[nodiscard]] ::testing::AssertionResult RunMultipleTimes( - const absl::string_view hlo_string, bool run_hlo_passes, + absl::string_view hlo_string, bool run_hlo_passes, std::vector* profiles, const tsl::protobuf::Message* backend_config = nullptr, bool assert_determinism = false); @@ -405,7 +407,7 @@ class HloTestBase : public ::testing::Test { const std::string& filename, const std::optional& error, const std::function& reference_preprocessor = nullptr); [[nodiscard]] ::testing::AssertionResult RunAndCompareNoHloPasses( - const absl::string_view hlo_string, const std::optional& error, + absl::string_view hlo_string, const std::optional& error, const std::function& reference_preprocessor = nullptr, const std::function& test_preprocessor = nullptr); [[nodiscard]] ::testing::AssertionResult RunAndCompareNoHloPassesFromFile( @@ -525,8 +527,7 @@ class HloTestBase : public ::testing::Test { // compares the results. Returns whether the results are near or equal. If any // error happens before the results are computed, returns the error status. absl::StatusOr<::testing::AssertionResult> RunAndCompareInternal( - std::unique_ptr module, - const absl::Span arguments, + std::unique_ptr module, absl::Span arguments, const std::optional& error, bool run_hlo_passes, const std::function& reference_preprocessor, const std::function& test_preprocessor = nullptr); @@ -545,7 +546,7 @@ class HloTestBase : public ::testing::Test { // error happens before the results are computed, returns the error status. absl::StatusOr<::testing::AssertionResult> RunAndCompareTwoModulesInternal( std::unique_ptr module_0, std::unique_ptr module_1, - const absl::Span arguments, + absl::Span arguments, const std::optional& error, bool run_hlo_passes); // Returns either an HloRunner or HloRunnerPjRt implementation depending if