-
Notifications
You must be signed in to change notification settings - Fork 76
Make Channel API accept buffer structs rather than raw pointers. #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
+ Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. [ghstack-poisoned]
Note: Preliminary discussion for this happened here. |
+ Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. ghstack-source-id: 132990d Pull Request resolved: pytorch#212
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a couple of naming discussions I'd like to get resolved. And, as you know, I'd like to see a WIP PR up against PyTorch to see how this new API would look like when used from there.
Also, I found several instances where you used Channel<CpuTensor>
instead of CpuChannel
: did you not find&replace to substitute them? Could you do so now to make sure I didn't miss any?
PR against pytorch: pytorch/pytorch#41475 |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce tensor.h defining the tensor struct(s). The `CpuTensor` struct is always defined, while the `CudaTensor` struct is defined only when `TENSORPIPE_HAS_CUDA` is true. + Update all channels to take a `CpuTensor` or `CudaTensor` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TTensor`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…nters." + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: [D23598033](https://our.internmc.facebook.com/intern/diff/D23598033) [ghstack-poisoned]
@beauby has updated the pull request. You must reimport the pull request before landing. |
…orch#212) Summary: Pull Request resolved: pytorch#212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: 1c1de3cfb8c492e3e1497db17d7d29fbb1db9161
…014) Summary: Pull Request resolved: pytorch/pytorch#45014 Pull Request resolved: pytorch#219 Pull Request resolved: pytorch#212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: a18ca76e1453f2b5d091a2d0103362818eafa028
…014) Summary: Pull Request resolved: pytorch/pytorch#45014 Pull Request resolved: pytorch#219 Pull Request resolved: pytorch#212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: 8bd83a8a7e7c2e7d96b4c6025f1238546cdd6222
…014) Summary: Pull Request resolved: pytorch/pytorch#45014 Pull Request resolved: pytorch#219 Pull Request resolved: pytorch#212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: 6e66ec1184cd568e99f6d0096d3f88e18e9e5a91
…014) Summary: Pull Request resolved: pytorch/pytorch#45014 Pull Request resolved: #219 Pull Request resolved: #212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: a18ca76e1453f2b5d091a2d0103362818eafa028
…014) Summary: Pull Request resolved: pytorch/pytorch#45014 Pull Request resolved: #219 Pull Request resolved: #212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: a18ca76e1453f2b5d091a2d0103362818eafa028
…orch#45014) Summary: Pull Request resolved: pytorch#45014 Pull Request resolved: pytorch/tensorpipe#219 Pull Request resolved: pytorch/tensorpipe#212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: 7bd0ddbb23b063bc0c436f09c1fac2a875a4f62e
) Summary: Pull Request resolved: #45014 Pull Request resolved: pytorch/tensorpipe#219 Pull Request resolved: pytorch/tensorpipe#212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: 1d6c3f91e288420858835cd5e7962e8da051b44b
…014) Summary: Pull Request resolved: pytorch/pytorch#45014 Pull Request resolved: #219 Pull Request resolved: #212 + Introduce buffer.h defining the buffer struct(s). The `CpuBuffer` struct is always defined, while the `CudaBuffer` struct is defined only when `TENSORPIPE_SUPPORTS_CUDA` is true. + Update all channels to take a `CpuBuffer` or `CudaBuffer` for `send`/`recv` rather than a raw pointer and a length. + Make the base `Channel`/`Context` classes templated on `TBuffer`, effectively creating two channel hierarchies (one for CPU channels, one for CUDA channels). + Update the Pipe and the generic channel tests to use the new API. So far, generic channel tests are CPU only, and tests for the CUDA IPC channel are (temporarily) disabled. A subsequent PR will take care of refactoring tests so that generic tests work for CUDA channels. An other PR will add support for CUDA tensors in the Pipe. Differential Revision: D23598033 Test Plan: Imported from OSS Reviewed By: lw Pulled By: beauby fbshipit-source-id: 1d6c3f91e288420858835cd5e7962e8da051b44b
Stack from ghstack:
channelName()
in channel test helper. #213 Get rid ofchannelName()
in channel test helper.channel::Channel::
tochannel::
. #210 Move channel types fromchannel::Channel::
tochannel::
.CpuBuffer
struct is always defined, while the
CudaBuffer
struct is definedonly when
TENSORPIPE_SUPPORTS_CUDA
is true.CpuBuffer
orCudaBuffer
forsend
/recv
rather than a raw pointer and a length.Channel
/Context
classes templated onTBuffer
,effectively creating two channel hierarchies (one for CPU channels,
one for CUDA channels).
far, generic channel tests are CPU only, and tests for the CUDA IPC
channel are (temporarily) disabled. A subsequent PR will take care of
refactoring tests so that generic tests work for CUDA channels. An
other PR will add support for CUDA tensors in the Pipe.
Differential Revision: D23598033