PR #643: perf(helios): add 2-step RoCE ring proxy opcodes for 4-rank switchless rings

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/fbc636ed-7547-42b5-ab49-4f769f12fe7f

Opened by a workflow run, Nov 30, 2026 12:56 PM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: lukealonso (COLLABORATOR, listed priority contributor and project owner; Discord: lukealonso) Motivation: On 4-rank switchless RoCE rings every rank has one 2-hop peer, so small allreduce messages are relayed through another rank's CPU proxy mailbox. This PR adds two control opcodes that let the proxy write each payload half straight to the two 1-hop neighbours instead, so a 2-step ring kernel can avoid relay hops for small messages. Scale: +311 / −26 lines in 1 file (helios/native/roce_proxy.c) Proposal:

Full report · Notes

Classify intake

Selected: triage:review, performance, enhancement, area:rocenante

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +performance, +enhancement, +area:rocenante

Value Proposition

Value Proposition — PR #643: perf(helios): add 2-step RoCE ring proxy opcodes for 4-rank switchless rings

1. Charter alignment — right layer, wrong procedure. The change lives entirely in the RDMA transport proxy, adds no per-model branches, targets DGX Spark/SM121, and cross-node serving is an explicit Goal — so it is not a non-goal and not the wrong layer. But it edits helios/native/roce_proxy.c in-tree, while roce_proxy.c:6-8, roce_proxy_dlopen.c:7-9, docs/roce-ring.md:361-364 and NOTICE:16-19 require that file to stay identical to the pinned FlashInfer dependency — the rule the author himself established in #589. The PR cites only flashinfer#192, described as a kernel PR; no upstream proxy revision is named. It also carries undeclared, all-transport behaviour changes: the #576 CPU-pinning hunk, IBV_SEND_INLINE on existing one-shot/relay WRs, max_inline_data 16→256 for every QP, relayed-first post_op ordering, and a rewritten idle loop — scope expansion beyond the stated opcodes.

2. Novelty & status — genuinely additive. Nothing on main implements kinds 5/6, so it is not obsolete. Neither open PR subsumes it: #576 owns only the copied pinning hunk; #577 owns the reserve()/ROCE_SEND_DEPTH/drain path this PR refactors. Both collide, so merge order is the live risk, but the ring2 protocol is unique.

