-
Notifications
You must be signed in to change notification settings - Fork 25.7k
fix sequence number for group #134578
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
fix sequence number for group #134578
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/134578
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1ad6e7a with merge base de4c2a3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@shengfukevin Has updated and depend on #134619. Please help review! |
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.
The PR adds isP2P_ to WorkNCCL. Does WorkNCCL use it somewhere?
|
Do you mind adding in the PR description what issue this PR fixes and how it fixes the issue? |
Hi, @kwen2501 I'm working with @shengfukevin on Execution Trace replay. |
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.
Hmm I see. You put isP2P_ into work because of this RECORD_PARAM_COMMS call in work.wait().
Do you think we can infer isP2P from work.opType? (i.e. when it is SEND or RECV?). Or do you think there isn't a mapping at the moment?
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.
Would this example work for you?
| bool isP2P = isP2POp(opType); |
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.
We can't because we can't deduce whether it's collective or p2p from OpType::COALESCED .
| return endCoalescing(OpType::COALESCED); |
pytorch/torch/distributed/distributed_c10d.py
Line 2283 in a0207c8
| group._start_coalescing(device) |
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.
Curious -- is there a corresponding change to RECORD_PARAM_COMMS that accepts this new argument type?
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 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.
Giving approval to unblock.
Please be advised that we cannot guarantee compatibility going forward with the trace player you mentioned -- we may change the sequence number as we see fit.
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.
@fduwjj @c-p-i-o do you think we can consolidate the bool isP2P = isP2POp(opType) logic below with this change? It may not be so trivial though. See this comment: https://github.com/pytorch/pytorch/pull/134578/files#r1764430474
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.
Sure. I can try to address this in a subsequent change.
|
Thanks, @kwen2501 @shengfukevin |
|
It seems there are lint issues. Can you run If CI looks good, you can hit: |
|
Hi, @kwen2501 |
|
Can you run: This should get this PR into the main branch after CI passes. |
|
@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 |
Summary: The recent DIFF pytorch/pytorch#134578 change the sequence id in ET from sequence id ( an integer) to a [sequence id, is_p2p_op], an array of two integers. The replay code need to make the similar change. Differential Revision: D65099031
Summary: Pull Request resolved: #185 The recent DIFF pytorch/pytorch#134578 change the sequence id in ET from sequence id ( an integer) to a [sequence id, is_p2p_op], an array of two integers. The replay code need to make the similar change. Reviewed By: briancoutinho Differential Revision: D65099031 fbshipit-source-id: 91174f27cf3ced1d25d0c11748adea88b87bdc03


Summary:
Fix sequence number in execution trace dump for matching between collective/p2p op and wait in execution trace replay.
ProcessGroupNCCLhas 2 sequence number counter,seqCollective_andseqP2P_.pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.hpp
Lines 1188 to 1191 in b18ba94
However,
WorkNCCLonly has one sequence number memberseq_.pytorch/torch/csrc/distributed/c10d/ProcessGroupNCCL.hpp
Line 387 in b18ba94
We need to match collective and p2p with wait separately.
facebookresearch/param@29b5a46
Depend on: #135132
Test Plan: buck2 run mode/dev-nosan kineto/libkineto/fb/integration_tests:pytorch_execution_trace_integration_test
Differential Revision:
cc @XilunWu @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o