From f30c7994729fa109db6636c448a8bc257dbc3c19 Mon Sep 17 00:00:00 2001 From: xla authors Date: Sat, 19 Oct 2024 19:19:42 -0700 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 687727091 --- xla/tools/hlo_bisect/BUILD | 31 +++++++++++++++++++ xla/tools/hlo_bisect/hlo_bisect.cc | 8 +++++ xla/tools/hlo_bisect/hlo_bisect_state.cc | 6 ++++ xla/tools/hlo_bisect/hlo_bisect_state_test.cc | 7 +++++ xla/tools/hlo_bisect/hlo_bisect_utils.cc | 21 ++++++++++++- xla/tools/hlo_bisect/hlo_bisect_utils.h | 2 ++ 6 files changed, 74 insertions(+), 1 deletion(-) diff --git a/xla/tools/hlo_bisect/BUILD b/xla/tools/hlo_bisect/BUILD index c30f952d8b4fe..2e1ec37d84dd5 100644 --- a/xla/tools/hlo_bisect/BUILD +++ b/xla/tools/hlo_bisect/BUILD @@ -26,13 +26,20 @@ xla_cc_binary( testonly = True, srcs = ["hlo_bisect.cc"], deps = [ + ":hlo_bisect_state", ":hlo_bisect_utils", "//xla:debug_options_flags", + "//xla:error_spec", + "//xla:literal", + "//xla/hlo/ir:hlo", "//xla/service:backend", "//xla/service:cpu_plugin", "//xla/service:gpu_plugin", "//xla/service:interpreter_plugin", "//xla/tsl/util:command_line_flags", + "@com_google_absl//absl/log", + "@com_google_absl//absl/log:check", + "@com_google_absl//absl/strings", "@tsl//tsl/platform:platform_port", ] + if_cuda(["//xla/stream_executor/cuda:cublas_plugin"]), ) @@ -50,9 +57,12 @@ cc_library( "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:flat_hash_map", "@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/types:span", + "@tsl//tsl/platform:errors", + "@tsl//tsl/platform:statusor", ], ) @@ -62,13 +72,18 @@ xla_cc_test( deps = [ ":hlo_bisect_state", "//xla:literal", + "//xla:shape_util", + "//xla:xla_data_proto_cc", "//xla/hlo/ir:hlo", "//xla/service:pattern_matcher", "//xla/service:pattern_matcher_gmock", "//xla/tests:hlo_test_base", "//xla/tests:xla_internal_test_main", "@com_google_absl//absl/algorithm:container", + "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status:statusor", + "@com_google_googletest//:gtest", + "@tsl//tsl/platform:statusor", ], ) @@ -79,25 +94,41 @@ cc_library( hdrs = ["hlo_bisect_utils.h"], deps = [ ":hlo_bisect_state", + "//testing/base/public:gunit_for_library_testonly", + "//xla:debug_options_flags", "//xla:error_spec", "//xla:literal", "//xla:protobuf_util", + "//xla:shape_util", "//xla:util", "//xla/hlo/ir:hlo", "//xla/hlo/parser:hlo_parser", "//xla/service:dump", + "//xla/service:hlo_module_config", "//xla/service:hlo_proto_cc", "//xla/service:hlo_proto_util", "//xla/service:hlo_runner", "//xla/service:hlo_runner_interface", "//xla/service:hlo_verifier", "//xla/service:platform_util", + "//xla/stream_executor:platform", "//xla/tests:literal_test_util", "//xla/tests:test_utils", "//xla/tools:prepare_reference_module", + "//xla/tsl/protobuf:error_codes_proto_impl_cc", "@com_google_absl//absl/cleanup", "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/log", + "@com_google_absl//absl/log:check", + "@com_google_absl//absl/status", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings:string_view", + "@com_google_absl//absl/types:span", + "@tsl//tsl/platform:env", + "@tsl//tsl/platform:errors", "@tsl//tsl/platform:path", + "@tsl//tsl/platform:status", + "@tsl//tsl/platform:statusor", "@tsl//tsl/platform:subprocess", ], ) diff --git a/xla/tools/hlo_bisect/hlo_bisect.cc b/xla/tools/hlo_bisect/hlo_bisect.cc index 588e4f5299917..ab64ba7b95962 100644 --- a/xla/tools/hlo_bisect/hlo_bisect.cc +++ b/xla/tools/hlo_bisect/hlo_bisect.cc @@ -19,6 +19,14 @@ limitations under the License. #include #include +#include "absl/log/check.h" +#include "absl/log/log.h" +#include "absl/strings/str_cat.h" +#include "xla/debug_options_flags.h" +#include "xla/error_spec.h" +#include "xla/hlo/ir/hlo_module.h" +#include "xla/literal.h" +#include "xla/tools/hlo_bisect/hlo_bisect_state.h" #include "xla/tools/hlo_bisect/hlo_bisect_utils.h" #include "xla/tsl/util/command_line_flags.h" #include "tsl/platform/init_main.h" diff --git a/xla/tools/hlo_bisect/hlo_bisect_state.cc b/xla/tools/hlo_bisect/hlo_bisect_state.cc index e44688351ce4d..7aaa2872b2e60 100644 --- a/xla/tools/hlo_bisect/hlo_bisect_state.cc +++ b/xla/tools/hlo_bisect/hlo_bisect_state.cc @@ -23,14 +23,20 @@ limitations under the License. #include "absl/algorithm/container.h" #include "absl/container/flat_hash_map.h" +#include "absl/log/log.h" +#include "absl/status/status.h" +#include "absl/status/statusor.h" #include "absl/types/span.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/literal.h" #include "xla/literal_util.h" #include "xla/service/hlo_dce.h" #include "xla/util.h" +#include "tsl/platform/errors.h" +#include "tsl/platform/statusor.h" namespace xla { namespace bisect { diff --git a/xla/tools/hlo_bisect/hlo_bisect_state_test.cc b/xla/tools/hlo_bisect/hlo_bisect_state_test.cc index b4bfc641a84a8..b8fb40d16f5fb 100644 --- a/xla/tools/hlo_bisect/hlo_bisect_state_test.cc +++ b/xla/tools/hlo_bisect/hlo_bisect_state_test.cc @@ -20,14 +20,21 @@ limitations under the License. #include #include +#include +#include #include "absl/algorithm/container.h" +#include "absl/container/flat_hash_map.h" #include "absl/status/statusor.h" +#include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/ir/hlo_module.h" #include "xla/hlo/ir/hlo_opcode.h" #include "xla/literal.h" #include "xla/service/pattern_matcher.h" #include "xla/service/pattern_matcher_gmock.h" +#include "xla/shape_util.h" #include "xla/tests/hlo_test_base.h" +#include "xla/xla_data.pb.h" +#include "tsl/platform/statusor.h" namespace xla { namespace bisect { diff --git a/xla/tools/hlo_bisect/hlo_bisect_utils.cc b/xla/tools/hlo_bisect/hlo_bisect_utils.cc index f25be607e8161..dd23819429e88 100644 --- a/xla/tools/hlo_bisect/hlo_bisect_utils.cc +++ b/xla/tools/hlo_bisect/hlo_bisect_utils.cc @@ -21,22 +21,41 @@ limitations under the License. #include #include +#include #include "absl/cleanup/cleanup.h" +#include "absl/container/flat_hash_map.h" +#include "absl/log/check.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/debug_options_flags.h" #include "xla/error_spec.h" #include "xla/hlo/ir/hlo_instruction.h" #include "xla/hlo/parser/hlo_parser.h" -#include "xla/protobuf_util.h" +#include "xla/layout_util.h" +#include "xla/literal.h" #include "xla/service/dump.h" #include "xla/service/hlo.pb.h" +#include "xla/service/hlo_module_config.h" #include "xla/service/hlo_proto_util.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/stream_executor/platform.h" #include "xla/tests/literal_test_util.h" #include "xla/tests/test_utils.h" +#include "xla/tools/hlo_bisect/hlo_bisect_state.h" #include "xla/tools/prepare_reference_module.h" +#include "xla/tsl/protobuf/error_codes.pb.h" #include "xla/util.h" +#include "tsl/platform/env.h" +#include "tsl/platform/errors.h" #include "tsl/platform/path.h" +#include "tsl/platform/status.h" +#include "tsl/platform/statusor.h" #include "tsl/platform/subprocess.h" namespace xla { diff --git a/xla/tools/hlo_bisect/hlo_bisect_utils.h b/xla/tools/hlo_bisect/hlo_bisect_utils.h index b0649a78579ae..3d4770593bf14 100644 --- a/xla/tools/hlo_bisect/hlo_bisect_utils.h +++ b/xla/tools/hlo_bisect/hlo_bisect_utils.h @@ -24,6 +24,8 @@ limitations under the License. #include #include "absl/container/flat_hash_map.h" +#include "absl/status/statusor.h" +#include "absl/strings/string_view.h" #include "xla/error_spec.h" #include "xla/hlo/ir/hlo_module.h" #include "xla/literal.h"