diff options
author | Akshay Modi <nareshmodi@google.com> | 2018-07-24 14:10:01 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-07-24 14:14:04 -0700 |
commit | e9398c43cf470a7388df7d20baf6dd10a3b42edb (patch) | |
tree | b1f901eaa30d36533f5056de3e6ccdc6805fb66e /tensorflow/core/protobuf | |
parent | 76e8f7b7fdf89b131e0406022129d5dde6b89e40 (diff) |
Push tensors from client to workers.
At times, a server cannot open a reverse connection to the client. This is
required when using the _Send/_Recv ops and the client needs to send a tensor
to the server (tensors are pulled). Instead, this adds a way to push the
tensors directly from the client.
Currently, pushing tensors always happens in sync mode.
PiperOrigin-RevId: 205888825
Diffstat (limited to 'tensorflow/core/protobuf')
-rw-r--r-- | tensorflow/core/protobuf/eager_service.proto | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tensorflow/core/protobuf/eager_service.proto b/tensorflow/core/protobuf/eager_service.proto index 5b05a1b3ee..63ba4eb173 100644 --- a/tensorflow/core/protobuf/eager_service.proto +++ b/tensorflow/core/protobuf/eager_service.proto @@ -8,6 +8,7 @@ import "tensorflow/core/framework/function.proto"; import "tensorflow/core/framework/versions.proto"; import "tensorflow/core/protobuf/tensorflow_server.proto"; import "tensorflow/core/framework/tensor_shape.proto"; +import "tensorflow/core/framework/tensor.proto"; message RemoteTensorHandle { // The ID of the operation that produced this tensor. @@ -128,6 +129,24 @@ message RegisterFunctionRequest { message RegisterFunctionResponse { } +message SendTensorRequest { + fixed64 context_id = 1; + + // All remote tensors are identified by <Op ID, Output num>. To mimic this + // situation when directly sending tensors, we include an "artificial" op ID + // (which would have corresponded to the _Recv op when not using SendTensor). + int64 op_id = 2; + // The index within the repeated field is the output number that will help + // uniquely identify (along with the above op_id) the particular tensor. + repeated TensorProto tensors = 3; + + // The device on which the tensors should be resident. + string device_name = 4; +} + +message SendTensorResponse { +} + //////////////////////////////////////////////////////////////////////////////// // // Eager Service defines a TensorFlow service that executes operations eagerly @@ -174,4 +193,8 @@ service EagerService { // Takes a FunctionDef and makes it enqueable on the remote worker. rpc RegisterFunction(RegisterFunctionRequest) returns (RegisterFunctionResponse); + + // An RPC to push tensors to the server. At times, certain environments don't + // allow the server to connect back to the client. + rpc SendTensor(SendTensorRequest) returns (SendTensorResponse); } |