pytorch/test/cpp/rpc
Lucas Hosseini a84afb3a7c Use type-erased union for Buffer. (#54251)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/54251

Pull Request resolved: https://github.com/pytorch/tensorpipe/pull/324

In order to merge the channel hierarchies, we need a generic `Buffer` type, that can wrap either a `CpuBuffer` or a `CudaBuffer`.
The constraints are that, since this type is used by the channels, it cannot explicitly refer to `CudaBuffer`. We propose here a type-erasure based solution, with small-buffer optimization to avoid heap-allocating the wrapped concrete buffer.

This is a new version of D27001339 (c618dc13d2) which broke PyTorch OSS build.

Test Plan: CI

Reviewed By: lw, mrshenli

Differential Revision: D27156053

fbshipit-source-id: 4244302af33a3be91dcd06093c0d6045d081d3cc
2021-03-19 04:58:09 -07:00
..
CMakeLists.txt fix tensorpipe_agent linked even when USE_TENSORPIPE is turned off (#53281) 2021-03-04 13:29:27 -08: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 [RPC] Refactor rref_context to not use utils::Future (#51697) 2021-02-19 00:59:38 -08:00
test_e2e_process_group.cpp [distributed] add base processgroup::options (#53662) 2021-03-17 18:40:04 -07:00
test_e2e_tensorpipe.cpp [distributed] add base processgroup::options (#53662) 2021-03-17 18:40:04 -07:00
test_tensorpipe_serialization.cpp Use type-erased union for Buffer. (#54251) 2021-03-19 04:58:09 -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