Repository navigation
test(rccl): add host microtests for src/graph - #13605
Conversation
New binary rccl-UnitTestsMicroTopo compiles the real src/graph files, one test TU each, against fakes/graph_fakes.cc. TopoScene.h builds topology XML in the test so the real parser and system builder run host-only. Co-Authored-By: Claude <noreply@anthropic.com>
Covers building the system from XML (XGMI, MLOPart, C2C, BCM switches, NICs), NIC fusion and plugin import, local NIC/GPU queries, ncclTopoGetSystem, and path computation with the P2P/GDR/PXN decisions. Co-Authored-By: Claude <noreply@anthropic.com>
…ls.cc search-test.cc drives ncclTopoCompute over XML-built systems (rings, trees, NVLS, CollNet, inter-node NIC selection, graph XML import/export) and the search helpers directly. rome-models-test.cc rebuilds every Rome model's signature from XML and runs each matcher (4P2H, A2a8P, 1H16P, 4H4P, GigaIO, chordal ring) plus the ring/tree string parsers. paths-test.cc gains ncclTopoTrimSystem and ncclTopoGetPxnRanks now that search.cc links. Co-Authored-By: Claude <noreply@anthropic.com>
…d trees.cc connect-test.cc covers ncclTopoPreset, the tree-string postset, ring and tree wiring across nodes (plain, load-balanced and rail-optimized), CollNet/NVLS heads, channel-count limits and ncclTopoPostset end to end. rings-test.cc and trees-test.cc cover ring linearization and the binary and double binary trees. With connect.cc linked, paths-test.cc gains the ncclTopoComputeP2pChannels tests. Long lines wrapped to 120 columns. Co-Authored-By: Claude <noreply@anthropic.com>
The ncclTopoRankToIndex/DevToRank/IdToNetDev test now checks the warn flag and that the NIC dev comes from the plugin, not the node index. The parseGraph host-limit test is split: the GPU-count case writes one entry past gpus[] before the bound check, so it is pinned as observed and skipped under AddressSanitizer. Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus review |
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
There was a problem hiding this comment.
ARGUS
Findings
5 more finding(s), not posted inline
projects/rccl/test/host/rome-models-test.cc:739(Low)ParseGraph_OneGpuPastTheLimitIsWrittenBeforeTheStopruns a real out-of-bounds stack write in the main gtest processprojects/rccl/test/host/TopoScene.h:57(Low)TempFileignores amkstempfailure, keeps the fixed template path, and later reads, writes and unlinks itprojects/rccl/test/host/fakes/graph_fakes.h:8(Low) graph_fakes.h rationale says the shared fakes define graph symbols, but hip_fakes.cc, amdsmi_fakes.cc, os_fakes.cc and bootstrap_stubs.cc define noneprojects/rccl/test/host/search-test.cc:30(Low)GraphPtris defined in three test files andNewGraphtwice near-identically; both belong in TopoScene.hprojects/rccl/test/host/rome-models-test.cc:441(Low) Outer loops wrapping nested multi-line bodies are unbraced (rome-models-test.cc:271, 280, 287, 441; topo-test.cc:61), against nccl_coding_style.md
This PR changes 9,273 lines across 17 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: mallinfo2() in rome-models-test.cc needs glibc 2.33, two tests put a multi-MB ncclComm on the stack, and AutoMerge_OverfullVnicIsAnError leaks under LeakSanitizer.
Comment @argus review to re-run, or @argus re-review after pushing.
- InUseBytes falls back to mallinfo() before glibc 2.33. - The parent ncclComm in two tests moves to the heap. - AutoMerge_OverfullVnicIsAnError pins the leaked path matrix and skips under ASan; the parseGraph overflow runs in a death-test child. - TempFile reports a mkstemp failure instead of using the template path. - GraphPtr/NewGraph and the ASan switch move to TopoScene.h. - Braces on every control statement whose body spans lines. - DumpLine test passed fewer values than ranks; it now passes all 12. - graph_fakes.h names the shared fakes that define graph symbols. Co-Authored-By: Claude <noreply@anthropic.com>
|
Non-inline findings, all fixed in e15a22f:
|
|
@argus re-review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,334 lines across 17 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 REMOVE_DEFS ENABLE_WARP_SPEED is added to the rccl-UnitTestsMicroTopo call in test/host/CMakeLists.txt, so the binary links in a warp-speed (gfx950) in-tree build.
Comment @argus review to re-run, or @argus re-review after pushing.
With ENABLE_WARP_SPEED from an in-tree build, connect.cc calls rcclGetMaxWarpsPerBlock and rcclWarpSpeedComputeNChannels, which only rccl_wrap.cc defines, so the binary would not link. Drop the define as rccl-UnitTestsMicroInit does. Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus re-review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,335 lines across 17 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.
…icrotests develop added its own connect-test.cc for rccl-UnitTestsMicroConnect (#12679). Keep it as is and move this PR's connect.cc tests to graph-connect-test.cc, with suites renamed GraphConnect*. connect.cc now records the preset channel count and expands it in Postset, so the Postset fixture sets nChannels and the intra tree/CollNet chain rows, and the new code gets its own tests. Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,398 lines across 17 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.
…icrotests develop added rccl-UnitTestsMicroRomeModels with its own rome-models-test.cc. Keep it as is and move this PR's rome_models.cc tests to graph-rome-models-test.cc, with suites renamed GraphRomeModels*. Drop the two parseGraphLight tests that develop's suite now covers. The registration files (README, run_host_tests.sh, ci-precheckin.json, test_executor.py) keep both binaries. Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,379 lines across 17 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.
… KnownBug_ pins - Compute_NvlsBacksOffWhenTheUplinkIsShort asserts the reduced bandwidth; the search tests whose names claimed more than nChannels >= 1 now check the NICs, channel counts or bandwidth they name, and FollowPath's check is unconditional. - graph_fakes.cc: hipGetDevice, bootstrapAllGather and canConnect default to FailLoudUnfaked; the hand-written params are pinned with rccl_assert_source_line; the header says why the owner fakes files aren't used. - The real own-binary reason in CMake and the README, a "Where a fake belongs" row, and a reason for REMOVE_DEFS ENABLE_WARP_SPEED. - Pinned production bugs are named <Fn>_KnownBug_<What>; the amdsmiInit pin moves out of the FillGpu happy path. AutoMerge_OverfullVnicIsAnError no longer claims to pin the leak. - Drop the Postset checks develop's ConnectMicrotest.PresetPostset_* already make. Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,442 lines across 17 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.
…icrotests #3894 adds the compact double tree (NCCL_TREE_COMPACT) and a useCompactTree argument to getTreeNodeParity. The parity test covers both modes, and new tests pin ncclGetDtreeCompact's shape and its use in connectTrees, connectNvls and the rail-optimized trees. #13536 makes the XML gpu dev the SMI index and a failed HIP lookup an error, so the xml and ncclTopoGetSystem tests follow. #12336's MLOPart sibling channel count and single-node round fitting get tests. Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,588 lines across 17 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-2799-graph-host-microtests # Conflicts: # projects/rccl/test/host/CMakeLists.txt # 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
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,618 lines across 17 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.
…o binary - graph_fakes.cc no longer redefines the hip_fakes.cc and amdsmi_fakes.cc hooks (same names, same signatures); it links both and ResetGraphFakes() sets the graph defaults on them. amdsmi_fakes.cc gains the init-call counter. - Hooks installed mid-test use ScopedHook, and env changes in test bodies use RcclUnitTesting::ScopedEnv. - Death tests restore death_test_style. - KnownBug_ pins name their Jira ticket. - test_executor.py lists only this PR's binary. Co-Authored-By: Claude <noreply@anthropic.com>
…comrccl-2799-graph-host-microtests
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,540 lines across 19 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-2799-graph-host-microtests Co-Authored-By: Claude <noreply@anthropic.com>
…comrccl-2799-graph-host-microtests Co-Authored-By: Claude <noreply@anthropic.com>
|
@argus review |
There was a problem hiding this comment.
ARGUS
This PR changes 9,540 lines across 19 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.
TheRock Submodule Bump ActivityNewest first
|
xml-test.cc (added in #13605) unconditionally includes <cpuid.h> and uses __cpuid() inline asm, which fails on non-x86 architectures (ppc64le, aarch64). Guard the include, the HostCpuId() helper, and the one test that calls it behind an x86 preprocessor check. Two other tests hardcode EXPECT_EQ("x86_64", ...) for the arch attribute, but the SUT correctly returns the host arch (e.g. "ppc64"). Add a constexpr kHostArch that mirrors the arch detection in xml.cc (same condition order: __PPC__, __aarch64__, x86; same macro names) so these tests pass on any architecture. Unknown architectures produce a hard #error to surface the contract immediately. Co-Authored-By: Claude <noreply@anthropic.com>
JIRA ID: AICOMRCCL-2799
What
Host-only microtests for
src/graph:xml.cc/xml.h,topo.cc/topo.h,paths.cc,search.cc,rome_models.cc,connect.cc,rings.ccandtrees.cc, in a newrccl-UnitTestsMicroTopobinary (482 tests, about 5.5 s).How
#includeing the hipified unit through<STEM>_CC_PATH.rccl-UnitTestsMicroGraphlinkstuning_fakes.cc, which definesconnect.cc's params, andos_fakes.cc, whose CPU and sysfs seams these tests cannot drive. HIP and amd-smi go throughfakes/hip_fakes.ccandfakes/amdsmi_fakes.cc; the other externals are infakes/graph_fakes.{h,cc}.NCCL_TOPO_FILE-style XML built inTopoScene.hand parsed by the realxml.cc/topo.cc, so paths, search, the Rome model matchers and connect run on real input.ncclTopoAddCpu: the Rome/Zen classification overwrites the Zen generation, so AMD SYS bandwidth is alwaysAMD_ZEN12_BW.ncclTopoGetXmlCpuArch: noarchon any<cpu>dereferences NULL.ncclTopoAddGpu: a<gpu>withoutgcnsegfaults.ncclTopoAutoMerge: after a failed merge device 0 is never re-placed.ncclTopoFillGpu: thestatic amdsmiInitguard is never set, soamd_smi_initruns on every call.parseA2a8P: 8 GPUs with 16 NICs walk about 15! NIC orderings, stalling init.parseA2a8Pandparse1H16Pleakall_gpu_permutationswhen no model matches.parseGraphwritesgpus[gpu]one past the stack array before checking the count.parseOptionsdrops option pairs past the fifth (latent).ncclTopoAutoMerge's "too many NICs" return skipsfree(paths).Coverage
8323/8397 lines (99.12%) over the hipified graph sources, with develop's
rccl-UnitTestsMicroRomeModelscoveringparseGraphLight; what's left is allocation failures, dead code and branches compiled out under HIP.Mutation Testing
272 targeted mutants, 270 killed, 2 equivalent.
Test Plan
rccl-UnitTestsMicroTopo(standalone build): 482 passed, and--gtest_shuffle --gtest_repeat=20is clean;rccl-UnitTestsMicroConnectandrccl-UnitTestsMicroRomeModelsstill pass.