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
- Upstream vendoring divergence and multi-PR collision:
helios/native/roce_proxy.cmust remain byte-for-byte identical to FlashInfer's_roce_proxy.c(not opened) (roce_proxy.c:6-8,roce_proxy_dlopen.c:7-9,docs/roce-ring.md:360-364). Merging ahead of a mergedlocal-inference-lab/flashinfer#192commit forks preparation (pyproject.toml:47, tracking FlashInfermain) from serving and collides directly with open PRs#576(which carries the samepin_high_capacity_cpus()hunk from mergedflashinfer#156) and#577(which modifiesreserve(),_Static_assert, andRING_WINDOW). - Undeclared changes to all existing ring and mesh transports: Beyond kinds
5/6, the diff raisesmax_inline_data16 → 256on every QP lane (:497-515), enablesIBV_SEND_INLINEon existing relay (:914-925) andpost_striped(:1187-1189) payloads, reorderspost_opto post relayed peers first (:1238-1252), and rewrites the ring idle loop (:1794-1814) to callring_service(c)on every spin when!ring2_active(stretching wall-clock busy-spin duration beforenanosleepagainst the fixedROCE_IDLE_SPINS = 20_000_000counter on a pinned P-core). - No runtime test coverage in CI and no startup preflight for new op kinds:
.github/workflows/native-serving.yml:63 (not opened),113never executesexecution::roce::tests(rdmaonly runscargo check), and keepingROCE_ABI_VERSION = 14means an older runtime or mixed-version cluster connects cleanly and poisons at replay op 1 withunknown op kind 5.
Walkthrough
helios/native/roce_proxy.c:173-187, 252, 258, 312: addsKIND_RING2_STEP1(5u),KIND_RING2_STEP2(6u),RING2_SIGNAL_STRIDE(16u),RING2_MAX_OUTSTANDING(6u), two compile-time_Static_asserts, per-HCAring2_unsignaled[]andmax_inline, andring_relays_origin[].helios/native/roce_proxy.c:337-345, 735-751, 1042: extractsring_next_from(c, from, target), precomputesring_relays_origin[]duringroce_connect, and skips non-relayed origins inring_service.helios/native/roce_proxy.c:482, 497-515, 914-925, 1187-1189: raises QPmax_inline_datarequest from16to256with fallback to16, tracks the minimum grantedhca->max_inline, and conditionally setsIBV_SEND_INLINEon relay mailbox payloads/descriptors andpost_stripeddata WRs.helios/native/roce_proxy.c:832-856, 1207-1221, 1238-1252, 1259-1370, 1841-1844: factorsreserve_limit()anddrain_cqs(), reorderspost_opinto two passes (relayed peers before direct peers on rings), and addspost_direct_striped_batched()+post_ring2_step()dispatched fromproxy_mainfor kinds5/6.helios/native/roce_proxy.c:1702-1774, 1794-1814: adds Linuxpin_high_capacity_cpus()+pthread_setname_np(..., "flare-roce")(matching mergedlocal-inference-lab/flashinfer#156/ open PR#576) and rewrites the ring idle loop to callring_serviceevery spin (or every 16th whenring2_active) anddrain_cqsevery 16th spin.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure RDMA transport work-request posting, sysfs
cpu_capacityinteger reads, and thread naming/affinity; no new network exposure, env-var switches, or untrusted input paths. - [WARN] Charter & value fit: Right layer (
roce_proxy.c, model-agnostic, targets DGX Spark/SM121, preserves ABI-14 core loading), but breaks the vendored-parity invariant (roce_proxy.c:6-8,docs/roce-ring.md:360-364), introduces undeclared non-ring2 scope, and lacks the Charter#210before/after served-workload speedup overmain. - [WARN] Related / duplicate / conflict check: Collides on
helios/native/roce_proxy.cwith open PR#576(samepin_high_capacity_cpus()hunk from mergedflashinfer#156, plus Rust worker pinning) and open PR#577(RING_WINDOW8→16,reserve()/8,_Static_assert). Also depends on unverified externallocal-inference-lab/flashinfer#192and an unnumberedhyperflare-recipesPR. - [WARN] Tests & verification evidence:
cargo check --locked --manifest-path flare-cli/Cargo.toml --tests --features roce,rdma(.github/workflows/native-serving.yml:113(not opened)) compilesroce_proxy.cviahelios/build.rs:67-77, but neither CI nor the PR's citedhelios --features runtime-core,servertest run executesexecution::roce::tests; the only performance number is an absolute31.8–33.0 µs/callmicro-trace with nomainbaseline or served tok/s delta.
Blockers
-
Vendored
roce_proxy.cdiverges 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-8anddocs/roce-ring.md:360-364require the vendored serving proxy to remain byte-for-byte identical to FlashInfer'sflashinfer/experimental/b12x/comm/roce/_roce_proxy.c(not opened) (the same contract enforced as a merge blocker on#576and#577, and reinforced by#589). This PR adds +311/−26 lines in-tree and citeslocal-inference-lab/flashinfer#192only as a companion kernel PR without confirming that the proxy changes are merged on FlashInfermainor naming the upstream commit SHA. Becausepyproject.toml:47tracks FlashInfermain, merging ahead of upstream splits preparation and serving. - Fix: Merge the proxy changes into
local-inference-lab/flashinfermainfirst (e.g., viaflashinfer#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).
- Verified behavior/impact:
-
Missing
--features roceunit-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 --releaseonhelioswith--features runtime-core,server, which omitsrocesoexecution::roce::tests(helios/src/execution/roce.rs:365-524) never executed (and PR CI'srdmajob at.github/workflows/native-serving.yml:113(not opened) only runscargo check, notcargo test). In addition, the only measured performance result is an absolute31.8–33.0 µs/callforRoceRing2AllReduceLaunchwith nomain/oneshot comparator and no served-workload throughput delta, failing Charter#210("benchmarks showing an actual speedup overmainon a served workload") anddocs/design-review.md:109-115. - Fix: Run and report
cargo test --locked --release --manifest-path helios/Cargo.toml --features roce,runtime-core,server(includingexecution::roce::tests), and add a before/after comparison againstmainon the same 4× DGX Sparkflare runworkload (both collective latency vsmain's oneshot path and end-to-end served tok/s).
- Verified behavior/impact: The PR reports
Should Fix
-
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.mdPrinciple 16):- CPU pinning (
:1702-1774): verbatimpin_high_capacity_cpus()+"flare-roce"already merged inlocal-inference-lab/flashinfer#156(335459b2) and owned by open PR#576(which also pins Helios's Rust worker threads). If syncing FlashInfermain, keep it for byte-identity, declare it explicitly, and coordinate rebase/scope with#576. max_inline_data16→256 andIBV_SEND_INLINEon existing paths (:497-515, 914-925, 1187-1189): applies to alln_lane = 4lanes 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 MiBon 2 rails), blocking insidering_postwaiting for mailbox ACKs (:1107-1116) now delays issuing direct-neighbor RDMA writes on separate physical cables (whereas onmain, 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, callingring_service(c)on every idle spin (16 acquire loads/spin atworld = 4, up to 224 atworld = 16) instead of every 64th spin multiplies per-spin work against the fixedROCE_IDLE_SPINS = 20_000_000iteration threshold (:194), stretching wall-clock hot-spinning on a pinned P-core beforenanosleepwhenever a ring group goes idle.
- CPU pinning (
- Fix: Clean up or separately benchmark the non-ring2 changes (
post_opordering, idle-loop spin frequency, existing-path inline sizing) in upstreamflashinfer#192before re-vendoring, and document every change carried by the synced upstream revision in the PR description.
- Verified behavior/impact: Four behavior changes affecting existing ring and mesh deployments are present in the diff without being declared in the PR description (
-
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_VERSIONremains14androce_blob_tis unchanged. When#251previously added new op kinds (KIND_REDUCE_SCATTER = 3,KIND_GATHER_SHARDS = 4) with an unchanged region layout, FlashInfer and Flare bumpedROCE_ABI_VERSION(10 → 11) while wideningRoceTransport::open(roce.rs:131) to still accept older core ABIs (9 | 10 | 11 | 14). Keeping ABI14here means an older ABI-14 runtime loading a ring2-enabled core—or a mixed-version cluster—passesRoceTransport::openandpeer_blobs(roce.rs:89) and fails only at replay op 1 withunknown op kind 5(roce_proxy.c:1861), violatingdocs/roce-ring.md:368-369's preflight contract. - Fix: Follow the
#251pattern upstream and inhelios/src/execution/roce.rs: bumpROCE_ABI_VERSION/PROXY_ABIto15while wideningmatches!(spec.proxy_abi, 9 | 10 | 11 | 14 | 15)(and updatingcompatible_core_abis_still_validate_the_captured_regionatroce.rs:409-430) so existing cores continue loading without re-export while old runtimes and mixed clusters fail cleanly at preflight.
- Verified behavior/impact:
-
Update
docs/roce-ring.mdfor the new opcodes and compatibility contract (docs/roce-ring.md:11-15, 161-167, 420).- Verified behavior/impact:
docs/roce-ring.mdenumerates the supported collective operations and proxy ABI contract (:11-12, 161-167) and was updated in both#251and#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.mdcovering kinds5/6, theirworld == 4closed-ring / 32-byte-multiple preconditions, and the resulting ABI/compatibility behavior.
- Verified behavior/impact:
Subtract / Simplify
-
Collapse
post_direct_striped_batchedintopost_stripedupstream (helios/native/roce_proxy.c:1139-1205, 1259-1330).post_direct_striped_batched(72 lines) duplicatespost_stripedverbatim except forreserve_limit(..., RING2_MAX_OUTSTANDING), conditionalIBV_SEND_SIGNALED, thering2_unsignaled[p]counter update, and the error label. Adding(uint32_t limit, int batch_signal)(or a shared direct-stripe helper) in upstreamflashinfer#192before re-vendoring removes ~65 lines of duplicated WR construction without breaking Flare's byte-identity rule.
-
Simplify the
ring2_activeidle-loop split upstream (helios/native/roce_proxy.c:1794-1814).- Unless per-spin
ring_serviceon non-ring2 traffic is independently justified and benchmarked inflashinfer#192, drop thering2_activebranch and collapse the duplicatedatomic_store(&c->failed, 1); return NULL;blocks (e.g., runningring_service/drain_cqsat a single cadence), removing ~10 lines and avoiding the stretched idle-spin regression on non-ring2 rings.
- Unless per-spin
Nits
helios/native/roce_proxy.c:184-187: explicitly includeRING_WINDOW * 2in the_Static_assertsum (currently covered implicitly by the512 - 477 = 35-WR slack) so any futureRING_WINDOWincrease (such as#577's8 → 16) is checked directly at compile time.NOTICE:17: update the cited FlashInfer commit link once the upstream_roce_proxy.c(not opened) commit is merged and re-vendored.
Dropped on verification
- Correctness F1 (Blocker — ring2 WR budget
222 + 384 + unbounded > 512causingENOMEM): Dropped as mathematically false.post_ring2_step(:1336) only runs on aworld == 4closed ring, where each rank relays exactly one origin (ccw → cw) on its final hop (next == target,<= 2WRs/packet, never 3 WRs), bounded byRING_WINDOW = 8mailbox slots per rail (ring_pendingprevents reuse until CQ completion) — soring_service_slotcan have at most8 × 2 = 16WRs in flight onqp[cw][0], not128 × 3 = 384. Likewise,ring_completeACKs go toprevious = ccw(the opposite neighbor QP) and are bounded byRING_WINDOW = 8(1 WR each), not unbounded, andreserve()shares the sameoutstanding[p][0]counter as ring2. Exact worst-case occupancy is<= 374/512WRs onqp[cw][0](192ring2 +24ring_post+142direct +16forwards) and<= 358/512onqp[ccw][0](192ring2 +158direct +8ACKs). - Correctness F3 (
post_ring2_stepshouldreturn drain_all(c)and adjustwrites_completed): Dropped. Callingdrain_all(c)after every unsignaled ring2 step would defeat batched signaling latency (completions are harvested in the idle loop at:1805andreserve_limitat:835), androce_stat/roce_hca_statare unused in Rust. - Correctness F6 / Discovery inaccuracy on pre-existing
IBV_SEND_INLINEsites: Dropped:876(ring ACK),:932(relay bell),:1009(relay mark),:1168(one-shot flag), and:1493(credit), all of which already setIBV_SEND_INLINEonmain; retained only the newly added inline sites (:497-515, 914-925, 1187-1189). - Correctness F2 claim that "
mainposted direct peers first": Corrected/narrowed;mainiteratedp = 0..world-1in rank order (so rank 2 already posted relayed peer 0 first), while the head-of-line stall on> 1 MiBone-shot payloads for ranks 0/1/3 is real and folded into Should Fix #1. - Discovery / F12 claim that PR CI never compiles
roce_proxy.c: Corrected;cargo check --tests --features roce,rdma(.github/workflows/native-serving.yml:113(not opened)) runshelios/build.rs:67-77and compilesroce_proxy_dlopen.c/roce_proxy.c. The verified gap is that neither CI nor the PR'scargo testcommands executeexecution::roce::tests. - Subtraction S1 request to locally delete
pin_high_capacity_cpus(),#include <sched.h (not opened)>, and_GNU_SOURCE: Dropped the header/macro deletion (#include <sched.h (not opened)>and_GNU_SOURCEpredate this PR onmain, androce_proxy_dlopen.c:234-235expects_GNU_SOURCE) and reframedpin_high_capacity_cpus()because it is already merged on FlashInfermain(#156,335459b2) — deleting it locally in Flare would contradict the byte-identity rule. - Correctness F7 (blast radius), F10 (
AGENTS.md:376op-contract approval), F11 (wrong-layer coupling), and F14 (32-byte alignment fallback to oneshot): Dropped. F7 duplicates Should Fix #2 and describes intentional fail-stop poisoning (docs/roce-ring.md:370-372); F10 misapplies Helios captured-graph family approval to internal b12x proxy control words (and the author is the named owner); F11 contradictsAGENTS.md:382-396(collective selection belongs inhyperflare-recipes/FlashInfer); and F14's proxy-side fallback to oneshot would deadlock a launchedRoceRing2AllReduceLaunchkernel expecting split-half neighbor writes.