3. Value vs maintenance cost — real problem, unmet evidence bar. The relay cost is traceable in-repo (roce_proxy.c:196-198; at world=4 one third of a one-shot allreduce's writes take a CPU mailbox hop), and #325 shows this path recurs. Yet the charter (#210) requires a measured speedup over main on a served workload: the PR offers only an absolute 31.8–33.0 µs/call with no baseline, no delta, no throughput. The cited cargo test runs never compile the edited C (it builds only under roce), and PR CI does not build it either. The new wire protocol ships with no negotiation or fallback — a mixed cluster hits "unknown op kind 5" and poisons the transport, where #577 uses a blob field checked at connect. Docs are untouched, and demand originates outside this repo (flashinfer#192, an unnumbered recipes PR), unverifiable here.

Verdict: Worth it with changes. The author is a charter-named priority contributor and the problem is in scope, so this must not be dismissed as low value. Mergeable requires: dropping the undeclared pinning hunk (defer to #576) and coordinating with #577; re-vendoring from a cited upstream FlashInfer revision or explicit maintainer sign-off on in-tree divergence; a before/after benchmark against main on a served workload with --features roce; mixed-version negotiation or a documented hard requirement plus spelled-out world==4 / 32-byte-alignment failures; and a docs/roce-ring.md update covering kinds 5/6.

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Subtraction and simplicity

Reviewed helios/native/roce_proxy.c at PR #643 head for subtraction, duplication and repo conventions. The diff is not lean: about half of its +311 lines are removable without losing ring2 functionality.

  1. (high) Delete ~70 lines that belong to open PR #576: pin_high_capacity_cpus() (roce_proxy.c:1702-1767) plus pthread_setname_np(... "flare-roce") and its call (:1771-1774). Undeclared, unrelated to ring2, and #include <sched.h (not opened)> (:124) becomes unused.
  2. (high) post_direct_striped_batched (:1259-1330) duplicates post_striped (:1139-1205) line for line, differing only in the reserve limit, wr_id, signaled flag, outstanding accounting and error tag. Add limit/batch_signal params to post_striped and delete :1259-1330.
  3. (medium) Revert the relayed-first two-pass post_op loop (:1238-1252) — undeclared, unmeasured, changes every ring deployment's one-shot path.
  4. (medium) The ring2_active idle gate (:1796-1805) is unnecessary: ring_service already skips origins we don't forward for (:1042), and the three copies of the failed-store block collapse to one.
  5. (medium) Scope IBV_SEND_INLINE to the new path: delete :914-916, :923-925 and :1187-1189 and keep max_inline_data at 16 for existing traffic (:497-502's 256→16 ladder goes with it).
  6. (high, convention) New wire opcodes KIND 5/6 (:173-174) added in-tree break the "keep the source identical" rule at roce_proxy.c:6-8, docs/roce-ring.md:360-364 and NOTICE:16-19; the fix is a re-vendor from an upstream proxy PR, not a code tweak.

Already lean and not to be touched: the reserve_limit/reserve split (:832-856), drain_cqs/drain_all (:1207-1221), ring_next_from/ring_next (:337-345), the two _Static_asserts (:175-187), no new flags/env knobs, no dead code, and post_ring2_step's validation (:1336-1348).

Open: no upstream FlashInfer revision is cited for any of the new protocol surface; no baseline separates the S3/S5 ordering and inline changes from the ring2 win; whether relay servicing every spin is a correctness requirement.

Full report · Notes

Correctness and contracts

PR #643 (helios/native/roce_proxy.c, +311/−26, head 9c3ea69) adds wire kinds 5/6 for a 4-rank two-step ring, but it also changes pre-existing hot paths and its new WR budget is arithmetically wrong.

Findings that matter most:

Open: which upstream FlashInfer revision defines kinds 5/6; the main-path baseline number; whether the branch carries a current design-review digest.

Full report · Notes

Final review

Recommendation: Changes Requested

The core 2-step neighbor-only ring allreduce mechanics in helios/native/roce_proxy.c — the (even ^ step) neighbor/half permutation (:1350-1367), batched completion signaling (:1277, 1321-1325), world == 4 send-queue WR budget (<= 374/512 exact), send[slot] reuse ordering, and ring_relays_origin filtering (:735-751, 1042) — are technically sound. However, two blockers prevent merging as written: the PR edits the vendored roce_proxy.c without citing a merged upstream FlashInfer revision, and it omits both --features roce unit-test execution and a before/after served-workload benchmark against main. In addition, the diff carries four undeclared behavioral changes affecting all ring/mesh traffic, leaves ROCE_ABI_VERSION at 14 with no mixed-cluster or old-runtime preflight for op kinds 5/6, and leaves docs/roce-ring.md unchanged.

Merge Risk

Level: High

Walkthrough

Pre-merge Checks

Blockers

  1. Vendored roce_proxy.c diverges ahead of a cited, merged upstream FlashInfer commit (helios/native/roce_proxy.c:6-8, helios/native/roce_proxy_dlopen.c:7-9, docs/roce-ring.md:360-364).

    • Verified behavior/impact: helios/native/roce_proxy.c:6-8 and docs/roce-ring.md:360-364 require the vendored serving proxy to remain byte-for-byte identical to FlashInfer's flashinfer/experimental/b12x/comm/roce/_roce_proxy.c (not opened) (the same contract enforced as a merge blocker on #576 and #577, and reinforced by #589). This PR adds +311/−26 lines in-tree and cites local-inference-lab/flashinfer#192 only as a companion kernel PR without confirming that the proxy changes are merged on FlashInfer main or naming the upstream commit SHA. Because pyproject.toml:47 tracks FlashInfer main, merging ahead of upstream splits preparation and serving.
    • Fix: Merge the proxy changes into local-inference-lab/flashinfer main first (e.g., via flashinfer#192), then re-vendor _roce_proxy.c (not opened) verbatim and cite the exact merged FlashInfer commit SHA in the PR description (as done in #251, #279, and #576).
  2. Missing --features roce unit-test verification and before/after served-workload benchmark (helios/Cargo.toml:27, helios/build.rs:67-77, docs/roce-ring.md:381-384, docs/design-review.md:109-115, 180-186).

    • Verified behavior/impact: The PR reports cargo test --locked --release on helios with --features runtime-core,server, which omits roce so execution::roce::tests (helios/src/execution/roce.rs:365-524) never executed (and PR CI's rdma job at .github/workflows/native-serving.yml:113 (not opened) only runs cargo check, not cargo test). In addition, the only measured performance result is an absolute 31.8–33.0 µs/call for RoceRing2AllReduceLaunch with no main/oneshot comparator and no served-workload throughput delta, failing Charter #210 ("benchmarks showing an actual speedup over main on a served workload") and docs/design-review.md:109-115.
    • Fix: Run and report cargo test --locked --release --manifest-path helios/Cargo.toml --features roce,runtime-core,server (including execution::roce::tests), and add a before/after comparison against main on the same 4× DGX Spark flare run workload (both collective latency vs main's oneshot path and end-to-end served tok/s).

Should Fix

  1. Declare all synced non-ring2 behavioral changes, coordinate #576, and address their system-level regressions upstream (helios/native/roce_proxy.c:497-515, 914-925, 1187-1189, 1238-1252, 1702-1774, 1794-1814).

    • Verified behavior/impact: Four behavior changes affecting existing ring and mesh deployments are present in the diff without being declared in the PR description (docs/design-review.md Principle 16):
      • CPU pinning (:1702-1774): verbatim pin_high_capacity_cpus() + "flare-roce" already merged in local-inference-lab/flashinfer#156 (335459b2) and owned by open PR #576 (which also pins Helios's Rust worker threads). If syncing FlashInfer main, keep it for byte-identity, declare it explicitly, and coordinate rebase/scope with #576.
      • max_inline_data 16→256 and IBV_SEND_INLINE on existing paths (:497-515, 914-925, 1187-1189): applies to all n_lane = 4 lanes and all transports including mesh (c->ring == NULL), with no isolated measurement.
      • Relayed-first two-pass post_op (:1238-1252): on ring deployments with large one-shot payloads (> RING_WINDOW * RING_CHUNK_BYTES * n_rail = > 1 MiB on 2 rails), blocking inside ring_post waiting for mailbox ACKs (:1107-1116) now delays issuing direct-neighbor RDMA writes on separate physical cables (whereas on main, rank-order posting issued at least one direct neighbor before the relayed peer on ranks 0, 1, and 3).
      • Idle-loop every-spin ring_service (:1794-1814): for all non-ring2 ring traffic, calling ring_service(c) on every idle spin (16 acquire loads/spin at world = 4, up to 224 at world = 16) instead of every 64th spin multiplies per-spin work against the fixed ROCE_IDLE_SPINS = 20_000_000 iteration threshold (:194), stretching wall-clock hot-spinning on a pinned P-core before nanosleep whenever a ring group goes idle.
    • Fix: Clean up or separately benchmark the non-ring2 changes (post_op ordering, idle-loop spin frequency, existing-path inline sizing) in upstream flashinfer#192 before re-vendoring, and document every change carried by the synced upstream revision in the PR description.
  2. Add an ABI bump or startup capability guard for op kinds 5/6 (helios/native/roce_proxy.c:141, 173-174, 1841-1844, 1860-1862, helios/src/execution/roce.rs:23, 82-99, 125-136).

    • Verified behavior/impact: ROCE_ABI_VERSION remains 14 and roce_blob_t is unchanged. When #251 previously added new op kinds (KIND_REDUCE_SCATTER = 3, KIND_GATHER_SHARDS = 4) with an unchanged region layout, FlashInfer and Flare bumped ROCE_ABI_VERSION (10 → 11) while widening RoceTransport::open (roce.rs:131) to still accept older core ABIs (9 | 10 | 11 | 14). Keeping ABI 14 here means an older ABI-14 runtime loading a ring2-enabled core—or a mixed-version cluster—passes RoceTransport::open and peer_blobs (roce.rs:89) and fails only at replay op 1 with unknown op kind 5 (roce_proxy.c:1861), violating docs/roce-ring.md:368-369's preflight contract.
    • Fix: Follow the #251 pattern upstream and in helios/src/execution/roce.rs: bump ROCE_ABI_VERSION / PROXY_ABI to 15 while widening matches!(spec.proxy_abi, 9 | 10 | 11 | 14 | 15) (and updating compatible_core_abis_still_validate_the_captured_region at roce.rs:409-430) so existing cores continue loading without re-export while old runtimes and mixed clusters fail cleanly at preflight.
  3. Update docs/roce-ring.md for the new opcodes and compatibility contract (docs/roce-ring.md:11-15, 161-167, 420).

    • Verified behavior/impact: docs/roce-ring.md enumerates the supported collective operations and proxy ABI contract (:11-12, 161-167) and was updated in both #251 and #279; it currently omits the 2-step 4-rank closed-ring opcodes (5/6), their 32-byte-alignment precondition, and any ABI update.
    • Fix: Add a brief update in docs/roce-ring.md covering kinds 5/6, their world == 4 closed-ring / 32-byte-multiple preconditions, and the resulting ABI/compatibility behavior.

Subtract / Simplify

  1. Collapse post_direct_striped_batched into post_striped upstream (helios/native/roce_proxy.c:1139-1205, 1259-1330).

    • post_direct_striped_batched (72 lines) duplicates post_striped verbatim except for reserve_limit(..., RING2_MAX_OUTSTANDING), conditional IBV_SEND_SIGNALED, the ring2_unsignaled[p] counter update, and the error label. Adding (uint32_t limit, int batch_signal) (or a shared direct-stripe helper) in upstream flashinfer#192 before re-vendoring removes ~65 lines of duplicated WR construction without breaking Flare's byte-identity rule.
  2. Simplify the ring2_active idle-loop split upstream (helios/native/roce_proxy.c:1794-1814).

    • Unless per-spin ring_service on non-ring2 traffic is independently justified and benchmarked in flashinfer#192, drop the ring2_active branch and collapse the duplicated atomic_store(&c->failed, 1); return NULL; blocks (e.g., running ring_service / drain_cqs at a single cadence), removing ~10 lines and avoiding the stretched idle-spin regression on non-ring2 rings.

Nits

Dropped on verification

Full report Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes