Skip to content

test(rccl): add host microtests for the profiler plugin - #13597

Open
aduforest wants to merge 7 commits into
developfrom
users/aduforest/aicomrccl-2818-profiler-host-microtests
Open

aduforest wants to merge 7 commits into
developfrom
users/aduforest/aicomrccl-2818-profiler-host-microtests

Conversation

@aduforest

@aduforest aduforest commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

JIRA ID: AICOMRCCL-2818

What

  • New rccl-UnitTestsMicroProfiler (137 tests) for src/plugin/profiler.cc: plugin load/unload, event start/stop/record wrappers, the KernelCh profiler thread.
  • Also the profiler_v1..v7.cc adapters.

How

  • Fake v7 plugin and fake v1..v6 plugins behind test-local seams (ncclOpenProfilerPluginLib, ncclOsDlsym, dlsym/dladdr, logging, env); the hipified units are #included.
  • Thread tests drive the real profiler thread through fake device counter buffers.
  • Pins 4 production bugs as KnownBug_ tests:
    • a failed plugin init() unloads twice, closing the lib under a live comm;
    • 256-channel colls are advertised as 0 channels (uint8 truncation);
    • the v5 adapter drops GroupStartApiStop/GroupEndApiStart (the core passes null args);
    • the v1 adapter maps AlltoAll/AlltoAllv/Gather/Scatter to Send and bf16/fp8 to Float64.
  • Seen but not pinned, since asserting them would depend on UB; the p2p tests only check channels < 64: the p2p KernelCh post loop shifts 1ull << c for c up to MAXCHANNELS; the v4 adapter never copies p2p.nChannels into its uninitialised descriptor; with RCCL_ENABLE_PROXY_TRACE=1 the plugin name logged after load points at an out-of-scope soPath.

Coverage

profiler.cc 1147/1159 lines (the 12 misses are an allocation-failure path ncclMemoryPoolAlloc can't reach), profiler_v1..v7.cc 100% each.

Mutation Testing

72/72 killed (54 in profiler.cc, 18 across the adapters).

Test Plan

All 137 pass in Debug and Release (-O3) standalone builds, and --gtest_shuffle --gtest_repeat=20 is clean in both.

New rccl-UnitTestsMicroProfiler binary covering src/plugin/profiler.cc
(plugin load/unload, the event start/stop/record wrappers and the KernelCh
profiler thread) and the profiler_v1..v7.cc adapters, against a fake plugin
behind test-local plugin-open and dlsym seams.

Pins six production bugs as observed: a failed plugin init() is unloaded
twice, 256-channel collectives are advertised with 0 channels, p2p KernelCh
posts alias channels >= 64 onto c % 64, the v4 adapter never copies
p2p.nChannels, the v5 adapter drops the group-API states, and the v1
adapter reports AlltoAll/Gather/Scatter as Send and bf16/fp8 as Float64.

Co-Authored-By: Claude <noreply@anthropic.com>
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

The p2p post test now asserts only channels below 64 (the post loop shift is
undefined above), and the v4 test that read the uninitialised p2p.nChannels
is dropped.

Co-Authored-By: Claude <noreply@anthropic.com>
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

Findings

5 more finding(s), not posted inline
  • projects/rccl/test/host/profiler-test.cc:2136 (Low) A failing ASSERT here leaves local child in live_, so TearDown destroys a freed comm and onStart spins on dead locals
  • projects/rccl/test/host/profiler-test.cc:495 (Low) Asserted 'Successfully loaded ... proxytrace.so' log depends on use-after-scope of soPath in profiler.cc
  • projects/rccl/test/host/profiler-test.cc:572 (Low) Tests pinning known bugs carry only a // Bug: comment, no KnownBug_ prefix or tracking ID
  • projects/rccl/test/host/profiler-test.cc:2165 (Low) ProfilerThread_AbortWhileIdle_Exits passes with the abort check removed, since Destroy sets stop and joins anyway
  • projects/rccl/test/host/profiler-v5-test.cc:290 (Low) v4/v5 tests pin 'dropped event leaves *eHandle untouched', an adapter inconsistency rather than a contract

This PR changes 4,147 lines across 14 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 once profiler-test.cc:2215 waits for Inflight == 1 instead of reading it once right after the stop-count wait.

Comment @argus review to re-run, or @argus re-review after pushing.

Comment thread projects/rccl/test/host/profiler-test.cc Outdated
Wait for the inflight count after the stops instead of reading it once, keep
child comms and the blocking callback alive through TearDown, drop the
proxy-trace success-log check (profiler.cc reads soPath after its scope
ends), drop the idle-abort test that the stop path already covered, stop
asserting the v4/v5 dropped-event handle, and name the bug-pinning tests
KnownBug_.

Co-Authored-By: Claude <noreply@anthropic.com>
@aduforest

Copy link
Copy Markdown
Member Author

@argus re-review

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

This PR changes 4,133 lines across 14 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.

@aduforest
aduforest marked this pull request as ready for review October 15, 2026 22:33
@aduforest
aduforest requested review from a team October 15, 2026 22:33
…comrccl-2818-profiler-host-microtests

# Conflicts:
#	projects/rccl/test/host/MICROTEST_README.md
#	projects/rccl/test/host/run_host_tests.sh
#	projects/rccl/tools/scripts/test_runner/configs/ci-precheckin.json
#	projects/rccl/tools/scripts/test_runner/lib/test_executor.py
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

This PR changes 4,133 lines across 14 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.

…one-line pin comments

Co-Authored-By: Claude <noreply@anthropic.com>
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

This PR changes 4,130 lines across 14 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.

…comrccl-2818-profiler-host-microtests

# Conflicts:
#	projects/rccl/test/host/MICROTEST_README.md
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

This PR changes 4,168 lines across 14 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.

…comrccl-2818-profiler-host-microtests

# Conflicts:
#	projects/rccl/test/host/MICROTEST_README.md
#	projects/rccl/tools/scripts/test_runner/lib/test_executor.py
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

This PR changes 4,158 lines across 14 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 branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants