fix(rccl): return ncclLoadParam's value from RCCL_PARAM macros #15773
<!-- therock-pr-bot-policy-check -->
✅ All Checks Passed — Ready for Review
| Check | Status | Details |
|---|:---:|---|
| 📝 PR Description | ✅ Pass | — |
| ⛔ Forbidden Files | ✅ Pass | — |
| 🧪 Unit Test | ⚠️ Warning | Error: Source/code files changed without an accompanying unit test.<br>Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).<br>Current: code file(s) changed: projects/rccl/src/include/param.h, projects/rccl/src/misc/param.cc, projects/rccl/test/host/fakes/env_fakes.cc, projects/rccl/test/host/fakes/graph_fakes.cc, projects/rccl/test/host/param/param-test.cc; no test file found |
| 🔎 pre-commit | ✅ Pass | Not applicable — this repo has no pre-commit workflow. |
| 🚫 Draft PR | 🔜 To Be Enabled | — |
| 🚩 Feature Flag | 🔜 To Be Enabled | — |
| 📊 Code Coverage | 🔜 To Be Enabled | — |
| 🤖 therock-pr-bot | ✅ Pass | — |
🎉 All checks passed! This PR is ready for review.
📖 Need help? See the Policy FAQ for details on every check and how to fix failures.
<!-- therock-pr-bot-fix-policies -->
🎉 All checks passed! This PR is ready for review.
Medium
noCache is shared by both spellings, but ncclLoadParam sets it once from whichever key the first call loads (misc/param.cc:94). With NCCL_NO_CACHE=RCCL_X and only NCCL_X set at the first call, the policy is checked for NCCL_X, so the value is cached and a later RCCL_X is never read. The new alias test passes because it lists both spellings (param-test.cc:71-72). Could we set noCache from both keys, e.g. treat the param as uncached if ncclParamIsCacheDisabled("RCCL_" env) || ncclParamIsCacheDisabled("NCCL_" env)?
Medium
RcclParamMicrotest is outside the "Param*" pattern in test_categories_micro_param.yaml:9, which matches from the start of the full gtest name, so CTest registration for rccl-UnitTestsMicroParam leaves these three tests out. Could we name it ParamRcclMicrotest (class plus the three TEST_Fs), like every other suite in this file?
<!-- argus:v1 pr=15773 sha=c4c138e443a9 mode=review -->
ARGUS
Bottom line: Worth settling before approval: RCCL_PARAM_NCCL_ALIAS takes its NCCL_NO_CACHE policy from whichever spelling loads first, and the new RcclParamMicrotest suite falls outside the "Param*" CTest pattern.
<sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>
<!-- argus:v1 pr=15773 sha=fe7f45893fc5 mode=re-review -->
ARGUS
Bottom line: LGTM.
<sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>
Resolved by fe7f45893f.
Resolved by fe7f45893f.
LGTM. Thanks for the fix.
Optional: no new case covers NCCL_NO_CACHE=ALL for the alias macro. One small case would keep that branch from depending only on the explicit-key tests.
LGTM, thank you. The macro fix and the alias policy change look correct. One optional test note is inline. GitHub shows a conflict with develop, so please rebase before merging.
Added in cbf52dd608: ParamRcclMicrotestIsolated.NcclAlias_NoCacheAll_ReturnsTheLoadedValueOnEveryCall sets NCCL_NO_CACHE=ALL in a fresh process with neither name listed, and checks the alias re-reads both its NCCL_ and RCCL_ names on every call.
<!-- argus:v1 pr=15773 sha=cbf52dd608f9 mode=re-review -->
ARGUS
Impact
<details>
<summary>4 test(s) to run, 0 heatmap cell(s) to measure</summary>
Host-only param loading, the same on every arch. On the default path (NCCL_NO_CACHE unset, which no yaml, script or conf in the checkout sets) the only change is that ncclLoadParam's value is returned instead of re-reading cache, and that value is identical, so nothing changes at runtime. The change only takes effect behind the explicit NCCL_NO_CACHE opt-in. There, all 143 RCCL_PARAM definitions in 43 src files and the 7 RCCL_PARAM_NCCL_ALIAS params (graph/search.cc:353 PcieOrderedRing; net_ib_cast/scheduler.cc:14-19 IB QP scheduler) now return the env value or the default instead of INT64_MIN. Per-call cost there is unchanged, since every call already went through ncclLoadParam's mutex. No collective, algorithm/protocol, size band or node-count decision moves on the default path, so no heatmap cell is affected.
Tests that exercise this change
test_categories_micro_param.yaml quick, Param: rccl-UnitTestsMicroParam, including the new ParamRcclMicrotest suites covering the RCCL_PARAM / RCCL_PARAM_NCCL_ALIAS load and NO_CACHE paths (projects/rccl/test/test_categories_micro_param.yaml)rccl-UnitTestsFixturesDebug quick, ParamTests.: exercises the real ncclLoadParam NCCL_NO_CACHE key/ALL behaviour in src/misc/param.cc (projects/rccl/test/test_categories_fixtures_debug.yaml)rccl-UnitTestsFixturesDebug quick, DdaFabricEligibilityTest.: relies on RCCL_PARAM caching on first read (DdaFabricEligibilityTests.cpp:870), the cached path the macro edit must keep (projects/rccl/test/test_categories_fixtures_debug.yaml)test_categories_micro_graph.yaml quick, Search: search.cc is a production reader of RCCL_PARAM_NCCL_ALIAS (PcieOrderedRing at search.cc:366,1691); graph_fakes.cc gains the ncclAliasCachePolicy stub (projects/rccl/test/test_categories_micro_graph.yaml)</details>
Bottom line: Worth settling before approval: no test keeps an RCCL_PARAM_NCCL_ALIAS cached, so an ncclAliasCachePolicy that always returns 1 would pass every new test.
<sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>
Medium
Every RCCL_PARAM_NCCL_ALIAS in these tests is uncached, so if ncclAliasCachePolicy (param.cc:90) returned a constant 1, all new tests would still pass. Under that change, every production alias param (scheduler.cc:14-19, search.cc:353) would re-read the env under ncclLoadParam's mutex on every call. Could we add a cached alias case alongside Cached_KeepsTheFirstValue, with neither name listed, that expects the first value after the env changes?
Added in 68a8f19cfa: ParamRcclMicrotest.NcclAlias_Cached_KeepsTheFirstValue loads an alias with neither name in NCCL_NO_CACHE through its NCCL_ name, then changes both names and expects the first value. A constant-1 ncclAliasCachePolicy now fails it.
@argus re-review
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-15773-oci-rccl-pr-smoke
Builds
All 15 components built.
Failures
No failing tests in this run.
12 tests skipped.
Performance regressions
Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 10% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.
pr-15773_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf
Readings: regressed 12, improved 6, flat 2052.
Fails the run: 0 regressed point(s) past 10%, each confirmed by an adjacent size.
One row per point, showing the reading that moved most.
| Verdict | Cell | Reading | Why | Baseline | Variant | Change |
| :-------- | :--------------------------------------------------------------------------------- | :---------- | :------------- | --------: | --------: | -----: |
| regressed | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall | busbw (ip) | readings-agree | 0.17 GB/s | 0.15 GB/s | -11.8% |
| regressed | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall | busbw (oop) | readings-agree | 0.32 GB/s | 0.29 GB/s | -9.4% |
| improved | all_gather_perf nodes=1 datatype=float size_bytes=1024 root=-1 | algbw (ip) | readings-agree | 0.17 GB/s | 0.19 GB/s | +11.8% |
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-15773-ruby64-rccl-pr-build
Builds
| Stack | Component | Version | Commit | Status | Build time |
| :--------------------------------------- | :--------------- | :------ | :----- | :------------------------ | ---------: |
| pr-15773_rccl-backtrace_rocm-10.2-latest | rocm-10.2-latest | 10.2.0 | 10.2.0 | build failed (exit 1) | |
| pr-15773_rccl-debug_rocm-10.2-latest | rocm-10.2-latest | 10.2.0 | 10.2.0 | build failed (exit 1) | |
| pr-15773_rccl-perf_rocm-10.2-latest | rocm-10.2-latest | 10.2.0 | 10.2.0 | build failed (exit 1) | |
| pr-15773_rccl-smoke_rocm-10.2-latest | rocm-10.2-latest | 10.2.0 | 10.2.0 | build failed (exit 1) | |
| rocm-10.2-latest_rccl-develop-perf | rocm-10.2-latest | 10.2.0 | 10.2.0 | build failed (exit 1) | |
Failures
No failing tests in this run.
55 tests skipped.
<!-- argus:v1 pr=15773 sha=68a8f19cfab5 mode=re-review -->
ARGUS
Impact
<details>
<summary>5 test(s) to run, 0 heatmap cell(s) to measure</summary>
Host-only env-param loading; it acts the same on every arch, so no device code, collective, algorithm/protocol, size band or node count is touched. With NCCL_NO_CACHE unset (no yaml, sh, py, conf or cmake in the checkout sets it), ncclLoadParam's return value is now returned directly. When caching is on, that value is the same one the old code read back from cache, so runtime behaviour does not change. The change only acts behind the explicit NCCL_NO_CACHE opt-in. There, every RCCL_PARAM and the 7 RCCL_PARAM_NCCL_ALIAS params (graph/search.cc:353 PcieOrderedRing; transport/net_ib_cast/scheduler.cc:14-19 IB QP scheduler) return the loaded value instead of the INT64_MIN sentinel, and an alias param is uncached if NCCL_NO_CACHE lists either spelling. Uncached calls cost the same per call (one mutex inside ncclLoadParam, as before), so no heatmap cell moves.
Tests that exercise this change
test_categories_micro_param.yaml quick, Param: runs the new ParamRcclMicrotest / ParamRcclMicrotestIsolated suites against the real RCCL_PARAM and RCCL_PARAM_NCCL_ALIAS macros and misc/param.cc's ncclAliasCachePolicy (projects/rccl/test/test_categories_micro_param.yaml)rccl-UnitTestsFixturesDebug quick, ParamTests.: exercises the real ncclLoadParam NCCL_NO_CACHE key and ALL behaviour that the macros now return directly (projects/rccl/test/test_categories_fixtures_debug.yaml)rccl-UnitTestsFixturesDebug quick, DdaFabricEligibilityTest.: relies on RCCL_PARAM caching on first read (DdaFabricEligibilityTests.cpp:870), the cached path the macro edit must keep (projects/rccl/test/test_categories_fixtures_debug.yaml)test_categories_micro_graph.yaml quick, Topo: matches TopoGpuDevMicrotest in rccl-UnitTestsMicroGraphDev, which compiles search.cc without param_redirect.h, so the real RCCL_PARAM_NCCL_ALIAS expansion links against the new env_fakes.cc ncclAliasCachePolicy stub (projects/rccl/test/test_categories_micro_graph.yaml)test_categories_micro_graph.yaml quick, Search*: the graph_fakes.cc binaries link the new ncclAliasCachePolicy stub; search.cc is the production reader of RCCL_PARAM_NCCL_ALIAS PcieOrderedRing (projects/rccl/test/test_categories_micro_graph.yaml)</details>
Bottom line: LGTM.
<sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>
Resolved by 68a8f19cfa.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-15773-oci-rccl-pr-smoke
Builds
All 15 components built.
Failures
No failing tests in this run.
12 tests skipped.
Performance regressions
Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 10% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.
pr-15773_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf
Readings: regressed 6, flat 2064.
Fails the run: 0 regressed point(s) past 10%, each confirmed by an adjacent size.
One row per point, showing the reading that moved most.
| Verdict | Cell | Reading | Why | Baseline | Variant | Change |
| :-------- | :------------------------------------------------------------- | :--------- | :------------- | --------: | -------: | -----: |
| regressed | all_gather_perf nodes=1 datatype=float size_bytes=4096 root=-1 | busbw (ip) | readings-agree | 0.65 GB/s | 0.6 GB/s | -7.7% |
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-15773-ruby64-rccl-pr-smoke
Builds
All 15 components built.
Failures
No failing tests in this run.
12 tests skipped.
Performance regressions
Thresholds. A reading is marked regressed when its performance drops more than 5% and the change is significant. The run fails when a point drops more than 8% and an adjacent size does too. Performance is bandwidth, or the inverse of latency.
pr-15773_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf
Readings: flat 2070.
Fails the run: 0 regressed point(s) past 8%, each confirmed by an adjacent size.
No confirmed regressions or improvements.
<!-- therock-bump-breadcrumb -->
TheRock Submodule Bump Activity
_Newest first_
alex-breslow-amd
dhanavikram
Motivation
RCCL_PARAMandRCCL_PARAM_NCCL_ALIASignore the value returned byncclLoadParam()and always return their staticcache.ncclLoadParam()only stores intocachewhen caching is on for the key. So when a key is listed inNCCL_NO_CACHE(orNCCL_NO_CACHE=ALL), everyrcclParam<Name>()call returnsINT64_MINinstead of the env value or the default. For example,NCCL_NO_CACHE=RCCL_UNROLL_FACTORmakes every communicator init fail.Technical Details
src/include/param.h: both macros now returnncclLoadParam()'s result on the load path, asNCCL_PARAMalready does. The cached path is unchanged.RCCL_PARAM_NCCL_ALIASreads one param under two names. ItsNCCL_NO_CACHEpolicy is now set byncclAliasCachePolicy(src/misc/param.cc): uncached if either name is listed. Before, it depended on which name the first call happened to load.test/host/param-test.cc(rccl-UnitTestsMicroParam): newParamRcclMicrotestsuite (matches theParam*CTest pattern).- A cached
RCCL_PARAMkeeps its first value.- An
RCCL_PARAMlisted inNCCL_NO_CACHEreturns the default, then re-reads the env on every call.- An
RCCL_PARAM_NCCL_ALIASwith only itsRCCL_name listed, first loaded through theNCCL_name, re-reads on every call.- An
RCCL_PARAM_NCCL_ALIASwith only itsNCCL_name listed, loaded through theRCCL_name, re-reads on every call.test/host/fakes/{env,graph}_fakes.cc: stubncclAliasCachePolicynext to theirncclLoadParamfakes.Issue Tracking
JIRA ID: AICOMRCCL-3498
Test Plan
./test/host/run_host_tests.sh allBUILD_TESTS=ON) ofrccl-UnitTestsMicroParam,rccl-UnitTestsMicroGraphandrccl-UnitTestsMicroTopo, then run themrccl-UnitTestsMicroParam --gtest_shuffle --gtest_repeat=3rccl-UnitTestsMicroParamparam.hTest Result
run_host_tests.sh all(rebased on develop): 94 binaries, 12780 tests: 12775 pass, 4 skipped, 1 fail. The failure,NetIbCastConnectSharingMicrotest.Ainic_ScalesSharedQpDepthByTheMultiplierTheCqAchieved(1533 vs 1536max_send_wr), is unrelated; it fails the same way on branches with noparam.hchange.rccl-UnitTestsMicroParam: 58/58 pass standalone and in-tree; shuffle x5 passes. In-treerccl-UnitTestsMicroGraph13/13 andrccl-UnitTestsMicroTopo410/410.WARNING: ThreadSanitizer.param.h, theNoCachetests fail withINT64_MIN(-9223372036854775808). With the return fix but the old alias cache policy, both alias tests fail (cached 5 and 4).Submission Checklist