Use tf_grpc_cc_dependency in tensorflow/core/distributed_runtime

Also create a similar tf_grpc_dependency function for the third_party/tensorflow:grpc dependency.

PiperOrigin-RevId: 304494463
Change-Id: I7a8684a5283ce10d7d586cfe0fb0b4a6506a6866
This commit is contained in:
Andrew Audibert 2020-04-02 15:51:43 -07:00 committed by TensorFlower Gardener
parent 34eefbcd57
commit 5a890478b7
5 changed files with 37 additions and 28 deletions

View File

@ -4,7 +4,8 @@
# processes.
load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_copts", "tf_cuda_library")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test") # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_grpc_cc_dependency") # buildifier: disable=same-origin-load
# For platform specific build config
load(
@ -652,7 +653,6 @@ tf_cuda_cc_test(
":master",
":remote_device",
":worker_interface",
"//tensorflow:grpc++",
"//tensorflow/core:control_flow_ops_op_lib",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
@ -676,6 +676,7 @@ tf_cuda_cc_test(
"//tensorflow/core/kernels:dense_update_ops",
"//tensorflow/core/kernels:identity_op",
"//tensorflow/core/kernels:variable_ops",
tf_grpc_cc_dependency(),
],
)
@ -693,7 +694,6 @@ tf_cuda_cc_test(
":master",
":remote_device",
":worker_interface",
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
@ -709,6 +709,7 @@ tf_cuda_cc_test(
"//tensorflow/core/distributed_runtime/rpc:grpc_testlib",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
tf_grpc_cc_dependency(),
],
)

View File

@ -1,3 +1,4 @@
load("//tensorflow:tensorflow.bzl", "tf_grpc_cc_dependency")
load(
"//tensorflow:tensorflow.bzl",
"tf_cc_test",
@ -99,7 +100,6 @@ cc_library(
":cluster_function_library_runtime",
":remote_mgr",
":remote_tensor_handle",
"//tensorflow:grpc++",
"//tensorflow/c:c_api_internal",
"//tensorflow/c:tf_status_helper",
"//tensorflow/core:core_cpu_internal",
@ -125,6 +125,7 @@ cc_library(
"@com_google_absl//absl/container:fixed_array",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/types:optional",
tf_grpc_cc_dependency(),
],
)

View File

@ -8,8 +8,10 @@ load(
"tf_cc_test",
"tf_cuda_library",
)
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_tests")
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_test") # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_cuda_cc_tests") # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_grpc_dependency") # buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "tf_grpc_cc_dependency") # buildifier: disable=same-origin-load
# For platform specific build config
load(
@ -42,12 +44,12 @@ cc_library(
hdrs = ["grpc_util.h"],
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
deps = [
"//tensorflow:grpc",
"//tensorflow:grpc++",
"//tensorflow/core:lib",
# Required to be able to overload TensorResponse parsing.
"//tensorflow/core/distributed_runtime:tensor_coding",
"//tensorflow/core:lib_internal",
tf_grpc_dependency(),
tf_grpc_cc_dependency(),
],
)
@ -57,8 +59,8 @@ cc_library(
hdrs = ["grpc_client_cq_tag.h"],
deps = [
":grpc_util",
"//tensorflow:grpc++",
"//tensorflow/core:lib",
tf_grpc_cc_dependency(),
],
)
@ -69,12 +71,12 @@ cc_library(
deps = [
":grpc_client_cq_tag",
":grpc_util",
"//tensorflow:grpc++",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core/distributed_runtime:call_options",
"//tensorflow/core/distributed_runtime:tensor_coding",
"@com_google_absl//absl/strings:str_format",
tf_grpc_cc_dependency(),
],
)
@ -87,7 +89,6 @@ cc_library(
":grpc_state",
":grpc_util",
":grpc_worker_service_impl",
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
@ -96,6 +97,7 @@ cc_library(
"//tensorflow/core/distributed_runtime:tensor_coding",
"//tensorflow/core/distributed_runtime:worker_cache_logger",
"//tensorflow/core/distributed_runtime:worker_interface",
tf_grpc_cc_dependency(),
],
)
@ -105,12 +107,12 @@ cc_library(
hdrs = ["grpc_channel.h"],
deps = [
":grpc_util",
"//tensorflow:grpc++",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"@com_google_absl//absl/strings",
tf_grpc_cc_dependency(),
],
)
@ -119,7 +121,6 @@ cc_library(
srcs = ["grpc_tensor_coding.cc"],
hdrs = ["grpc_tensor_coding.h"],
deps = [
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
"//tensorflow/core:framework_internal",
@ -127,6 +128,7 @@ cc_library(
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:worker_proto_cc",
"@com_google_absl//absl/flags:flag",
tf_grpc_cc_dependency(),
],
)
@ -135,9 +137,9 @@ cc_library(
srcs = [],
hdrs = ["grpc_call.h"],
deps = [
"//tensorflow:grpc++",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
tf_grpc_cc_dependency(),
],
)
@ -188,7 +190,6 @@ tf_cuda_library(
":grpc_tensor_coding",
":grpc_util",
":grpc_worker_service_impl",
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
@ -202,6 +203,7 @@ tf_cuda_library(
"//tensorflow/core/distributed_runtime:worker_env",
"//tensorflow/core/distributed_runtime:worker_session",
"@com_google_absl//absl/container:flat_hash_map",
tf_grpc_cc_dependency(),
],
)
@ -211,9 +213,9 @@ cc_library(
hdrs = ["grpc_worker_service_impl.h"],
deps = [
":grpc_util",
"//tensorflow:grpc++",
"//tensorflow/core:worker_proto_cc",
"//tensorflow/core/distributed_runtime:tensor_coding",
tf_grpc_cc_dependency(),
],
)
@ -244,12 +246,12 @@ cc_library(
":grpc_call",
":grpc_master_service_impl",
":grpc_util",
"//tensorflow:grpc++",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:master_proto_cc",
"//tensorflow/core/distributed_runtime:master",
"//tensorflow/core/profiler/lib:traceme",
tf_grpc_cc_dependency(),
],
alwayslink = 1,
)
@ -259,8 +261,8 @@ cc_library(
srcs = ["grpc_master_service_impl.cc"],
hdrs = ["grpc_master_service_impl.h"],
deps = [
"//tensorflow:grpc++",
"//tensorflow/core:master_proto_cc",
tf_grpc_cc_dependency(),
],
)
@ -293,8 +295,6 @@ cc_library(
":grpc_worker_cache",
":grpc_worker_service",
":rpc_rendezvous_mgr",
"//tensorflow:grpc",
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
@ -315,6 +315,8 @@ cc_library(
"//tensorflow/core/distributed_runtime:worker_cache_wrapper",
"//tensorflow/core/distributed_runtime:worker_env",
"//tensorflow/core/distributed_runtime/rpc/eager:grpc_eager_service_impl",
tf_grpc_dependency(),
tf_grpc_cc_dependency(),
],
alwayslink = 1,
)
@ -335,7 +337,6 @@ tf_cc_binary(
],
deps = [
":grpc_server_lib",
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu",
"//tensorflow/core:data_flow_ops_op_lib",
"//tensorflow/core:framework_internal",
@ -348,6 +349,7 @@ tf_cc_binary(
"//tensorflow/core:sendrecv_ops_op_lib",
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/kernels:data_flow",
tf_grpc_cc_dependency(),
],
)
@ -360,7 +362,6 @@ cc_library(
],
deps = [
":grpc_server_lib",
"//tensorflow:grpc++",
"//tensorflow/core:array_ops_op_lib",
"//tensorflow/core:bitwise_ops_op_lib",
"//tensorflow/core:core_cpu",
@ -378,6 +379,7 @@ cc_library(
"//tensorflow/core/kernels:matmul_op",
"//tensorflow/core/kernels:reduction_ops",
"//tensorflow/core/kernels:variable_ops",
tf_grpc_cc_dependency(),
],
alwayslink = 1,
)
@ -473,7 +475,6 @@ tf_cc_test(
deps = [
":grpc_tensor_coding",
":grpc_testlib",
"//tensorflow:grpc++",
"//tensorflow/core:core_cpu",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:framework",
@ -483,6 +484,7 @@ tf_cc_test(
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core:worker_proto_cc",
tf_grpc_cc_dependency(),
],
)
@ -492,11 +494,11 @@ tf_cc_test(
srcs = ["grpc_util_test.cc"],
deps = [
":grpc_util",
"//tensorflow:grpc",
"//tensorflow:grpc++",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:worker_proto_cc",
tf_grpc_dependency(),
tf_grpc_cc_dependency(),
],
)

View File

@ -1,3 +1,5 @@
load("//tensorflow:tensorflow.bzl", "tf_grpc_cc_dependency")
package(
default_visibility = [
"//tensorflow:internal",
@ -12,9 +14,9 @@ cc_library(
srcs = ["grpc_eager_service.h"],
hdrs = ["grpc_eager_service.h"],
deps = [
"//tensorflow:grpc++",
"//tensorflow/core:eager_service_proto_cc",
"//tensorflow/stream_executor/platform",
tf_grpc_cc_dependency(),
],
)
@ -24,7 +26,6 @@ cc_library(
hdrs = ["grpc_eager_client.h"],
deps = [
":grpc_eager_service",
"//tensorflow:grpc++",
"//tensorflow/core:eager_service_proto_cc",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
@ -33,6 +34,7 @@ cc_library(
"//tensorflow/core/distributed_runtime/rpc:grpc_client_cq_tag",
"//tensorflow/core/distributed_runtime/rpc:grpc_state",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
tf_grpc_cc_dependency(),
],
)
@ -42,7 +44,6 @@ cc_library(
hdrs = ["grpc_eager_service_impl.h"],
deps = [
":grpc_eager_service",
"//tensorflow:grpc++",
"//tensorflow/core:eager_service_proto_cc",
"//tensorflow/core:framework",
"//tensorflow/core:ptr_util",
@ -52,5 +53,6 @@ cc_library(
"//tensorflow/core/distributed_runtime/rpc:grpc_channel",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
tf_grpc_cc_dependency(),
],
)

View File

@ -2803,5 +2803,8 @@ def filegroup_as_file(name, dep, visibility = []):
visibility = visibility,
)
def tf_grpc_dependency():
return "//tensorflow:grpc"
def tf_grpc_cc_dependency():
return "//tensorflow:grpc++"