You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(rccl): cover KernelCh profiling on the per-communicator profiler thread - #12715
NCCL 2.31.2 moved KernelCh profiling to a dedicated per-communicator thread, extending kernel timing to proxy-less NVLink/SHM and graph-captured collectives. The port is in develop, but nothing exercised it beyond a smoke check that some KernelCh events appear. This PR adds the tests; no library code changes.
Technical Details
Test-only profiler plugin test/plugin/profiler_kernelch_recorder.{h,cpp}, built against the standalone v7 headers and installed beside rccl-UnitTestsMPI. It records Coll, P2p, KernelCh and KernelPhase events with the threads that delivered them.
ProfilerKernelChMPITests.cpp, 13 tests. Each checks that every Coll/P2p gets exactly nChannels KernelCh children, each stopped once with a timer, all on the dedicated profiler thread and never on the caller or a proxy thread. Covered: proxy-less intra-node, SHM, the proxy path, send/recv, graph replays, eager/graph mixing, a burst past the 64-slot ring, split communicators, abort, timer units, and KernelPhase from the symmetric kernels.
Four categories in test_categories_mpi.yaml, since the transport and cuMem variables are cached per process. All set RCCL_DDA_ENABLE=0.
Known gaps, not fixed here: DDA collectives raise no profiler events at all (to be tracked as an enablement task), and graphUsageMode defaults to 0 in RCCL, which misattributes KernelCh timings under eager/graph mixing (docs fixed in #13033).
Issue Tracking
JIRA ID: AICOMRCCL-2011
Test Plan
Debug builds, the four quick_env_profiler_kernelch* categories on one node, plus 2-node runs.
Test Result
GPU
ROCm
Runs
Result
gfx942 (MI300X)
7.0.1
8 ranks, SHM, network on one node, 2 nodes
pass; KernelPhase test skips (cuMem init crashes on that host, as for SymWin_AllReduce)
gfx950 (MI355X)
10.1.0
8 ranks x3, SHM, network on one node, 2 ranks; KernelPhase test at 8 and 2 ranks
pass
The suite fails on 8-rank gfx950 without RCCL_DDA_ENABLE=0. The mixing test skips, with the reason, when NCCL_GRAPH_MIXING_SUPPORT=0 in the environment turns mixing off.
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
Findings
3 finding(s) that could not be posted as inline comments
projects/rccl/test/plugin/profiler_kernelch_recorder.cpp:203 (Low) Snapshot builds the full parent index map before honouring cap == 0, so the 1 ms size probe rehashes everything under the lock rcclKchRecorderSnapshot builds the parent index map before the cap == 0 break at line 209, so waitForDrain's 1 ms size probe (test/ProfilerKernelChMPITests.cpp:198) rehashes every record while holding gMutex, throttling the profiler thread it is waiting on. Could we return early when cap is 0?
projects/rccl/test/ProfilerKernelChMPITests.cpp:135 (Low) TearDown releases neither the device buffers nor the streams, so any fatal assertion mid-body leaks them TearDown() releases neither the device buffers nor the streams the bodies create, and freeBuffers() is only ever a body's last statement, so a fatal ASSERT after allocBuffers() leaks both allocations for the rest of the process. Could we free them here?
projects/rccl/test/ProfilerKernelChMPITests.cpp:410 (Low) checkBalanced's KernelChStats is discarded in three tests, dropping the task-count assertion their siblings make checkBalanced's KernelChStats is discarded here and at line 474 and line 747, so those three never assert the task count that lines 385, 437, 582 and 618 do, and a run recording one of eight collectives still passes. Was that deliberate?
This PR changes 1,135 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: Worth settling before approval: a broken recorder .so turns all 12 tests into green skips (ProfilerKernelChMPITests.cpp:122), and the rank-local skip at line 153 hangs the ranks that succeeded.
Comment @argus review to re-run, or @argus re-review after pushing.
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,135 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: Worth settling before approval: both Medium findings from the last round are unchanged, a broken recorder .so still yields 12 green skips (ProfilerKernelChMPITests.cpp:122), and the rank-local skip at line 153 still blocks the ranks that succeeded.
Comment @argus review to re-run, or @argus re-review after pushing.
The three findings from the first review that couldn't be posted inline are addressed in 545f1e8: rcclKchRecorderSnapshot returns before building the index when cap is 0; TearDown frees the buffers and the owned stream; and the proxy-less, SHM and timer tests now assert the task count like the others.
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,253 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: Worth settling before approval: checkBalanced's stopTimer/startTimer check at ProfilerKernelChMPITests.cpp:325 contradicts the burst test's own slot-reuse disclaimer, so that test can fail with no regression present.
Comment @argus review to re-run, or @argus re-review after pushing.
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,287 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,504 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
ncclCommWindowRegister is collective. Short-circuiting the second call after a
failed first one let that rank skip a registration its peers were blocked in,
before the failure was agreed on.
Co-authored-by: Cursor <cursoragent@cursor.com>
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,505 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
slotReuse disables the only assertion that observes stopTimer, so the burst test can pass even if every KernelCh stop state carries a missing/zero timestamp. Slot reuse can invert start/stop ordering, but it should not remove the timer itself; require a nonzero stop timer unconditionally and relax only the ordering comparison.
…f; require a stop timer
NCCL_GRAPH_MIXING_SUPPORT overrides the config's graphUsageMode, so an inherited 0
ran the unsupported eager/graph mix and failed. The test now checks the effective
mode after init and skips on every rank, saying why. Pinning the variable in the
category instead would move every other test in that process off the default mode.
checkBalanced only looked at stopTimer through the ordering check, which slot reuse
disables, so a stop state without a timestamp went unnoticed in the burst test. A
nonzero stop timer is now required in every case.
Co-authored-by: Cursor <cursoragent@cursor.com>
Re the "previously missed" finding (require a nonzero stop timer even with slot reuse): fixed in be9b210. checkBalanced now requires a nonzero stopTimer on every KernelCh, and slotReuse only relaxes the stop-after-start ordering. On gfx942 (8 ranks) the suite, including the 512-op burst, passes; on gfx950 (ROCm 10.1.0, NCCL_CUMEM_ENABLE=1) the symmetric test passed 5/5 at 8 ranks and 5/5 at 2 ranks.
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,510 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
With runtime connect, the first captured collective sets up connections with its
peers, so a rank whose hipStreamBeginCapture failed would leave them waiting in it.
The ranks now agree that capture began before any of them enqueues work.
checkBalanced only kept KernelCh off the caller and the proxy threads. On a graph
replay the Coll and P2p events come from HIP's host callback thread, so KernelCh
delivered on that thread passed. KernelCh must now avoid every thread that
delivered a Coll or P2p event.
Co-authored-by: Cursor <cursoragent@cursor.com>
The reason will be displayed to describe this comment to others. Learn more.
ARGUS
This PR changes 1,529 lines across 5 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
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.
Motivation
NCCL 2.31.2 moved KernelCh profiling to a dedicated per-communicator thread, extending kernel timing to proxy-less NVLink/SHM and graph-captured collectives. The port is in
develop, but nothing exercised it beyond a smoke check that some KernelCh events appear. This PR adds the tests; no library code changes.Technical Details
test/plugin/profiler_kernelch_recorder.{h,cpp}, built against the standalone v7 headers and installed besiderccl-UnitTestsMPI. It records Coll, P2p, KernelCh and KernelPhase events with the threads that delivered them.ProfilerKernelChMPITests.cpp, 13 tests. Each checks that every Coll/P2p gets exactlynChannelsKernelCh children, each stopped once with a timer, all on the dedicated profiler thread and never on the caller or a proxy thread. Covered: proxy-less intra-node, SHM, the proxy path, send/recv, graph replays, eager/graph mixing, a burst past the 64-slot ring, split communicators, abort, timer units, and KernelPhase from the symmetric kernels.test_categories_mpi.yaml, since the transport and cuMem variables are cached per process. All setRCCL_DDA_ENABLE=0.Known gaps, not fixed here: DDA collectives raise no profiler events at all (to be tracked as an enablement task), and
graphUsageModedefaults to 0 in RCCL, which misattributes KernelCh timings under eager/graph mixing (docs fixed in #13033).Issue Tracking
JIRA ID: AICOMRCCL-2011
Test Plan
Debug builds, the four
quick_env_profiler_kernelch*categories on one node, plus 2-node runs.Test Result
SymWin_AllReduce)The suite fails on 8-rank gfx950 without
RCCL_DDA_ENABLE=0. The mixing test skips, with the reason, whenNCCL_GRAPH_MIXING_SUPPORT=0in the environment turns mixing off.Submission Checklist