Fix NCCL warm-up allreduce count mismatch#69
Open
rwakizaka wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When the number of determinants is not evenly divisible by
bdet_comm_size, theprocess reproducibly hangs inside the NCCL warm-up
ncclAllReducecall insbd/chemistry/tpb/sbdiag.h, before "NCCL communicators have been created." isprinted.
Root cause
After
init_nccl_comm, a warm-upnccl_allreducewas called with a buffer sizedW.size():Wis the local wavefunction chunk distributed across the β-det communicator. Whenthe total number of determinants is not evenly divisible by
bdet_comm_size, eachrank holds a different-sized slice of
W. NCCL'sncclAllReducerequires allparticipating ranks to pass the same element count; mismatched counts cause a
protocol deadlock.
Fix
Replace the variable-size warm-up buffers with a constant-size buffer of 1 element
for all four NCCL communicators (
h,b,t,a):The warm-up exists solely to trigger NCCL channel setup before the main computation;
the data transferred is irrelevant, so a single-element buffer is sufficient.
Files changed
include/sbd/chemistry/tpb/sbdiag.h— warm-up allreduce buffer size changed fromW.size()to1for all four NCCL communicators