-
Notifications
You must be signed in to change notification settings - Fork 191
Add ncclCommDump API #2068
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
Open
ahmd-k
wants to merge
12
commits into
ROCm:develop
Choose a base branch
from
ahmd-k:nccl-comm-dump
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add ncclCommDump API #2068
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
97bb563
Set ProxyTrace DONE
ahmd-k f87a753
Add ncclCommDump API
ahmd-k e6ab938
remove trailing whitespace changes
ahmd-k 4e31b58
Add more proxy trace timestamps
ahmd-k f9d85fe
Add facebook_rccl namespace before proxyTrace timestamp call
ahmd-k e082d38
Clean up ProxyTrae construction
ahmd-k 843a1f2
Move updateProxyOpCounter to member function
ahmd-k 84cf804
Move setProxyOpTimestamp to member function
ahmd-k ffa27f1
Move addNewProxyOp to member function
ahmd-k 56a6b9a
Make internal methods private
ahmd-k efd854a
Make ProxyTrace thread safe
ahmd-k 31d6f56
Fix unit tests
ahmd-k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
|
||
| #include "nccl.h" | ||
| #include <cstring> | ||
| #include "comm.h" | ||
| #include "device.h" | ||
| #include "archinfo.h" | ||
|
|
||
| __attribute__ ((visibility("default"))) | ||
| ncclResult_t ncclCommDump( | ||
| const ncclComm_t comm, | ||
| std::unordered_map<std::string, std::string>& map) { | ||
| if (comm == nullptr) { | ||
| WARN("ncclCommDump comm is null"); | ||
| return ncclSuccess; | ||
| } | ||
| if (comm->proxyState->proxyTrace == nullptr) { | ||
| WARN("ncclCommDump comm->proxyState->proxyTrace is null"); | ||
| return ncclSuccess; | ||
| } | ||
|
|
||
| WARN("ncclCommDump() ProxyTrace:"); | ||
| WARN("%s", comm->proxyState->proxyTrace->dump().c_str()); | ||
|
|
||
| return ncclSuccess; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Make const std::unordered_map<std::string, std::string>& map
Uh oh!
There was an error while loading. Please reload this page.
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.
I may have missed it, but why not pass in ncclComm_t as a const reference rather than passing it by value?
Uh oh!
There was an error while loading. Please reload this page.
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.
In NCCLX and RCCLX, this map is not const because it is where we store some structured trace data that callers like PyTorch can use.
See the NCCLX API: https://github.com/meta-pytorch/torchcomms/blob/fe4e8116f2107b5aed0e38db10e072471ea95126/comms/ncclx/v2_27/meta/commDump.cc#L219
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.
Good point, I was just following the NCCLX implementation but I don't see why we copy the communicator here. @dmwu @YulunW any idea why the the communicator is passed by value in
ncclCommDump()?