Case file: PR #725 — helios: rotate RoCE proxy peer send order by rank to avoid synchronized incast
https://github.com/NVIDIA/hyperflare-inference/pull/725 · branch perf/roce-rotate-peer-order → main · head 8b06cda · opened 2026-12-04 14:02 · +11 / −14 in 1 file
Key findings
- The change is exactly what the description says, and only that. Verified at the head: four peer loops replaced by a rank-rotated
steploop —helios/native/roce_proxy.c:1298(post_op),:1437(post_pipe_chunk),:1556(post_credits),:1939(run_varlen_op).pr_filesconfirms 1 file, +11/−14.ROCE_ABI_VERSIONstays14(roce_proxy.c:160);RING_WINDOW 16(:223) andROCE_RESERVE_OPS 48(:157) are untouched. - The problem is real in the code. At the pre-#725 base all four loops iterate peers in ascending rank order identically on every rank (un-rotated
for (int p = 0; ...)visible atpr/723head, e.g.pr/723:1296,:1437), so allworld-1ranks do converge on the same receiver each pass. The permutation claim also holds arithmetically: for fixedstep,r -> (r+step) mod worldis a cyclic shift, hence a bijection, and each rank visits everyp != rankexactly once. - Claims without evidence: no benchmark, no happens-before analysis. The PR is titled and framed as a congestion fix ("avoid synchronized incast") yet supplies only a Rust unit-test count and a byte-identity check; it explicitly states "Live switched-mesh multi-node benchmarking has not yet been run on this change." This sits against the charter's "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)" and againstdocs/design-review.md:252-259(multi-GPU collective execution mandatory for reordering cross-rank transport paths). Every sibling RoCE PR (#577 −6.2%..−9.7%, #649 +3.76%..+4.32%, #666 +11.0%, #712 −4.64%) carries a hardware A/B table; #725 carries none. - The quoted test result does not exercise the change. The
cargo test ... --features roce --lib execution::rocecommand (35 passed) was added to CI by merged #707 (.github/workflows/native-serving.yml:114-115(not opened)) and is a compile/unit smoke — none of the four rotated loops are reachable without live verbs. - Provenance is undocumented inside the PR. The incast ask traces directly to a FujitsuPolycom review comment on open PR #712 (2026-12-04 01:26), ~12 hours before #725 opened, but #725 cites no issue, no PR, and no prior measurement.
- Merge conflict ahead: #712 rewrites the same four functions (same author, still open). Whichever merges second must be rebased.
- It cannot go green as-is:
pyproject.toml:47still pins flashinfer rev1441ce86…, sotests/preparation/test_roce_proxy_parity.py:35-65(run viapython-cpu.yml) fails until upstream local-inference-lab/flashinfer#221 merges and the pin is bumped. The author states this limitation. - Reading caution for downstream tools:
pr_diffagainst a stale localmainshows ~+277/−40 lines withKIND_RING_RS/AG/RSAG,RING_WINDOW 16,roce_create_with_gids,ROCE_RESERVE_OPS— that is not undeclared work. Those are the lands of merged #707 (2026-12-03); a sibling branch cut after #707 (pr/723:157,194,223,677,756) already contains them and still has the un-rotated loops. The real delta is the four loops.
1. The change
What it does, plainly. Each rank's proxy thread posts RDMA writes to its peers. Before, every rank walked the peer list 0, 1, …, world-1 in the same order, so all ranks addressed the same receiver at the same moment. After, rank r starts at r+1 and wraps: rank 0 posts to 1, 2, 3…; rank 1 posts to 2, 3, …, 0; and so on. At any given step the set of (sender → receiver) pairs is a permutation, so no receiver is targeted by everyone at once.
Size and shape. One file, +11/−14. The four edits are mechanical:
| Function | Site at head | Preserved filter |
|---|---|---|
post_op |
roce_proxy.c:1298-1299 |
two-pass relayed-first: passes/want_relayed at :1293-1295, ring_relayed(c,p) != want_relayed at :1300 |
post_pipe_chunk |
:1437-1438 |
phase == 1 && c->relay && c->relay_via[p] >= 0 at :1439 |
post_credits |
:1556-1557 |
ring_relayed(c,p) relay branch at :1558-1562 |
run_varlen_op |
:1939-1940 |
none (lane posted % n_lane at :1948) |
What the description does not say. Only a two-line explanatory comment is added, and only at post_op (:1296-1297); the other three sites get no comment, so the rationale is documented once. Nothing material is missing from the change relative to the description, and the description does not promise anything the diff fails to do.
What the rotation does not change (verified in code). Which shard goes to which peer (shard = phase == 0 ? p : c->rank, :1442), which lane is used (chunk % n_lane, posted % n_lane at :1948), what offsets/flags are written (:1290-1292), and no protocol word depends on visit order: credits_arrived scans all peers, post_striped writes per (peer, lane), pipe_done counts every lane. Consumers are order-independent, which is why a mixed fleet (some ranks rotated, some not) stays wire-compatible and no roce_connect negotiation was added.
2. The why
- Direct trigger: a review comment by FujitsuPolycom on open PR #712 dated 2026-12-04 01:26 (from MoE DeepSeek-V4.1-Flash TP4 prefill/burst hairpin RQ-overflow testing) lists under "Potential fixes to explore": "Stagger or chunk diagonal vs neighbor sends in
roce_proxy.cto avoid 2:1 (400 → 200 Gb/s) egress incast during multi-MB prefills." #725 opened at 14:02 the same day, by #712's author, implementing exactly a staggered send order. - Earlier related work on the same symptom: merged #666 (original-el8, 2026-12-01,
roce_fabricdual-rail port spread) states its result as "2x egress wire capacity under multi-rank incast" — the same incast attacked at the rail-routing layer rather than the send-order layer. - No issue tracks this. Searching items for "incast RoCE switched mesh switch egress" returns only #725 and #666; the PR links no bug report, so there is no externally recorded history of how long or how widely it has been wanted beyond ~1 day of discussion inside #712.
3. Related work
- #712 — open, same author, direct code conflict. It rewrites the same four functions with two-pass hairpin pacing: at
pr/712post_op:1443-1472still has the un-rotatedfor (int p = 0; ...)at:1458,post_pipe_chunk:1596-1628gainsint passes = c->hairpin_pacing ? 2 : 1; int want_paced = ...withpost_striped_paced,post_credits:1725, andrun_varlen_op:2113-2128similarly. #712 touchesroce_proxy.cat +222/−38 vs #725's +11/−14. #712 was rebased onto main past #707 at 2026-12-04 13:24, and #725 opened 38 minutes later, so #725 is likely stacked on that rebase. Second-to-merge must rebase. #712's pacing comment also ties its in-flight cap toROCE_RESERVE_OPS— the same send-queue headroom #725's rotation depends on. - #707 — merged 2026-12-03 (lukealonso), the base. Landed
KIND_RING_RS/AG/RSAG 7/8/9,RING_WINDOW 16, 1176-byteroce_blob_t,ROCE_RESERVE_OPS 48 < ROCE_RELAY_OPS 64, per-HCA GIDs, the parity test, and theexecution::roceCI step. #725 builds on it, does not reverse any of it, and leaves its defines untouched. - #577 (open, fordbmorris), #649 (open, FujitsuPolycom), #672 (open, nepenth) all touch
helios/native/roce_proxy.c; #707's description says it "consolidates and credits work from #672, #649, #577" and its review noted #707 "supersedes all three and closes none" — so those three remain open and overlapping with any further edits to this file. - Merged history in the same file: #643 (sync to FlashInfer 2a07747b8), #279/#251 (ABI 11 → 14 pinning), #325, #232, #280.
- Nothing supersedes or undoes #725; it supersedes nothing.
4. Recent activity
- 2026-12-01: #666 merged (original-el8) — rail spread vs incast.
- 2026-12-03: #707 merged (lukealonso) — ABI-14 RoCE sync, per-HCA GIDs, CI parity; re-pinned
pyproject.toml:47. - 2026-12-04 13:24: #712 rebased/updated past #707, with one blocker outstanding.
- 2026-12-04 14:02: #725 opened.
So #725 sits one day on top of #707 and inherits its layout; it is a peer of #666 in intent and a successor to #712's review ask.
search_historyis broken on this checkout (fatal: cannot simplify commit ef38cb93…), so this timeline is reconstructed fromitems_touchingand item descriptions rather than commit logs.
5. People
- Author: original-el8, COLLABORATOR, one of three named priority contributors in the charter ("Priority contributors (@voipmonitor, @original-el8, @lukealonso) carry extra weight—we never close their PRs out of hand as 'low value'"). 25 merged / 29 closed / 11 open in 180 days; merged areas concentrated in
docs(15),helios/src(14),helios(5). In this subsystem their main landing is #666; #712 is their current open work here. - They also wrote the RoCE review policy this PR follows. In #577's discussion (2026-11-28 22:12, CHANGES_REQUESTED) original-el8 set three rules: (1) do not bump
ROCE_ABI_VERSIONto guard wire changes — ABI is the kernel↔proxy contract embedded in exported cores, validate in the rank↔rank blob handshake instead; (2) keep the vendored proxy identical to pinned FlashInfer and go upstream via a FlashInfer PR rather than forking ahead; (3) run--features roce,runtime-core,serverplus live multi-GPU served validation. #725 complies with (1) and (2) but its evidence falls short of (3). - Who usually works here: lukealonso (#707, #643 — both re-vendorings), jetnet (#279), iein (#325), plus open contributors fordbmorris (#577), FujitsuPolycom (#649), nepenth (#672).
- Engagement on #725: none yet.
6. Community
No comments, no reviews, no inline comments, no reactions, no labels (pr_comments → "No comments"; discussion count 0). For contrast in the same subsystem: #577 drew 8 discussion entries including 3 Autobot reviews and a formal CHANGES_REQUESTED; #649 drew 3 Autobot reviews; #712 drew 8 including twice-weekly Autobot reviews and two substantial independent hardware test reports from FujitsuPolycom. #725's silence reflects its age (hours), not disinterest. It carries a Discord: el8 line, the same convention as #577 (woooflet) and #649 (Dooner), i.e. there is an off-GitHub channel.
7. Project fit (charter, roadmap, docs)
Aligns
- "Keep the runtime small and model-agnostic" / "Solve the right problem in the right place" — smallest possible footprint: zero new API, zero new flag, zero new config, no per-model branch, and send-order congestion control is arguably the right layer.
- "Be explicit and pin everything (#215)" — the vendoring policy is honoured via upstream FlashInfer #221, and ABI 14 is preserved so no exported core needs re-export.
Tension
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)." No benchmark exists. docs/design-review.md:252-259: "Multi-GPU collective execution is mandatory for TP dispatch and transport changes. Replacing or reordering cross-rank launch, commit, cancellation, or drain paths inhelios/src/execution/{threaded,parallel,roce}*requires an explicit before/after cross-rank happens-before analysis and live multi-GPU execution of real collective graphs … Disclosing busy or unavailable GPUs does not waive this requirement." #725 reorders cross-rank posting in the C proxy those modules drive, and offers neither. #707's reviewers were held to this gate.docs/design-review.md:247-251: "Disclosure does not excuse skipping runnable CPU checks … noting it as a limitation does not make the omission acceptable" — relevant to the knowingly red parity test.- Roadmap item #215 "FlashInfer dependency fix — keep builds strictly pinned" is touched by the dependency on un-merged flashinfer#221.
- Not a non-goal: cross-node serving is an explicit goal.
Docs: docs/roce-ring.md contains no mention of incast, egress, or send order and is not modified here (#707 and #712 both edited it; #725 does not).
8. Claims and evidence
| Claim | Backing | Assessment |
|---|---|---|
Loops iterate 0..world-1 on every rank, so incast is synchronized |
verified in base code (pr/723:1296,1437,1555,1940) |
Holds |
| The rotation is a 1:1 permutation per step | verified arithmetically (cyclic shift mod world; each rank visits every p != rank once) |
Holds for posting moment |
"Eliminating synchronized (world-1):1 incast" |
no measurement | Stronger than the code proves — arrival at a receiver still depends on QP servicing, rails (n_rail), lanes, and per-(HCA,peer,lane) reservation caps (ROCE_RESERVE_OPS 48, :157); ordering posts does not guarantee de-synchronized arrival |
cargo test … execution::roce: 35 passed |
command exists at .github/workflows/native-serving.yml:114-115 (not opened) (added by #707, which reports the same 35) |
Plausible but not probative — the suite needs live verbs to reach these loops |
Byte-for-byte identity to flashinfer#221, -Wall -Wextra clean, test_roce_proxy.py (not opened) 24 passed |
required by tests/preparation/test_roce_proxy_parity.py:35-65 |
Unverifiable from this checkout — only the pin at pyproject.toml:47 (rev 1441ce86…) is visible; upstream state cannot be inspected |
No ABI/runtime cost, ROCE_ABI_VERSION stays 14, existing cores load |
verified roce_proxy.c:160 unchanged |
Holds |
| Live switched-mesh multi-node benchmarking not run | stated by author | Self-disclosed gap |
pyproject.toml pin bump needed for the parity test |
stated by author; consistent with pyproject.toml:47 and the test |
Holds |
Also missing: any happens-before analysis for the reordered cross-rank post path (see §7).
9. Reach
- Wire/protocol: none. ABI 14,
roce_blob_t, region layout, op kinds and flags unchanged. Rotation is a local posting-order policy, not negotiated, so mixed binaries remain compatible and no handshake check was added. - Who is affected: every job using the RoCE transport. Mesh (
world >= 4, the stated target), ring/chain (c->ring != NULL) and all-gather relay (c->relay_via) are all touched: the relayed-first two-pass structure is preserved, but within each pass the order is now rotated, so ring forward-hop order changes too. The problem statement discusses only switched mesh and does not mention ring/chain effects. - Configuration/defaults: none. No flag, no env var, no default change — contrast #712, which changes defaults and drew a "No magic defaults" objection.
- Operators/deployment: no host-side dependency, no tc/route/QoS requirement, no core re-export, no startup-memory change.
- Tests/CI: parity test goes red until
pyproject.toml:47is re-pinned to merged flashinfer#221;execution::roceunit tests reported passing but do not exercise the four loops. - Documentation: none added.
10. Process
- Open, ready for review (not draft), opened and last updated 2026-12-04 14:02, hours old at packet time. Base
main, head8b06cda, no labels, no reviews, no comments. - CI on head: pending — no result to cite either way.
- Description follows the repo's required four-part shape (why / what / result+evidence / limitations) and discloses both limitations honestly.
- Whether a
Design-Signed-Off-Bytrailer exists could not be verified (search_historybroken on this checkout) — treat as unverified, not missing. - Upstream dependency local-inference-lab/flashinfer#221 (the companion parity PR, claimed byte-identical for
roce_proxy.clines 10..EOF) cannot be inspected from this repo.
Open questions / could not be found
- Does the rotation actually reduce measured incast? No numbers anywhere; nothing before/after for the mesh, the ring, or a served workload.
- Do posts stay ordered once issued? Whether posting order survives QP servicing, rails, lanes and
ROCE_RESERVE_OPSheadroom is unanalyzed — andpost_creditsrotates a control-plane 4-byte inline credit write, where rotation is unlikely to matter for bandwidth. - Did #707's
drain_allreordering or the ring window raise (16) change the posting cadence that #725 assumes? Not addressed. - Which PR merges first, #725 or #712, and in what settled form do the four loop bodies end up?
- Is flashinfer#221's body in fact byte-identical, and when will
pyproject.toml:47be bumped sopython-cpu.ymlgoes green? - Is there a
Design-Signed-Off-Bytrailer on8b06cda? Unverifiable here. - Is there off-GitHub discussion (Discord
el8) that shaped this and is not captured on the PR? Not visible.
Note for downstream readers on tooling
pr_diff/head-vs-main comparisons on this checkout are distorted by a stale local main ref predating merged #707, producing a phantom ~+277/−40 diff with KIND_RING_RS/AG/RSAG, RING_WINDOW 16, roce_create_with_gids, ROCE_RESERVE_OPS/ROCE_RELAY_OPS, pipe_op_release, docs/api.md (not opened)/AGENTS.md (not opened)/CI hunks. Proof it is an artifact: a sibling branch cut after #707 (pr/723) already contains all of it (pr/723:157,194,223,677,756) and still has the un-rotated loops (pr/723:1296, :1437) that #725 replaces. Do not report those lines as undeclared work in #725.