Repository navigation
helios: rotate RoCE proxy peer send order by rank to avoid synchronized incast - #725
Conversation
…ed incast
In `helios/native/roce_proxy.c`, `post_op`, `post_pipe_chunk`,
`post_credits`, and `run_varlen_op` iterated peers in fixed `0..world-1`
order on every rank. On switched mesh fabrics (`world >= 4`), every rank
posted to rank 0 first, then rank 1, then rank 2, synchronizing
`(world - 1):1` incast onto each receiver's switch egress port.
Replace those four peer-posting loops with a rank-rotated permutation
schedule (`for (int step = 1; step < c->world; step++) { int p =
(c->rank + step) % c->world; ... }`) under existing ABI 14 (no wire,
blob, or region layout changes), matching companion
local-inference-lab/flashinfer#221 byte-for-byte after the provenance
header. Each step maps senders to destinations 1:1 across the fabric
while visiting every peer `p != rank` exactly once and preserving
existing `c->ring` and `c->relay` filters.
Validated with `cargo test --locked --release --manifest-path
helios/Cargo.toml --features roce --lib execution::roce` (35 passed),
`-Wall -Wextra` C compilation, and byte-for-byte parity verification
against local-inference-lab/flashinfer#221 (`test_roce_proxy.py`: 24
passed). Live multi-node switched-mesh benchmarking and pinning the
merged FlashInfer commit in `pyproject.toml` remain pending.
Discord: el8
Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
|
A case file has been opened for 725. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe C change itself (
Walkthrough
Merge Risk: Medium · up to
|
… roce_proxy.c Pin `[tool.uv.sources].flashinfer-python.rev` to merged `local-inference-lab/flashinfer#221` (`3c5c7b14886a7b8904e2963f7d678dbf3a4a755e`) and sync `helios/native/roce_proxy.c` byte-for-byte with that revision (which includes merged `flashinfer#220` plus the rank-rotated peer send order from `#221`) so `tests/preparation/test_roce_proxy_parity.py` passes against the pinned FlashInfer dependency. Validated exact byte-for-byte parity (97,954 bytes). Discord: el8 Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
|
Both blockers are resolved at
@flare-autobot please re-review. |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeBoth Round-1 blockers are resolved at
Walkthrough
Merge Risk: Low · up to
|
Test ResultsTestedRan the full CPU-side gate set for PR #725 (vendored-proxy parity against the pinned FlashInfer Hardware usedSingle arm64 node: 1× GB10 GPU (driver 580.178.04, CUDA 13.0) and 2× dual-port ConnectX-7 adapters presenting 4 RoCE ports, all Results
ConclusionPass—every gate runnable in this environment is green, and nothing here indicates a defect. The performance claim is a separate matter: it is Inconclusive, unverified by this pass, and still needs a 4-node GB10 CX-7 bench with n ≥ 5 interleaved passes, per-pass ranges, incast/PFC counters, and a |
Problem
In
helios/native/roce_proxy.c, all four peer-posting loops (post_op,post_pipe_chunk,post_credits, andrun_varlen_op) iterate destinations in fixed0 .. world - 1order on every rank. On switched mesh fabrics (world >= 4), allworld - 1ranks post to rank0simultaneously, then rank1, then rank2, creating lockstep(world - 1):1incast onto each receiver's switch egress port on every collective and chunk.Change
Rotate destination order by rank in all four posting loops (three payload loops —
post_op,post_pipe_chunk,run_varlen_op— plus control-planepost_creditsfor uniformity):p != rankis visited exactly once per pass.step,rank -> (rank + step) % worldis a 1:1 bijection (0->1, 1->2, 2->3, 3->0, then0->2, 1->3, ...), eliminating lockstep(world - 1):1incast at zero runtime or ABI cost (ROCE_ABI_VERSIONremains14; existing runtime packages load unmodified).c->ring) and all-gather relay (c->relay_via) filters are preserved unchanged; intra-pass peer order within those filters also rotates by rank.pyproject.tomlpins the merged FlashInfer parity commit3c5c7b14886a7b8904e2963f7d678dbf3a4a755e(fromlocal-inference-lab/flashinfer#221), andhelios/native/roce_proxy.cmatchesflashinfer/experimental/b12x/comm/roce/_roce_proxy.cbyte-for-byte after the 9-line vendored header (required bytests/preparation/test_roce_proxy_parity.py). Because3c5c7b14886a7b8904e2963f7d678dbf3a4a755esits on top oflocal-inference-lab/flashinfer#220,helios/native/roce_proxy.calso includes theroce_set_hairpin_peerspacing path, which is inactive unless called by a hairpin topology.Cross-Rank Happens-Before Analysis
seqwrites source-keyed slots (recv[src][slot],flag[src][slot][rail],pipe_recv[src][phase],pipe_flag[phase][src][chunk][rail],varlen_flag[slot][src][chunk][rail], andctrl[CTRL_CREDIT + src]). No destination slot is shared between distinct senders, and each receiver's completion check (credits_arrived,pipe_chunk_arrived, and device flag waits) is a symmetric barrier over allsrc != rankindependent of destination posting order.(src, dst, rail, lane)reliable RC QP, the relative order of payload data WRs, inline 4-byte readinessseqflags, and consecutive chunk/op sequences is unchanged.ring_postallocates strictly monotonic per-railc->ring_serial[rail]at post time; rotating destination order within pass 0 ofpost_oporpost_creditspreserves strictly ascending serials on each neighbor hop and identical receiver reassembly.Validation
Unit & Parity Checks
cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce: 35 passed, 0 failed.helios/native/roce_proxy.c(lines 10..EOF) is byte-for-byte identical (98,150bytes) toflashinfer/experimental/b12x/comm/roce/_roce_proxy.cat pinned revision3c5c7b14886a7b8904e2963f7d678dbf3a4a755e(-Wall -Wextraclean,test_roce_proxy.py: 24 passed).Served-Workload A/B Benchmark (4-Node Switched Mesh)
Shape::Mesh), serving an unmodified ABI 14 TP4DeepSeek-V4.1-Flashruntime package (--alpha 1.0 --embedding-cache-size 22GiB --checkpoint-extra-work-fraction 0.05,--max-concurrency 32,--mtp-draft-tokens 7,--mtp-adaptive-verification,--mtp-max-verification-token-budget 256). One clean cold boot per arm, identical prompts and concurrency schedule, comparing releaseflarebinaries built frommain(f705086b) against the isolated peer-rotation commit (8b06cdac; the switched-mesh execution path atda7abad2is identical becauseroce_set_hairpin_peersis not called onShape::Mesh).0failed requests on both arms across all prefill and decode passes.main(f705086b)8b06cdac)mainvs branch)9,929.7tok/s (1,069.4ms TTFT)9,992.1tok/s (1,062.9ms TTFT)+0.63%9866.0 / 9869.4 / 10053.6vs9916.1 / 9833.8 / 10226.211,605.5tok/s (3,656.1ms TTFT)11,726.8tok/s (3,618.2ms TTFT)+1.05%11639.9 / 11571.0vs11742.0 / 11711.710,077.7agg tok/s (4,214.4ms wall)10,228.4agg tok/s (4,152.4ms wall)+1.50%10084.1 / 10071.4vs10198.7 / 10258.274.5e2e /78.8dec tok/s76.9e2e /81.4dec tok/s+3.23%e2e73.5 / 75.5vs72.6 / 81.2137.8e2e /158.7dec tok/s137.3e2e /157.0dec tok/s-0.38%e2e130.1 / 145.6vs126.6 / 148.1235.7e2e /286.5dec tok/s234.9e2e /285.6dec tok/s-0.35%e2e221.3 / 250.1vs224.0 / 245.7post_pipe_chunk/run_varlen_op) gain+1.05%on 42K single-request prefill and+1.50%on 4×10.6K concurrent prefill (strictly higher on every pass), with neutral decode throughput acrossC=1/4/16(all deltas within pass-to-pass variance) and zero collective or request errors.Discord: el8