fix(rccl): net-ib-cast - report recv size under adaptive routing and fix inline QP creation #16227
<!-- 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/transport/net_ib_cast/common_cast.h, projects/rccl/src/transport/net_ib_cast/connect.cc, projects/rccl/src/transport/net_ib_cast/p2p.cc, projects/rccl/test/host/transport/net_ib_cast/net-ib-cast-connect-test.cc, projects/rccl/test/host/transport/net_ib_cast/net-ib-cast-p2p-test.cc; no test file found |
| 🔎 pre-commit | ✅ Pass | — |
| 🚫 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.
The new adaptive-routing path inherits a local/remote device-index mix-up: this block selects the trailer's rkey with remCmplsRecords.rkeys[devIndex], but those keys are populated from remote device metadata (connect.cc:1728-1729). When a QP's devIndex differs from remDevIdx, the data write uses the correct remote key while the new size-record write uses a key from the wrong remote device, causing a remote-access error instead of completing the transfer. Please index the remote record keys with qp->remDevIdx, retaining the local index for the source SGE.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
The adaptive-routing path indexes the size-record write’s remote key with the local device index rather than qp->remDevIdx, causing remote-access errors when the indices differ.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
This PR fixes RCCL IB-CAST receive-size reporting and inline queue-pair creation, addressing nightly test failures exposed by the plugin-selection fix in #10975.
Changes:
| File | Description |
| ---- | ----------- |
| projects/rccl/test/host/transport/net_ib_cast/net-ib-cast-p2p-test.cc | Checks adaptive-routing size records and non-inline multi-receive CTS writes. |
| projects/rccl/test/host/transport/net_ib_cast/net-ib-cast-connect-test.cc | Expects one-entry inline capacity for generic and mlx5 queue pairs. |
| projects/rccl/src/transport/net_ib_cast/p2p.cc | Updates size-record writes, completion accounting, and CTS inline flags. |
| projects/rccl/src/transport/net_ib_cast/connect.cc | Reduces requested inline capacity for provider compatibility. |
| projects/rccl/src/transport/net_ib_cast/common_cast.h | Clarifies completion-record precedence in size-reporting comments. |
</details>
<sub>Review effort: Balanced</sub>
Medium
No recv test presets sizes[0] for BY_INDEX or BY_ORDER, so reverting this line (or line 1209) to sizes[0] += wc->byte_len still passes Test_RecvByIndexSingleQp and Test_RecvByIndexSplit. Could we add a BY_INDEX recv case that sets cmplsRecords[slot].sizes[0] = 1001, completes with byte_len = sizeof(int), and expects 1001? net-ib-cast-p2p-test.cc:1491 already has that shape for BY_ID.
Low
The same Adaptive Routing explanation (the trailing Write with imm carries no data, so byte_len cannot give the size) appears here and again at p2p.cc:1207, p2p.cc:1316, common_cast.h:225 and net-ib-cast-p2p-test.cc:541. Could we keep it here as one line and shorten the others?
// - nreqs > 1, or one request under Adaptive Routing (its trailing Write with imm has byte_len 0)
// Sizes are written directly to remote completion records array
<!-- argus:v1 pr=16227 sha=b844428f0c3f mode=review -->
ARGUS
Findings
<details>
<summary>1 more finding(s), not posted inline</summary>
projects/rccl/src/transport/net_ib_cast/p2p.cc:261 (Low) No test covers the !comm->useCtsOffload term in arSizeInRecord. The only CTS-offload isend test has ar=0, so deleting the term still passes. Add an AR + useCtsOffload case asserting the trailer keeps num_sge == 0.</details>
Impact
<details>
<summary>Reaches gfx942, gfx950, gfx1250; the PR targets gfx950; 4 test(s) to run, 6 heatmap cell(s) to measure</summary>
Host-side net_ib_cast transport only, so every GPU arch is reached. The adaptive-routing size record applies to single-request sends above IbCastArThreshold (8192 B) with AR on and CTS offload off. AR is on by default for InfiniBand link layers (init.cc:619), so default InfiniBand inter-node collectives and sendrecv above 8 KiB on non-AINIC NICs carry a 4-byte record on the trailer write. The receiver keeps the size in aggSize instead of sizes[0] on every matching scheme, and p2p.cc:1056 resolves both. The inline change only applies with NCCL_IB_USE_INLINE=1 on non-ionic QPs: max_inline_data drops to one ncclIbSendFifo entry and multi-receive CTS writes are no longer inlined, matching net_ib. Whether the gfx942 Mellanox nightly links are InfiniBand (AR on) or RoCE is not derivable from the checkout. Reaches gfx942, gfx950, gfx1250; the PR targets gfx950.
Tests that exercise this change
rccl-UnitTestsMPI quick_env_netib_xfer_trace, NetIbMPITest.SimpleSendRecv:NetIbMPITest.SendRecvMultipleSizes:NetIbMPITest.LargeTransfer:NetIbMPITest.SendRecvDifferentMemoryTypes:NetIbMPITest.SendRecvMultipleSizesFusion:NetIbMPITest.MultipleOutstandingSendRecv: single-request and multi-size sends above the 8 KiB AR threshold exercise the new size-record trailer and the aggSize receive path (projects/rccl/test/test_categories_mpi.yaml)rccl-UnitTestsMPI standard_env_netib_inline, NetIbMPITest.InlineSendBoundary: runs with NCCL_IB_USE_INLINE=1, covering the one-entry max_inline_data QP and non-inlined multi-receive CTS (projects/rccl/test/test_categories_mpi.yaml)rccl-UnitTestsMPI standard, NetIbMPITest.: full net-ib MPI suite, including multi-receive and multiple-outstanding paths that read sizes[0] and aggSize (projects/rccl/test/test_categories_mpi.yaml)test_categories_micro_transport.yaml quick, Net: matches the NetIbCast connect and p2p host microtests updated by this PR (projects/rccl/test/test_categories_micro_transport.yaml)Heatmap cells to measure, baseline against this PR, interleaved A/B
gfx942 all_reduce float/sum, 2 node(s), 16 KiB to 4 GiB: Mellanox platform not in the test plan; on an InfiniBand link AR defaults on, so every single-request net send above 8 KiB now carries the size-record trailergfx942 all_gather float/any, 2 node(s), 16 KiB to 4 GiB: same AR trailer change on a ring-style collective over the network, unmeasured platformgfx942 alltoall float/any, 2 node(s), 1 KiB to 4 GiB: multi-receive CTS is no longer inlined when NCCL_IB_USE_INLINE=1; mlx5 QP max_inline_data shrinks to one entrygfx1250 sendrecv float/any, 2 node(s), 16 KiB to 4 GiB: Broadcom path the PR fixes; confirms the size record under AR and the reduced inline QP attributegfx1250 alltoall float/any, 2 node(s), 1 KiB to 4 GiB: multi-receive CTS writes on bnxt_re with inline enabled now post without IBV_SEND_INLINEgfx950 all_reduce float/sum, 2 node(s), 16 KiB to 4 GiB: targeted arch; AINIC is unchanged with CTS offload on, and the AR record applies only with RCCL_CTS_OFFLOAD_ENABLED=0</details>
Bottom line: Worth settling before approval: the receiver size change at p2p.cc:1318 (and 1209) has no test that fails when it is reverted.
<sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-oci-rccl-pr-smoke
Builds
All 20 components built.
Failures
No failing tests in this run.
15 tests skipped.
Performance regressions
pr-16227_rccl-perf_rocm-10.1-ga vs rocm-10.1-ga_rccl-develop-perf
Readings: flat 2070.
No confirmed regressions or improvements.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-ruby64-rccl-pr-smoke
Builds
All 20 components built.
Failures
No failing tests in this run.
15 tests skipped.
Performance regressions
pr-16227_rccl-perf_rocm-10.1-ga vs rocm-10.1-ga_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.
<!-- argus:v1 pr=16227 sha=7ab8b297e5d4 mode=re-review -->
ARGUS
Impact
<details>
<summary>Reaches gfx942, gfx950, gfx1250; the PR targets gfx950; 4 test(s) to run, 6 heatmap cell(s) to measure</summary>
Host-side net_ib_cast transport only, so every GPU arch is reached; net_ib_cast is the default net only on AINIC hosts and otherwise needs NCCL_NET=IB-CAST. Single-request sends above 8 KiB with adaptive routing on and CTS offload off (InfiniBand link layer by default, or AINIC with RCCL_CTS_OFFLOAD_ENABLED=0 and NCCL_IB_ADAPTIVE_ROUTING=1) now write a 4-byte size record. The receiver reports a real size, which switches the proxy GDR flush back on for SIMPLE inter-node steps that skipped it before. With NCCL_IB_USE_INLINE=1 on non-ionic NICs (mlx5, bnxt_re), QPs ask for one CTS entry of inline data and multi-receive CTS writes (NCCL_NET_SHARED_COMMS grouping) are no longer inlined. Reaches gfx942, gfx950, gfx1250; the PR targets gfx950.
Tests that exercise this change
rccl-UnitTestsMPI quick_env_netib_xfer_trace, NetIbMPITest.SimpleSendRecv:NetIbMPITest.SendRecvMultipleSizes:NetIbMPITest.LargeTransfer:NetIbMPITest.SendRecvDifferentMemoryTypes:NetIbMPITest.SendRecvMultipleSizesFusion:NetIbMPITest.MultipleOutstandingSendRecv: single-request sends above the 8 KiB AR threshold exercise the size-record trailer and the aggSize/sizes[0] receive path (projects/rccl/test/test_categories_mpi.yaml)rccl-UnitTestsMPI standard_env_netib_inline, NetIbMPITest.InlineSendBoundary: runs with NCCL_IB_USE_INLINE=1, covering the one-entry max_inline_data QP and the non-inlined multi-receive CTS (projects/rccl/test/test_categories_mpi.yaml)rccl-UnitTestsMPI quick, NetIbMPITest.: full net-ib plugin suite, including multi-receive paths whose size record now uses the remote device's rkey (projects/rccl/test/test_categories_mpi.yaml)test_categories_micro_transport.yaml quick, Net: matches the NetIbCast connect and p2p host microtests updated by this PR (projects/rccl/test/test_categories_micro_transport.yaml)Heatmap cells to measure, baseline against this PR, interleaved A/B
gfx942 all_reduce float/sum, 2 node(s), 16 KiB to 4 GiB: with NCCL_NET=IB-CAST on an InfiniBand link AR is on, so SIMPLE recv steps over 8 KiB now report a size and run the GDR flush they skipped beforegfx942 all_gather float, 2 node(s), 16 KiB to 4 GiB: same flush switched back on, ring-style network collectivegfx942 alltoall float, 2 node(s), 1 KiB to 4 GiB: with NCCL_IB_USE_INLINE=1, mlx5 QP max_inline_data shrinks to one entry and multi-receive CTS is no longer inlinedgfx950 all_reduce float/sum, 2 node(s), 16 KiB to 4 GiB: targeted arch; AINIC with CTS offload off and AR forced now writes the size record, and the GDR flush runs per stepgfx1250 sendrecv float, 2 node(s), 16 KiB to 4 GiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): Broadcom path the PR fixes; size record under AR and the reduced inline QP attribute, not on the measured perf setgfx1250 alltoall float, 2 node(s), 1 KiB to 4 GiB on mi4xx-rccl-scaleup-nightly-dpx (8 GPUs/node), mi4xx-rccl-scaleup-nightly-spx (4 GPUs/node): with inline enabled, multi-receive CTS writes on bnxt_re now post without IBV_SEND_INLINE</details>
Bottom line: LGTM.
<sub>Comment <code>@argus review</code> to re-run, or <code>@argus re-review</code> after pushing.</sub>
Resolved by 7ab8b297e5.
Resolved by 7ab8b297e5.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-oci-rccl-pr-smoke
Builds
All 15 components built.
Failures
No failing tests in this run.
12 tests skipped.
Performance regressions
pr-16227_rccl-perf_rocm-10.2-latest vs rocm-10.2-latest_rccl-develop-perf
Readings: improved 12, flat 2058.
| Verdict | Metric | Cell | Why | Baseline | Variant | Change |
| :------- | :----- | :----------------------------------------------------------------------------------------------- | :------------- | --------: | --------: | -----: |
| improved | busbw | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall placement=ip | readings-agree | 0.15 GB/s | 0.17 GB/s | +13.3% |
| improved | busbw | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall placement=oop | readings-agree | 0.15 GB/s | 0.17 GB/s | +13.3% |
| improved | busbw | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall placement=ip | readings-agree | 0.29 GB/s | 0.32 GB/s | +10.3% |
| improved | busbw | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall placement=oop | readings-agree | 0.29 GB/s | 0.32 GB/s | +10.3% |
| improved | algbw | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall placement=oop | readings-agree | 0.33 GB/s | 0.36 GB/s | +9.1% |
| improved | time | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall placement=oop | readings-agree | 6.13 us | 5.64 us | +8.7% |
| improved | time | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall placement=ip | readings-agree | 5.8 us | 5.37 us | +8.0% |
| improved | time | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall placement=ip | readings-agree | 6.1 us | 5.65 us | +8.0% |
| improved | time | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall placement=oop | readings-agree | 5.78 us | 5.38 us | +7.4% |
| improved | algbw | alltoall_perf nodes=1 datatype=float size_bytes=2048 vector_count_pattern=alltoall placement=ip | readings-agree | 0.34 GB/s | 0.36 GB/s | +5.9% |
| improved | algbw | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall placement=ip | readings-agree | 0.18 GB/s | 0.19 GB/s | +5.6% |
| improved | algbw | alltoall_perf nodes=1 datatype=float size_bytes=1024 vector_count_pattern=alltoall placement=oop | readings-agree | 0.18 GB/s | 0.19 GB/s | +5.6% |
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-ruby64-rccl-pr-smoke
Builds
All 15 components built.
Failures
No failing tests in this run.
12 tests skipped.
Performance regressions
pr-16227_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.
LGTM. Please get someone from @ddurnov's team to also review.
LGTM. Please get someone from @ddurnov's team to also review.
yes I've asked @alexander-sannikov to take a look
@Kapil-Shyam-Pawar what is a purpose of this changes? All the rest looks fine, but could you please provide a rationale for this changes in completion handling.
Under adaptive routing, the receiver only got an empty completion (byte_len 0), so it reported size 0 and the NetIbMPITest.SendRecvMultipleSizes / LargeTransfer tests failed.
This fix has the sender write the real size into the completion record, and the receiver uses that record instead of byte_len (otherwise it reports the wrong size)
My point is that this change alters logic for non AR path as well.
it does touch the non ar path, but the reported size is unchanged there because no size record is written, so byte_len is still summed, just in aggSize instead of sizes[0]
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-oci-rccl-pr-build
Builds
All 30 components built.
Failures
No failing tests in this run.
183 tests skipped.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-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-16227_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.
Approved these changes.
Approved these changes.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-oci-rccl-pr-build
Builds
All 30 components built.
Failures
No failing tests in this run.
183 tests skipped.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-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-16227_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 10%, each confirmed by an adjacent size.
No confirmed regressions or improvements.
<!-- markdownlint-disable MD013 -->
pr-rocm-systems-16227-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-16227_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
Kapil-Shyam-Pawar
Motivation
Since #10975 made the NetIbMPI tests actually load net-ib-cast, three nightly tests fail: SendRecvMultipleSizes, LargeTransfer, and InlineSendBoundary
Technical Details
Issue Tracking
JIRA ID: AICOMRCCL-3697
Test Plan
Test Result
All three tests pass on Broadcom, along with the other ib-cast MPI tests and all 16 ib-cast host test binaries.
Three host tests were updated for the new behavior.
On AINIC, the adaptive-routing tests fail without the fix and pass with it
Submission Checklist