[go: nahoru, domu]

Skip to content

Commit

Permalink
Stop using xla/statusor.h now that it just contains an alias for absl…
Browse files Browse the repository at this point in the history
…::Status.

In some situations, this meant also changing unrelated files to directly include tsl/platform/statusor.h to get the definitions for TF_ASSIGN_OR_RETURN, etc., where they were getting transitively included for free.

PiperOrigin-RevId: 644660925
  • Loading branch information
klucke authored and tensorflower-gardener committed Jun 19, 2024
1 parent 8f3c0c0 commit 28d7d5a
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 42 deletions.
4 changes: 2 additions & 2 deletions tensorflow/compiler/aot/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ cc_library(
"//tensorflow/core/platform:status",
"@com_google_absl//absl/base",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@llvm-project//llvm:Support",
"@llvm-project//llvm:Target",
"@local_xla//xla:cpu_function_runtime",
"@local_xla//xla:shape_util",
"@local_xla//xla:statusor",
"@local_xla//xla:util",
"@local_xla//xla:xla_data_proto_cc",
"@local_xla//xla/client:client_library",
Expand Down Expand Up @@ -323,13 +323,13 @@ cc_library(
deps = [
"//tensorflow/core:lib",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@llvm-project//llvm:Core",
"@llvm-project//llvm:MC",
"@llvm-project//llvm:Target",
"@llvm-project//llvm:TargetParser",
"@local_xla//xla:statusor",
"@local_xla//xla:util",
"@local_xla//xla/service/llvm_ir:llvm_type_conversion_util",
],
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/compiler/aot/compile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ limitations under the License.
#include <vector>

#include "absl/base/call_once.h"
#include "absl/status/statusor.h"
#include "llvm-c/Target.h"
#include "llvm/Support/ManagedStatic.h"
#include "tensorflow/compiler/aot/codegen.h"
Expand All @@ -32,7 +33,6 @@ limitations under the License.
#include "xla/client/compile_only_client.h"
#include "xla/client/xla_computation.h"
#include "xla/service/cpu/cpu_compiler.h"
#include "xla/statusor.h"
#include "xla/stream_executor/platform_manager.h"
#include "xla/util.h"
#include "xla/xla_data.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/compiler/aot/embedded_protocol_buffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ limitations under the License.
#ifndef TENSORFLOW_COMPILER_AOT_EMBEDDED_PROTOCOL_BUFFERS_H_
#define TENSORFLOW_COMPILER_AOT_EMBEDDED_PROTOCOL_BUFFERS_H_

#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "xla/statusor.h"
#include "tensorflow/core/platform/protobuf.h"

namespace tensorflow {
Expand Down
1 change: 0 additions & 1 deletion tensorflow/compiler/jit/kernels/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ XLA_OPS_DEPS = [
"//tensorflow/compiler/tf2xla:xla_op_registry",
"@local_xla//xla:executable_run_options",
"@local_xla//xla:status_macros",
"@local_xla//xla:statusor",
"@local_xla//xla/client:client_library",
"@local_xla//xla/client:local_client",
"@local_xla//xla/service:compiler",
Expand Down
15 changes: 7 additions & 8 deletions tensorflow/compiler/tf2xla/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ cc_library(
"//tensorflow/core:graph",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
"@local_xla//xla:status_macros",
"@local_xla//xla:statusor",
"@local_xla//xla:xla_data_proto_cc",
],
)
Expand Down Expand Up @@ -419,10 +419,10 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/platform:errors",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
"@local_xla//xla:cpu_function_runtime",
"@local_xla//xla:shape_util",
"@local_xla//xla:statusor",
"@local_xla//xla:xla_data_proto_cc",
"@local_xla//xla/client:client_library",
"@local_xla//xla/client:local_client",
Expand Down Expand Up @@ -592,11 +592,11 @@ cc_library(
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core/common_runtime:core_cpu_internal",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
"@local_xla//xla:literal",
"@local_xla//xla:shape_util",
"@local_xla//xla:status_macros",
"@local_xla//xla:statusor",
"@local_xla//xla:xla_data_proto_cc",
"@local_xla//xla/client:client_library",
"@local_xla//xla/client:xla_builder",
Expand Down Expand Up @@ -646,8 +646,8 @@ cc_library(
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:optional",
"@local_xla//xla:statusor",
"@local_xla//xla/client",
"@local_xla//xla/client:value_inference",
"@local_xla//xla/client:xla_builder",
Expand Down Expand Up @@ -753,7 +753,6 @@ cc_library(
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@local_xla//xla:shape_util",
"@local_xla//xla:statusor",
"@local_xla//xla:xla_data_proto_cc",
"@local_xla//xla/client:xla_builder",
"@local_xla//xla/hlo/ir:hlo",
Expand Down Expand Up @@ -813,8 +812,8 @@ cc_library(
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:optional",
"@local_xla//xla:statusor",
"@local_xla//xla:xla_data_proto_cc",
],
)
Expand Down Expand Up @@ -919,10 +918,10 @@ tf_cc_test(
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"@com_google_absl//absl/status:statusor",
"@local_tsl//tsl/platform:tensor_float_32_hdr_lib",
"@local_xla//xla:literal",
"@local_xla//xla:literal_util",
"@local_xla//xla:statusor",
"@local_xla//xla/client:client_library",
"@local_xla//xla/client:local_client",
"@local_xla//xla/client:xla_computation",
Expand All @@ -942,10 +941,10 @@ tf_cc_test(
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@local_xla//xla:shape_util",
"@local_xla//xla:status_macros",
"@local_xla//xla:statusor",
"@local_xla//xla:test",
"@local_xla//xla:xla_data_proto_cc",
"@local_xla//xla/client:local_client",
Expand Down
6 changes: 3 additions & 3 deletions tensorflow/compiler/tf2xla/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ cc_library(
deps = [
":util",
"//tensorflow/core:lib",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
"@local_xla//xla:literal",
"@local_xla//xla:shape_util",
"@local_xla//xla:status_macros",
"@local_xla//xla:statusor",
"@local_xla//xla:util",
"@local_xla//xla/client:xla_builder",
"@local_xla//xla/client:xla_computation",
Expand All @@ -78,12 +78,12 @@ cc_library(
hdrs = ["util.h"],
deps = [
"//tensorflow/core:lib",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
"@local_xla//xla:literal",
"@local_xla//xla:literal_util",
"@local_xla//xla:shape_util",
"@local_xla//xla:status_macros",
"@local_xla//xla:statusor",
"@local_xla//xla:util",
"@local_xla//xla/client:xla_builder",
"@local_xla//xla/client:xla_computation",
Expand All @@ -97,7 +97,7 @@ cc_library(
deps = [
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"@local_xla//xla:statusor",
"@com_google_absl//absl/status:statusor",
"@local_xla//xla:util",
"@local_xla//xla/client:xla_builder",
],
Expand Down
1 change: 0 additions & 1 deletion third_party/xla/xla/pjrt/c/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ xla_cc_test(
":pjrt_c_api_helpers",
":pjrt_c_api_wrapper_impl",
"//xla:shape_util",
"//xla:statusor",
"//xla/pjrt:pjrt_client",
"//xla/pjrt:pjrt_common",
"//xla/pjrt/distributed:in_memory_key_value_store",
Expand Down
1 change: 0 additions & 1 deletion third_party/xla/xla/pjrt/c/pjrt_c_api_helpers_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ limitations under the License.
#include "xla/pjrt/distributed/in_memory_key_value_store.h"
#include "xla/pjrt/pjrt_client.h"
#include "xla/pjrt/pjrt_common.h"
#include "xla/statusor.h"
#include "tsl/lib/core/status_test_util.h"
#include "tsl/platform/status.h"
#include "tsl/platform/status_matchers.h"
Expand Down
4 changes: 1 addition & 3 deletions third_party/xla/xla/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ cc_library(
"//xla:literal",
"//xla:shape_util",
"//xla:status_macros",
"//xla:statusor",
"//xla:types",
"//xla:util",
"//xla:xla_data_proto_cc",
Expand Down Expand Up @@ -1122,6 +1121,7 @@ cc_library(
"@com_google_absl//absl/container:inlined_vector",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/synchronization",
Expand All @@ -1131,7 +1131,6 @@ cc_library(
"//xla:debug_options_flags",
"//xla:literal",
"//xla:shape_util",
"//xla:statusor",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla:xla_proto_cc",
Expand Down Expand Up @@ -1345,7 +1344,6 @@ tsl_pybind_extension(
"@local_config_python//:python_headers", # buildcleaner: keep
"//xla:literal",
"//xla:shape_util",
"//xla:statusor",
"//xla:types",
"//xla:util",
"//xla/ffi:ffi_api",
Expand Down
2 changes: 1 addition & 1 deletion third_party/xla/xla/python/py_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ limitations under the License.

// placeholder for index annotation headers
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "llvm/Support/Casting.h"
#include "third_party/nanobind/include/nanobind/nanobind.h"
Expand All @@ -44,7 +45,6 @@ limitations under the License.
#include "xla/python/py_client.h"
#include "xla/python/traceback.h"
#include "xla/shape.h"
#include "xla/statusor.h"
#include "xla/tsl/concurrency/ref_count.h"
#include "xla/util.h"

Expand Down
2 changes: 0 additions & 2 deletions third_party/xla/xla/service/gpu/kernels/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ cc_library(
visibility = [":friends"],
deps = [
":custom_kernel",
"//xla:statusor",
"//xla:types",
"//xla:xla_data_proto_cc",
"//xla/stream_executor",
Expand Down Expand Up @@ -260,7 +259,6 @@ cc_library(
":custom_kernel",
":cutlass_gemm",
":cutlass_gemm_kernels", # build_cleaner: keep
"//xla:statusor",
"//xla:xla_data_proto_cc",
"//xla/stream_executor",
"//xla/stream_executor:kernel_spec",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ limitations under the License.

#include <cstdint>

#include "absl/status/statusor.h"
#include "xla/service/gpu/kernels/custom_kernel.h"
#include "xla/service/gpu/kernels/cutlass_gemm.h"
#include "xla/service/gpu/kernels/cutlass_gemm_custom_kernel.h"
#include "xla/statusor.h"
#include "xla/stream_executor/device_description.h"
#include "xla/xla_data.pb.h"

Expand Down
1 change: 0 additions & 1 deletion third_party/xla/xla/service/gpu/llvm_gpu_backend/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ cc_library(
]) + if_rocm_is_configured(["TENSORFLOW_USE_ROCM=1"]),
deps = [
"//xla:status_macros",
"//xla:statusor",
"//xla:types",
"//xla:util",
"//xla:xla_proto_cc",
Expand Down
3 changes: 1 addition & 2 deletions third_party/xla/xla/service/gpu/model/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ cc_library(
":hlo_op_profiles",
":indexing_analysis",
"//xla:shape_util",
"//xla:statusor",
"//xla:util",
"//xla/hlo/ir:hlo",
"//xla/service:hlo_cost_analysis",
Expand All @@ -315,6 +314,7 @@ cc_library(
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
Expand Down Expand Up @@ -810,7 +810,6 @@ cc_library(
"//xla:debug_options_flags",
"//xla:literal",
"//xla:shape_util",
"//xla:statusor",
"//xla:util",
"//xla:xla_data_proto_cc",
"//xla/backends/profiler/gpu:cupti_collector",
Expand Down
2 changes: 1 addition & 1 deletion third_party/xla/xla/service/gpu/model/hlo_op_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ limitations under the License.

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "xla/debug_options_flags.h"
Expand All @@ -37,7 +38,6 @@ limitations under the License.
#include "xla/service/hlo_runner.h"
#include "xla/shape.h"
#include "xla/shape_util.h"
#include "xla/statusor.h"
#include "xla/stream_executor/device_description.h"
#include "xla/tests/test_utils.h"
#include "xla/util.h"
Expand Down
2 changes: 1 addition & 1 deletion third_party/xla/xla/service/gpu/runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,6 @@ cc_library(
deps = [
":thunk",
"//xla:shape_util",
"//xla:statusor",
"//xla:xla_data_proto_cc",
"//xla/service:buffer_assignment",
"//xla/service:global_device_id",
Expand All @@ -1092,6 +1091,7 @@ cc_library(
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/synchronization",
"@local_tsl//tsl/platform:errors",
Expand Down
2 changes: 1 addition & 1 deletion third_party/xla/xla/service/gpu/runtime/send_recv_thunk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ limitations under the License.
#include "absl/container/flat_hash_map.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include "absl/synchronization/mutex.h"
#include "xla/service/buffer_assignment.h"
#include "xla/service/global_device_id.h"
#include "xla/service/gpu/runtime/thunk.h"
#include "xla/shape.h"
#include "xla/statusor.h"
#include "xla/stream_executor/device_memory.h"
#include "xla/stream_executor/event.h"
#include "xla/stream_executor/stream_executor.h"
Expand Down
2 changes: 0 additions & 2 deletions third_party/xla/xla/service/gpu/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ xla_test(
deps = [
":gpu_codegen_test",
"//xla:error_spec",
"//xla:statusor",
"//xla:test",
"//xla:xla_proto_cc",
"//xla/hlo/ir:hlo",
Expand Down Expand Up @@ -999,7 +998,6 @@ xla_test(
"//xla:literal_util",
"//xla:reference_util",
"//xla:shape_util",
"//xla:statusor",
"//xla:test_helpers",
"//xla:types",
"//xla:xla_data_proto_cc",
Expand Down
2 changes: 1 addition & 1 deletion third_party/xla/xla/service/heap_simulator/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ cc_library(
deps = [
":allocation_block",
"//xla:comparison_util",
"//xla:statusor",
"//xla:util",
"//xla/hlo/ir:hlo",
"//xla/hlo/utils:hlo_live_range",
Expand All @@ -60,6 +59,7 @@ cc_library(
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
Expand Down
Loading

0 comments on commit 28d7d5a

Please sign in to comment.