diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2016-08-09 15:43:08 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-08-09 16:51:19 -0700 |
commit | 634a712e92fa7847b053bb2e8901109ae86f3c72 (patch) | |
tree | a0dfc5541c52f7510242f86959b68ada3eb85693 /tensorflow/core/distributed_runtime/worker_interface.h | |
parent | 25b4c35831dec10a06d889e8bdc4dd07ee6d3d3e (diff) |
Avoid an extra copy when receiving a tensor over grpc.
A benchmark that sends around 400KB tensors speeds up by ~10-15%.
Details:
* RecvTensor RPC yields a TensorResponse instead of a RecvTensorResponse.
* TensorResponse has custom decoding code that can decode contents
directly into a Tensor's underlying buffer.
* Wire protocol is unchanged.
Change: 129809238
Diffstat (limited to 'tensorflow/core/distributed_runtime/worker_interface.h')
-rw-r--r-- | tensorflow/core/distributed_runtime/worker_interface.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tensorflow/core/distributed_runtime/worker_interface.h b/tensorflow/core/distributed_runtime/worker_interface.h index 3dd00c559d..4ae4e76ea4 100644 --- a/tensorflow/core/distributed_runtime/worker_interface.h +++ b/tensorflow/core/distributed_runtime/worker_interface.h @@ -29,10 +29,8 @@ namespace tensorflow { // Status callback. typedef std::function<void(const Status&)> StatusCallback; -// Allocator callback for out-of-band transfers. -class TensorShape; -typedef std::function<void*(size_t, const DataType&, const TensorShape&)> - TensorBufAllocator; +// Custom decoder for a response to RecvTensorAsync. +class TensorResponse; // Interface for talking with the TensorFlow Worker service. class WorkerInterface { @@ -65,8 +63,7 @@ class WorkerInterface { virtual void RecvTensorAsync(CallOptions* opts, const RecvTensorRequest* request, - RecvTensorResponse* response, - TensorBufAllocator allocator, + TensorResponse* response, StatusCallback done) = 0; virtual void LoggingAsync(const LoggingRequest* request, |