Repository navigation
fix(gin): size Anvil signal allgather to the world communicator #12450
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
Closed
dlamd1dai
wants to merge
1
commit into
ROCm:develop
from
dlamd1dai:users/dondai/aicomrccl-2339-signal-allgather
Closed
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -723,14 +723,21 @@ static ncclResult_t ginAnvilRegisterLsaSignals(ginAnvilGinCtx* ctx, void* lsaSel | |||||||||||||||||||||
| (unsigned long)hostAddrs[ctx->rank], (unsigned long)selfExpected, (unsigned long)lsaSelf, (long)stride); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| uintptr_t* gatheredLocalBases = (uintptr_t*)calloc((size_t)ctx->nRanks, sizeof(uintptr_t)); | ||||||||||||||||||||||
| // bootstrapAllGather writes one slot per world rank (bootstrap state->nranks). | ||||||||||||||||||||||
| // Under NCCL_GIN_CONNECTION_RAIL, ctx->nRanks/ctx->rank are the GIN team, so a | ||||||||||||||||||||||
| // team-sized buffer is overrun and the local VA must be published at comm->rank. | ||||||||||||||||||||||
| const int worldRanks = comm->nRanks; | ||||||||||||||||||||||
| uintptr_t* gatheredLocalBases = | ||||||||||||||||||||||
| (worldRanks > 0) ? (uintptr_t*)calloc((size_t)worldRanks, sizeof(uintptr_t)) : nullptr; | ||||||||||||||||||||||
| if (gatheredLocalBases) { | ||||||||||||||||||||||
| gatheredLocalBases[ctx->rank] = (uintptr_t)lsaSelf; | ||||||||||||||||||||||
| if (ginAnvilBootstrapAllgather(comm->bootstrap, gatheredLocalBases, sizeof(uintptr_t)) != 0) { | ||||||||||||||||||||||
| WARN("GIN anvil-sdma: signal local-base allgather failed"); | ||||||||||||||||||||||
| } else if (gatheredLocalBases[ctx->rank] != (uintptr_t)lsaSelf) { | ||||||||||||||||||||||
| WARN("GIN anvil-sdma: signal local-base allgather mismatch rank=%d got=%#lx expect=%#lx", ctx->rank, | ||||||||||||||||||||||
| (unsigned long)gatheredLocalBases[ctx->rank], (unsigned long)lsaSelf); | ||||||||||||||||||||||
| if (comm->rank >= 0 && comm->rank < worldRanks) { | ||||||||||||||||||||||
| gatheredLocalBases[comm->rank] = (uintptr_t)lsaSelf; | ||||||||||||||||||||||
| if (ginAnvilBootstrapAllgather(comm->bootstrap, gatheredLocalBases, sizeof(uintptr_t)) != 0) { | ||||||||||||||||||||||
| WARN("GIN anvil-sdma: signal local-base allgather failed"); | ||||||||||||||||||||||
| } else if (gatheredLocalBases[comm->rank] != (uintptr_t)lsaSelf) { | ||||||||||||||||||||||
| WARN("GIN anvil-sdma: signal local-base allgather mismatch rank=%d got=%#lx expect=%#lx", comm->rank, | ||||||||||||||||||||||
| (unsigned long)gatheredLocalBases[comm->rank], (unsigned long)lsaSelf); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit
Suggested change
|
||||||||||||||||||||||
| free(gatheredLocalBases); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Oops, something went wrong.
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.
Medium
No test can observe this fix: the stub
bootstrapAllGatherat gin_anvil_plugin_test_stubs.cc:103 returns early for any element size other thansizeof(int), and this call passessizeof(uintptr_t), sorccl-UnitTestsGinAnvilPluginpasses bit-identically with the fix reverted.ConnCheck_SkippedOnRailConnectionat GinAnvilPlugin_test.cpp:526 already buildscomm->rank=1againstctx->rank=0, so the divergence is one fixture away. Could the stub record the buffer and size, the waybootstrapIntraNodeAllGatheralready records ranks at gin_anvil_plugin_test_stubs.cc:144, so the published slot becomes assertable?