Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187785
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 175 PendingAs of commit 907cfd7 with merge base 9f46548 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| // falls back to the plain device-pointer path. | ||
| static EpTensor make_ep_tensor( | ||
| const at::Tensor& t, | ||
| const std::string& group_name) { |
There was a problem hiding this comment.
We should really refactor this group_name API to either take value by ownership via std::move or std::string_view
There was a problem hiding this comment.
Unless rendezvous needs null termination of course
There was a problem hiding this comment.
Switched to `std::string_view`. `rendezvous` takes `const std::optionalstd::string&` (no null-termination needed), so the view is just materialized into a `std::string` at that call. Thanks!
When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor and uses the window path when available, falling back to the device-pointer path. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` - ✅ `test_combine_symm_mem_tokens` - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) ghstack-source-id: 55da7f5 Pull-Request: #187785
When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor and uses the window path when available, falling back to the device-pointer path. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` - ✅ `test_combine_symm_mem_tokens` - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) ghstack-source-id: 9b9b322 Pull-Request: #187785
When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor and uses the window path when available, falling back to the device-pointer path. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` - ✅ `test_combine_symm_mem_tokens` - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) ghstack-source-id: d5f485b Pull-Request: #187785
When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. Applies to dispatch inputs/outputs and combine inputs. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor (by `std::string_view`) and uses the window path when available, falling back to the device-pointer path. rendezvous is established implicitly on first use, so callers need not rendezvous explicitly. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` (symm_mem input + output; explicit & implicit rendezvous) - ✅ `test_combine_symm_mem_tokens` (explicit & implicit rendezvous) - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) ghstack-source-id: 4804455 Pull-Request: #187785
|
@kwen2501 anything blocking the landing here, or did you change your mind? |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (default, 1, 3, macos-m1-stable) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f "failure is unrelated " |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: Command Details for Dev Infra teamRaised by workflow job |
When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. Applies to dispatch inputs/outputs and combine inputs. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor (by `std::string_view`) and uses the window path when available, falling back to the device-pointer path. rendezvous is established implicitly on first use, so callers need not rendezvous explicitly. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` (symm_mem input + output; explicit & implicit rendezvous) - ✅ `test_combine_symm_mem_tokens` (explicit & implicit rendezvous) - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) ghstack-source-id: 594d3b6 Pull-Request: #187785
|
@pytorchbot merge -f "Minor rebase; no functional change" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…h#187785) When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. Applies to dispatch inputs/outputs and combine inputs. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor (by `std::string_view`) and uses the window path when available, falling back to the device-pointer path. rendezvous is established implicitly on first use, so callers need not rendezvous explicitly. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` (symm_mem input + output; explicit & implicit rendezvous) - ✅ `test_combine_symm_mem_tokens` (explicit & implicit rendezvous) - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) Pull Request resolved: pytorch#187785 Approved by: https://github.com/Skylion007, https://github.com/kapilsh
…h#187785) When a dispatch/combine tensor is backed by `NCCLSymmetricMemory` registered under the process group's name, address it via the registered `ncclWindow` + offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a staging copy into a regular device buffer. Applies to dispatch inputs/outputs and combine inputs. - `EpTensor` gains a window-backed constructor (`win_hdl` + `win_offset`). - `make_ep_tensor()` looks up the symm_mem rendezvous for a tensor (by `std::string_view`) and uses the window path when available, falling back to the device-pointer path. rendezvous is established implicitly on first use, so callers need not rendezvous explicitly. - `NcclEpGroup` / `NcclEpHandle` carry the `group_name` needed for that lookup. - `torch/CMakeLists.txt`: add `USE_NCCL` to the `_nccl_ep` compile definitions so `NCCL_HAS_SYMMEM_SUPPORT` is defined and `NCCLSymmetricMemory` is a complete type. Test Plan: On a node with 2+ GPUs and a `USE_NCCL_EP=1` build: ``` python -m pytest test/distributed/test_token_switch.py -k symm_mem -v ``` - ✅ `test_dispatch_symm_mem_tokens` (symm_mem input + output; explicit & implicit rendezvous) - ✅ `test_combine_symm_mem_tokens` (explicit & implicit rendezvous) - ✅ `test_dispatch_group_gemm_combine_symm_mem` (dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends) (8xH100) Pull Request resolved: pytorch#187785 Approved by: https://github.com/Skylion007, https://github.com/kapilsh
Stack from ghstack (oldest at bottom):
When a dispatch/combine tensor is backed by
NCCLSymmetricMemoryregisteredunder the process group's name, address it via the registered
ncclWindow+offset (RDMA zero-copy path) instead of a plain device pointer, avoiding a
staging copy into a regular device buffer. Applies to dispatch inputs/outputs
and combine inputs.
EpTensorgains a window-backed constructor (win_hdl+win_offset).make_ep_tensor()looks up the symm_mem rendezvous for a tensor (bystd::string_view) and uses the window path when available, falling back tothe device-pointer path. rendezvous is established implicitly on first use, so
callers need not rendezvous explicitly.
NcclEpGroup/NcclEpHandlecarry thegroup_nameneeded for that lookup.torch/CMakeLists.txt: addUSE_NCCLto the_nccl_epcompile definitionsso
NCCL_HAS_SYMMEM_SUPPORTis defined andNCCLSymmetricMemoryis acomplete type.
Test Plan:
On a node with 2+ GPUs and a
USE_NCCL_EP=1build:test_dispatch_symm_mem_tokens(symm_mem input + output; explicit & implicit rendezvous)test_combine_symm_mem_tokens(explicit & implicit rendezvous)test_dispatch_group_gemm_combine_symm_mem(dispatch -> group_gemm -> weight-mul -> combine, symm_mem on both ends)(8xH100)