-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add batch option for send/recv_object_list #160342
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/160342
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit f77258f with merge base 0e45023 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
the implementation seems correct but i'm questioning whether we want the complexity; what's the motivation? and would we get there a different way if we instead pushed harder on deprecating lazy init altogether..? |
|
@wconstab The motivation is that it gives an option for users to not have to create 2-rank NCCL communicators if they don't want to. So for us in PP, since we only use batch_isend_irecv this is kinda an escape hatch for us. Will we be able to deprecate lazy init for regular P2P ops? I think it makes sense that when PG is created we can establish the NCCL communicators for each rank. But in regular P2P ops there is also a communicator for each pair of ranks so I assume we don't want to also create those extra ones as well? |
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.
lgtm, thanks!
|
@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 |
`send_object_list` and `recv_object_list` use regular `send`/`recv` P2P ops which means that they will create 2-rank NCCL communicators between ranks if the communicators have not been initialized. This adds an option `use_batch` which will call the send/recv with `batch_isend_irecv` which will re-use the communicators already initialized for collectives in the group. --- BatchP2P ops, creates (or use existing) communicator keyed by device index Regular P2P Ops, creates (or use existing) dedicated 2-rank communicators keyed by “rank1:rank2” See: https://github.com/pytorch/pytorch/blob/c8205cb35435f39d2c26f6c94b45e4adeb6dcb23/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp#L3980-L4008 Pull Request resolved: pytorch#160342 Approved by: https://github.com/wconstab
`send_object_list` and `recv_object_list` use regular `send`/`recv` P2P ops which means that they will create 2-rank NCCL communicators between ranks if the communicators have not been initialized. This adds an option `use_batch` which will call the send/recv with `batch_isend_irecv` which will re-use the communicators already initialized for collectives in the group. --- BatchP2P ops, creates (or use existing) communicator keyed by device index Regular P2P Ops, creates (or use existing) dedicated 2-rank communicators keyed by “rank1:rank2” See: https://github.com/pytorch/pytorch/blob/c8205cb35435f39d2c26f6c94b45e4adeb6dcb23/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp#L3980-L4008 Pull Request resolved: pytorch#160342 Approved by: https://github.com/wconstab
Stack from ghstack (oldest at bottom):
send_object_listandrecv_object_listuse regularsend/recvP2P ops which means that they will create 2-rank NCCL communicators between ranks if the communicators have not been initialized.This adds an option
use_batchwhich will call the send/recv withbatch_isend_irecvwhich will re-use the communicators already initialized for collectives in the group.BatchP2P ops, creates (or use existing) communicator keyed by device index
Regular P2P Ops, creates (or use existing) dedicated 2-rank communicators keyed by “rank1:rank2”
See:
pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp
Lines 3980 to 4008 in c8205cb
cc @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta