Skip to content

Commit

Permalink
Move tsl/protobuf/* besides error_codes.proto to xla/tsl/protobuf
Browse files Browse the repository at this point in the history
`error_codes.proto` will be moved in a separate change

PiperOrigin-RevId: 678848832
  • Loading branch information
ddunl authored and copybara-github committed Sep 25, 2024
1 parent 2e7dabe commit 7804cf3
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 844 deletions.
4 changes: 2 additions & 2 deletions tsl/platform/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ cc_library(
deps = [
":status",
"//tsl/protobuf:error_codes_proto_impl_cc",
"//tsl/protobuf:status_proto_cc",
"@xla//xla/tsl/protobuf:status_proto_cc",
] + tf_platform_deps("status"),
)

Expand Down Expand Up @@ -1349,10 +1349,10 @@ tsl_cc_test(
":test",
":test_main",
"//tsl/protobuf:error_codes_proto_impl_cc",
"//tsl/protobuf:status_proto_cc",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:cord",
"@com_google_absl//absl/strings:str_format",
"@xla//xla/tsl/protobuf:status_proto_cc",
],
)

Expand Down
8 changes: 4 additions & 4 deletions tsl/platform/default/build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def tf_lib_proto_parsing_deps():
return [
":protos_all_cc",
clean_dep("@eigen_archive//:eigen3"),
clean_dep("//tsl/protobuf:protos_all_cc"),
clean_dep("@xla//xla/tsl/protobuf:protos_all_cc"),
]

def tf_py_clif_cc(name, visibility = None, **kwargs):
Expand Down Expand Up @@ -779,8 +779,8 @@ def tsl_cc_test(
# TODO(ddunleavy) remove these and add proto deps to tests
# granularly
clean_dep("//tsl/protobuf:error_codes_proto_impl_cc_impl"),
clean_dep("//tsl/protobuf:histogram_proto_cc_impl"),
clean_dep("//tsl/protobuf:status_proto_cc_impl"),
clean_dep("@xla//xla/tsl/protobuf:histogram_proto_cc_impl"),
clean_dep("@xla//xla/tsl/protobuf:status_proto_cc_impl"),
clean_dep("//tsl/profiler/protobuf:xplane_proto_cc_impl"),
clean_dep("//tsl/profiler/protobuf:profiler_options_proto_cc_impl"),
],
Expand All @@ -789,7 +789,7 @@ def tsl_cc_test(
)

def tf_portable_proto_lib():
return ["//tensorflow/core:protos_all_cc_impl", clean_dep("//tsl/protobuf:protos_all_cc_impl")]
return ["//tensorflow/core:protos_all_cc_impl", clean_dep("@xla//xla/tsl/protobuf:protos_all_cc_impl")]

def tf_protobuf_compiler_deps():
return if_static(
Expand Down
2 changes: 1 addition & 1 deletion tsl/platform/status_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ limitations under the License.
#include "absl/status/status.h"
#include "absl/strings/cord.h"
#include "absl/strings/str_format.h"
#include "xla/tsl/protobuf/status.pb.h"
#include "tsl/platform/errors.h"
#include "tsl/platform/stack_frame.h"
#include "tsl/platform/status_matchers.h"
#include "tsl/platform/status_to_from_proto.h"
#include "tsl/platform/test.h"
#include "tsl/protobuf/error_codes.pb.h"
#include "tsl/protobuf/status.pb.h"

namespace tsl {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion tsl/platform/status_to_from_proto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ limitations under the License.

#include <string>

#include "xla/tsl/protobuf/status.pb.h"
#include "tsl/platform/status.h"
#include "tsl/protobuf/error_codes.pb.h"
#include "tsl/protobuf/status.pb.h"

namespace tsl {

Expand Down
2 changes: 1 addition & 1 deletion tsl/platform/status_to_from_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
#ifndef TENSORFLOW_TSL_PLATFORM_STATUS_TO_FROM_PROTO_H_
#define TENSORFLOW_TSL_PLATFORM_STATUS_TO_FROM_PROTO_H_

#include "xla/tsl/protobuf/status.pb.h"
#include "tsl/platform/status.h"
#include "tsl/protobuf/status.pb.h"

namespace tsl {

Expand Down
84 changes: 0 additions & 84 deletions tsl/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Placeholder: load py_proto_library
load(
"@xla//xla/tsl:tsl.bzl",
"if_google",
Expand All @@ -20,93 +19,10 @@ package(
licenses = ["notice"],
)

tf_proto_library(
name = "dnn_proto",
srcs = ["dnn.proto"],
make_default_target_header_only = True,
protodeps = if_google(["//google/protobuf:wrappers"]),
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "error_codes_proto_impl",
srcs = ["error_codes.proto"],
make_default_target_header_only = True,
protodeps = if_google(["//google/protobuf:any"]),
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "status_proto",
srcs = ["status.proto"],
make_default_target_header_only = True,
protodeps = [":error_codes_proto_impl"],
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "histogram_proto",
srcs = ["histogram.proto"],
make_default_target_header_only = True,
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "coordination_config_proto",
srcs = ["coordination_config.proto"],
make_default_target_header_only = True,
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "coordination_service_proto",
srcs = ["coordination_service.proto"],
has_services = 1,
create_grpc_library = True,
create_java_proto = False,
create_service = True,
protodeps = if_google(["//google/protobuf:any"]),
visibility = ["//visibility:public"],
)

# copybara:uncomment_begin(google-only)
# py_proto_library(
# name = "coordination_service_py_pb2",
# api_version = 2,
# visibility = ["//visibility:public"],
# deps = [":coordination_service_proto"],
# )
# copybara:uncomment_end

tf_proto_library(
name = "distributed_runtime_payloads_proto",
srcs = ["distributed_runtime_payloads.proto"],
make_default_target_header_only = True,
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "rpc_options_proto",
srcs = ["rpc_options.proto"],
make_default_target_header_only = True,
visibility = ["//visibility:public"],
)

tf_proto_library(
name = "protos_all",
create_go_proto = False,
make_default_target_header_only = True,
protodeps = [
# TODO(tlongeri): Conceptually, these fit into protos_all but adding them currently causes
# breakages (and they are not actually used).
"@xla//xla/tsl/protobuf:bfc_memory_map_proto",
":coordination_config_proto",
":distributed_runtime_payloads_proto",
":error_codes_proto_impl",
":histogram_proto",
":rpc_options_proto",
":status_proto",
"@xla//xla/tsl/protobuf:test_log_proto",
] + if_google(["//google/protobuf:any"]),
visibility = ["//visibility:public"],
)
74 changes: 0 additions & 74 deletions tsl/protobuf/coordination_config.proto

This file was deleted.

Loading

0 comments on commit 7804cf3

Please sign in to comment.