pytorch/test/cpp/rpc
Shen Li 06aaf8c20d Add set_device_map to TensorPipeOptions to support GPU args (#42637)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42637

This commit enables sending non-CPU tensors through RPC using
TensorPipe backend. Users can configure device mappings by calling
set_map_location on `TensorPipeRpcBackendOptions`. Internally,
the `init_rpc` API verifies the correctness of device mappings. It
will shutdown RPC if the check failed, or proceed and pass global
mappings to `TensorPipeAgent` if the check was successful. For serde,
we added a device indices field to TensorPipe read and write buffers,
which should be either empty (all tensors must be on CPU) or match
the tensors in order and number in the RPC message. This commit
does not yet avoid zero-copy, the tensor is always moved to CPU
on the sender and then moved to the specified device on the receiver.

Test Plan: Imported from OSS

Reviewed By: izdeby

Differential Revision: D23011572

Pulled By: mrshenli

fbshipit-source-id: 62b617eed91237d4e9926bc8551db78b822a1187
2020-08-14 18:46:55 -07:00
..
CMakeLists.txt Build test_e2e_tensorpipe only if Gloo is enabled (#43041) 2020-08-14 09:24:47 -07:00
e2e_test_base.cpp Enroll TensorPipe agent in C++-only E2E test (#42680) 2020-08-13 07:07:30 -07:00
e2e_test_base.h Enroll TensorPipe agent in C++-only E2E test (#42680) 2020-08-13 07:07:30 -07:00
test_e2e_process_group.cpp Add C++ end to end test for RPC and distributed autograd. (#36893) 2020-07-15 12:59:19 -07:00
test_e2e_tensorpipe.cpp Guard TensorPipe agent by USE_TENSORPIPE (#42682) 2020-08-14 02:57:36 -07:00
test_tensorpipe_serialization.cpp Add set_device_map to TensorPipeOptions to support GPU args (#42637) 2020-08-14 18:46:55 -07:00
test_wire_serialization.cpp Back out "Revert D21171334: [pytorch][PR] Change StorageImpl to track byte count rather than element count" (#37893) 2020-05-05 22:43:15 -07:00