Skip to content

helios,ignition,flare-cli: unify ABI-14 RoCE proxy sync, per-HCA GIDs, and CI parity - #707

Merged
lukealonso merged 4 commits into
mainfrom
unify-roce-proxy-abi14-ring-collecti
Dec 3, 2026
Merged

lukealonso merged 4 commits into
mainfrom
unify-roce-proxy-abi14-ring-collecti

Conversation

@lukealonso

@lukealonso lukealonso commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Cross-node RoCEv2 tensor-parallel preparation and native serving share a single C RDMA proxy (helios/native/roce_proxy.c) vendored from FlashInfer (flashinfer/experimental/b12x/comm/roce/_roce_proxy.c). Three defects and coupling hazards blocked landing the RoCE transport updates:

  1. Divergent manual vendoring: Three open Flare PRs—per-HCA GIDs (#672 by nepenth), 1-hop closed-ring collectives (#649 by FujitsuPolycom), and RING_WINDOW = 16 with connect-time handshake validation (#577 by fordbmorris)—modified helios/native/roce_proxy.c independently and collided across send-queue reservation limits, RING_WINDOW sizing, and eager ring draining. Upstream local-inference-lab/flashinfer#213 merged the unified ABI-14 proxy to main (1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e), and Flare had no automated check comparing its vendored copy against the pinned FlashInfer revision.
  2. Dropped rails on mixed-GID hosts: helios/src/execution/roce_fabric.rs picked one host-wide RoCEv2 IPv4 GID index and discarded active HCAs whose IPv4 GID lived in a different slot, reducing available rails on dual-NIC ConnectX-7 hosts (#143, #151).
  3. Untested native RoCE unit suite in CI: .github/workflows/native-serving.yml ran cargo check --features roce, leaving helios::execution::roce unit tests unexecuted in pull-request CI.

Syncing helios/native/roce_proxy.c to merged local-inference-lab/flashinfer@1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e, threading per-HCA GIDs through Helios/Heliopause/Ignition/flare doctor, adding a byte-parity guard in python-cpu.yml, and executing execution::roce unit tests in native-serving.yml resolves all three while keeping ROCE_ABI_VERSION = 14 and preserving #279's decision to leave the mesh all-gather relay disabled in serving.

What changed

1. Vendored RoCE proxy sync and FlashInfer pin (helios/native/roce_proxy.c, pyproject.toml, docs/roce-ring.md)

  • Before: helios/native/roce_proxy.c matched FlashInfer 5a8ceed80c (single gid_index per context, 2-hop CPU-relayed closed-ring reduce_scatter and gather_shards, RING_WINDOW = 8 / 512 KiB per rail, 1168-byte connect blob without ring-window or region-size verification, ROCE_SEND_DEPTH / 6 reserve cap, ROCE_SEND_DEPTH / 4 relay cap).
  • After: Synced helios/native/roce_proxy.c byte-for-byte below its 9-line provenance header with merged local-inference-lab/flashinfer@1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e (#213, body SHA-256 1f6b3ea80dd0ebe55aa33f9c3af175c61d5a72af948991c568b485ad1b1c25bc), bringing in:
    • Per-HCA roce_create_with_gids(..., const int *gid_indices, ...) with NULL and 0..=255 validation.
    • 1-hop bidirectional closed-ring collective opcodes (KIND_RING_RS = 7, KIND_RING_AG = 8, KIND_RING_RSAG = 9).
    • RING_WINDOW = 16 (1 MiB per rail), connect-time ring_window and ring_bytes agreement in roce_blob_t (1168 -> 1176 bytes), eager drain_all(c) in run_pipe_op, drain_cqs polled before ring_service in drain_all, and explicit send-queue caps (ROCE_RESERVE_OPS = 48 < ROCE_RELAY_OPS = 64) that preserve lane-0 relay headroom up to world = 16.
  • Repinned [tool.uv.sources].flashinfer-python.rev in pyproject.toml to merged 1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e and updated docs/roce-ring.md for RING_WINDOW = 16 and 1-hop closed-ring collectives while preserving "Serving does not enable FlashInfer's all-gather relay."
  • Compatibility: ROCE_ABI_VERSION remains 14, so previously exported ABI-14 cores remain loadable without re-export. All ranks in a serving job must run the same proxy revision because roce_blob_bytes() grew from 1168 to 1176 bytes to validate ring_window and ring_bytes during roce_connect.

2. Per-HCA RoCEv2 GID discovery and propagation (helios/src/execution/roce_fabric.rs, helios/src/execution/roce.rs, heliopause/src/python.rs, ignition/preparation/collectives.py, flare-cli/src/doctor/spark.rs, docs/cli-design.md)

  • Before: Fabric and Topology stored one scalar gid_index: u32; discover_in discarded active HCAs without a RoCEv2 IPv4 GID at that single index; RoceTransport::open called roce_create; flare_heliopause exported only roce_gid_index(); ignition.preparation.collectives.create_roce_runtime forwarded one gid_index; and flare doctor checked only a uniform host GID slot.
  • After: Each active HCA independently selects index 3 when it holds a RoCEv2 IPv4 GID there and otherwise selects its own lowest RoCEv2 IPv4 GID slot, stored in gid_indices: Vec<u32> aligned with endpoints/hcas. RoceTransport::open validates length parity before touching the region and calls roce_create_with_gids. flare_heliopause exports roce_devices() -> Vec<(String, u32)> alongside roce_gid_index(). create_roce_runtime forwards hca_names and gid_indices when flare_heliopause.roce_devices and AllReduce.__init__(..., gid_indices=...) are present, raises RuntimeError instead of silently collapsing rails on mixed-GID hosts paired with legacy AllReduce, and falls back to roce_gid_index() only for external test stubs lacking roce_devices (keeping hyperflare-recipes/tests/preparation/test_collectives.py compatible). flare doctor validates and formats per-device GID indices with non-empty format_gid_indices(first, rest).

3. Automated parity guard and RoCE CI execution (tests/preparation/test_roce_proxy_parity.py, .github/workflows/native-serving.yml)

  • Before: No test verified byte parity between helios/native/roce_proxy.c and FlashInfer's _roce_proxy.c, and .github/workflows/native-serving.yml did not run execution::roce unit tests.
  • After: Added tests/preparation/test_roce_proxy_parity.py (run by .github/workflows/python-cpu.yml), asserting LF line endings, the 9-line provenance header, and 0-byte divergence against installed flashinfer/experimental/b12x/comm/roce/_roce_proxy.c, plus unit coverage of create_roce_runtime per-HCA GID forwarding, mixed-GID failure on legacy AllReduce, and roce_gid_index-only stub compatibility. Added cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce to .github/workflows/native-serving.yml.

Cross-rank happens-before analysis (before vs after)

  • Connect and wire-format barrier (roce.rs:214-345, roce_proxy.c:665-761): Before, ranks exchanged 1168-byte connect records without checking ring_window or ring_bytes agreement. After, RoceTransport::open checks gid_indices.len() == hcas.len() before zeroing the collective region, binds each HCA QP to its own validated 0..=255 GID index in roce_create_with_gids, and exchanges 1176-byte connect records carrying (ring_window = 16, ring_bytes). peer_blobs rejects 1168-byte records and roce_connect rejects mismatched (ring_window, ring_bytes) before roce_start creates the proxy thread; no collective RDMA write can execute across mismatched ranks.
  • Ring drain and send-queue headroom (roce_proxy.c:156-231, 1271-1276, 1695-1701): Before, drain_all ran ring_service before drain_cqs (risking spinning on an already-completed CQ entry), reserve() allowed ROCE_SEND_DEPTH / 6 = 85 signaled ops while ring_service_slot() allowed ROCE_SEND_DEPTH / 4 = 128, and run_pipe_op did not drain ring relays eagerly after posting. After, drain_all polls drain_cqs before ring_service, ROCE_RESERVE_OPS = 48 < ROCE_RELAY_OPS = 64 strictly preserves lane-0 forwarding headroom (64 * 3 + 16 * 16 = 448 <= 512, and RING2 222 + 192 + 64 = 478 <= 512, statically asserted), and run_pipe_op drains ring relays immediately after posting when c->ring != NULL.
  • Cross-family pipe ↔ 1-hop credit ordering (roce_proxy.c:1530-1547, 1665-1694, 1816-1878, 2110-2146): Every rank executes the same op sequence s in order (proxy_main) and only calls post_credits(rank, s) after both its GPU kernel and its proxy (pipe_op_release) finished op s - 1. On a cross-family transition, every rank computes credit = CREDIT_RS (for 2-phase KIND_TWOSHOT/KIND_RING_RSAG and RS-only ops) or CREDIT_AG (for AG-only ops) and holds its first phase until credits_arrived(c, s) confirms every peer entered s. In both 2-phase ops (KIND_TWOSHOT and KIND_RING_RSAG), no rank's GPU kernel writes CTRL_READY_AG = s until its RS receive flags for s arrive, and no rank posts RS for s until credits_arrived clears CREDIT_RS, so RS completion transitively happens-before every AG post and AG forward (the same causal invariant already used on main for KIND_REDUCE_SCATTER -> KIND_TWOSHOT).

Claimed benefit and result

  • Verified in this PR:
    • Previously exported ABI-14 cores load and serve across 4 physical DGX Spark (SM121, aarch64) hosts on a dual-rail switchless RoCE ring (--roce-ring) through roce_create_with_gids, the 1176-byte connect handshake, and RING_WINDOW = 16, with zero transport errors, zero request cancellations, accurate 9.6K/19.1K/29.2K cold-prefill retrieval, and matched prefill/decode throughput relative to the installed baseline binary.
    • Multi-HCA hosts with distinct per-HCA RoCEv2 IPv4 GID indices retain every active rail across discovery, Ignition preparation, flare doctor, and RoceTransport::open, while remaining compatible with downstream hyperflare-recipes test stubs.
    • Peer handshake records of the 1168-byte layout are rejected before roce_start, and CI enforces 0-byte parity between helios/native/roce_proxy.c and the pinned merged FlashInfer revision plus execution::roce unit tests.
  • Prior component measurements (not re-measured on a newly exported hyperflare-recipes#114 core in this PR):
    • 1-hop closed-ring prefill collectives (KIND_RING_RS/KIND_RING_AG, requiring a core exported with local-inference-lab/hyperflare-recipes#114) were measured on 4× DGX Spark in #649 / local-inference-lab/flashinfer#195 (1.20x–1.46x RS/AG microbenchmarks, +3.76% to +4.32% isolated 8K–128K flare run prefill), and RING_WINDOW = 16 isolated ring collective latency (-6.2% to -9.7%) was measured in #577 / local-inference-lab/flashinfer#157.

Supporting evidence and limitations

1. Live 4-node DGX Spark (SM121, aarch64) multi-GPU serving verification

Cluster: 4× NVIDIA GB10 (tachyon.lan rank 0, graviton.lan rank 1, chroniton.lan rank 2, luxon.lan rank 3), 4 active ConnectX-7 HCAs/host (rocep1s0f0, rocep1s0f1, roceP2p1s0f0, roceP2p1s0f1, 2 direct rails per ring neighbor, RoCEv2 GID index 3, MTU 9000).
Core: previously exported ABI-14 deepseek-ai/DeepSeek-V4.1-Flash-1017 TP4 core (gb10-tp4-202612010121/model.safetensors, 73.5 GiB/rank, 9,462 kernels, --roce-ring --memory-limit=-8GiB --transfer-streams 1).

  • Built PR #707 (41ad1a43) natively on tachyon.lan (cargo build --locked --release --manifest-path flare-cli/Cargo.toml) and ran native aarch64 unit tests + doctor:
    • cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce: 35 passed, 0 failed.
    • flare doctor on tachyon.lan: PASS (4 of 4 active CX7 devices supply IPv4 endpoints for serving at RoCEv2 GID index 3).
  • Launched gb10-tp4-202612010121 across all 4 Sparks with flare orbit run ... --executable <pr707-aarch64-binary> --roce-ring:
    • All 4 ranks connected cleanly (0.3s–0.4s per rank: 2 rails per neighbor (experimental CPU relay ring)), served /health in 22s, and ran with 0 warnings/errors across all 4 rank logs and flare_requests_cancelled_total = 0.
    • Matched single-stream probes vs installed baseline binary (84ac035c lineage, temperature=0.0, seed=42):
      • short_greedy (55 prompt, 128 comp): TTFT 0.195s -> 0.212s; exact arithmetic (17 × 23 + 19 = 410) and primes on both.
      • greedy_code (69 prompt, 256 comp): TTFT 0.202s -> 0.208s; decode 86.0 -> 90.6 tok/s.
      • cold_prefill_8k (9,630 prompt, cached=0, 64 comp): TTFT 1.105s -> 1.106s (8,713.9 -> 8,709.6 tok/s); exact final-constraint retrieval.
      • cold_prefill_16k (19,134 prompt, cached=0, 64 comp): TTFT 1.868s -> 1.875s (10,241.8 -> 10,205.9 tok/s); decode 86.1 -> 95.4 tok/s; exact final-constraint retrieval.
    • Additional probes on PR #707:
      • 29,190-token cold-prefill needle retrieval (cached=0, 73 comp, 3.46s): retrieved exact 6-digit passkey 847291.
      • 4-way concurrent requests (128 tokens each): all 4 completed in 3.971s, 0 cancellations.
    • Note on repeatability: both the restored baseline binary and the PR #707 binary showed minor phrasing variation across repeated temperature=0.0, top_k=1 requests on this MoE/MTP core; both produced accurate answers and retrieved every prompt needle.

2. Local x86_64 Rust, Python parity, and cross-repo checks

  • RUSTFLAGS="-D warnings" cargo check --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server,roce and flare-cli/Cargo.toml --tests --features roce: PASS (0 warnings).
  • cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce: 35 passed, 0 failed (covers per-HCA GID discovery/planning, roce_create_with_gids NULL and out-of-range rejection, roce_blob_bytes() == 1176 with legacy 1168-byte rejection).
  • cargo test --locked --release --manifest-path flare-cli/Cargo.toml --features roce: 247 passed, 0 failed.
  • cargo test --locked --release --manifest-path heliopause/Cargo.toml --lib: 229 passed, 0 failed.
  • pytest tests/preparation/test_roce_proxy_parity.py tests/preparation/test_core_boundary.py tests/preparation/test_capture_roce_wait.py -v against merged flashinfer@1441ce862: 7 passed, 0 failed (0-byte diff confirmed against 1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e).
  • Cross-repo hyperflare-recipes/tests/preparation/test_collectives.py -k test_roce_setup -v against this branch's ignition/preparation/collectives.py: 2 passed, 0 failed.

Limitations and unrun checks

  • gb10-tp4-202612010121 was exported before local-inference-lab/hyperflare-recipes#114, so the live 4-Spark run validates previously exported ABI-14 core compatibility, roce_create_with_gids, the 1176-byte connect handshake, and RING_WINDOW = 16, but does not emit opcodes 7/8/9 (KIND_RING_RS/KIND_RING_AG/KIND_RING_RSAG).
  • All four DGX Sparks assign RoCEv2 IPv4 GID index 3 uniformly across their four CX7 ports; mixed per-HCA GID indices are verified via sysfs/FFI unit tests and #672's hardware report.
  • The Selene --features rdma feature was not compiled locally on Arch Linux due to ibverbs-sys bindgen struct-size assertions against newer rdma-core headers; GitHub Actions Ubuntu 24.04 (native-serving.yml) checks --features roce,rdma.

Contributors, superseded PRs, and merge order

This PR consolidates and credits work from #672 (nepenth), #649 (FujitsuPolycom), and #577 (fordbmorris) against already-merged local-inference-lab/flashinfer#213 (1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e). Mesh roce_set_relay wiring has been split out for a dedicated follow-up PR once benchmarked on a paired-cable + switch mesh.

  1. local-inference-lab/flashinfer#213 is already merged (1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e).
  2. Merge this PR (#707).
  3. Merge local-inference-lab/hyperflare-recipes#114 to enable 1-hop closed-ring reduce_scatter and gather_shards in model recipes.

Discord: lukealonso

…d wire roce_set_relay

Why: Manual vendoring of `helios/native/roce_proxy.c` blocked three companion
RoCE transport updates while native serving omitted the two-shot all-gather
relay (`roce_set_relay`) already compiled into the proxy. Multi-HCA hosts with
distinct per-device IPv4 RoCEv2 GID slots dropped active rails during discovery;
switchless closed rings routed large prefill reduce-scatter and shard-gather
traffic over 2-hop CPU mailboxes; `RING_WINDOW = 8` sat below the 2-hop relay
BDP knee without a connect-time window/size guard; and hybrid switch-plus-cable
mesh clusters sent all-gather shards over the switch instead of forwarding over
direct partner cables.

What changed:
- Before: `helios/native/roce_proxy.c` tracked FlashInfer `5a8ceed80c` (single
  context GID index, opcodes `0..6`, `RING_WINDOW = 8`, 1168-byte `roce_blob_t`,
  `reserve()` at `/6`, `ring_service_slot()` at `/4`, no eager ring drain in
  `run_pipe_op`). `roce_fabric::discover_in` required one host-wide GID index,
  `Fabric::topology` computed `direct` without a relay plan, and
  `RoceTransport::connect` never called `roce_set_relay`.
- After:
  - Re-vendored `helios/native/roce_proxy.c` byte-for-byte after its 9-line
    header from the unified FlashInfer branch (`#209 + #195 + rebased #157`):
    per-HCA `roce_create_with_gids`, 1-hop closed-ring opcodes
    `KIND_RING_RS/AG/RSAG = 7..9` with extended `credit_phases()`, `RING_WINDOW =
    16` with connect-time `(ring_window, ring_bytes)` validation (`1176`-byte
    `roce_blob_t`, preserving `ROCE_ABI_VERSION = 14`), named SQE limits
    `ROCE_RESERVE_OPS = 48 < ROCE_RELAY_OPS = 64` with `drain_cqs` polled before
    `ring_service` in `drain_all`, and eager `drain_all(c)` in `run_pipe_op`
    when `c->ring != NULL`.
  - Updated `helios/src/execution/roce_fabric.rs`, `helios/src/execution/roce.rs`,
    `heliopause/src/python.rs`, `ignition/preparation/collectives.py`,
    `flare-cli/src/doctor/spark.rs`, and `docs/cli-design.md` to select and pass
    per-HCA GID indices (`roce_create_with_gids`, `roce_devices()`) and fail
    loudly if mixed per-HCA GIDs meet an older FlashInfer lacking `gid_indices`.
  - Ported `partners()` and `relay_plan()` into `roce_fabric.rs`, added
    `Topology::relay_plan` for `Shape::Mesh` + `Links::All` paired-cable
    fabrics, validated relay plans in `RoceTransport::open` preflight, invoked
    `roce_set_relay` in `RoceTransport::connect` between `roce_connect` and
    `roce_start`, surfaced `, all-gather relay` in `flare-cli/src/cluster.rs`,
    and updated `docs/roce-ring.md`.
- Compatibility: `ROCE_ABI_VERSION` remains `14`; existing ABI `9/10/11/14`
  cores load without re-export, and `peer_blobs` rejects legacy `1168`-byte
  connection records alongside foreign ABIs.

Claimed benefit: Unblocks dual-CX7 mixed-GID serving, enables 1-hop closed-ring
prefill opcodes `7..9` and `RING_WINDOW = 16` relay throughput with preserved
lane-0 relay priority up to `world = 16`, and activates `roce_set_relay` on
paired-cable mesh fabrics without re-exporting cores (expected 25% switch
traffic reduction on 4-rank paired-cable meshes per `_roce_proxy.c` design).

Supporting evidence and limitations: Verified on Linux x86_64 with live active
RDMA HCA `rocep82s0f0`:
- `cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce`:
  38 passed, 0 failed (covering `roce_create_with_gids`, `roce_set_relay` FFI
  rejection on unconnected context, `roce_blob_bytes() == 1176`, legacy
  `1168`-byte rejection, 14 preflight checks, per-HCA GID discovery, and
  4/8-rank + LLDP link-local `relay_plan` invariants).
- `cargo test --locked --release --manifest-path helios/Cargo.toml --features roce,runtime-core,server --lib -- --skip frontend::templates --skip template`:
  1,831 passed, 0 unrelated failures (1 template-fixture test requires
  `FLARE_TEST_TEMPLATE_DIR`).
- `cargo test --locked --release --manifest-path flare-cli/Cargo.toml --features roce`:
  247 passed, 0 failed; `flare`: 247 passed, 0 failed; `heliopause --lib`: 229
  passed, 0 failed.
- `RUSTFLAGS="-D warnings" cargo check --locked --release` on `helios
  (--features runtime-core,server,roce)` and `flare-cli (--tests --features
  roce)`: pass (0 warnings).
- Limitations: Multi-host 4x DGX Spark GB10 `flare run` serving, live
  paired-cable mesh `roce_set_relay` traffic, and `--features rdma` (whose
  `ibverbs-sys` bindgen fails on Arch rdma-core headers) were not executed on
  this single-host x86_64 machine; `pyproject.toml` pin bump awaits upstream
  FlashInfer merge.

Design-Signed-Off-By: Antigravity (Gemini 4); design-review=2e5b
…ests

Why: Previously, no automated check verified that vendored
`helios/native/roce_proxy.c` remained byte-for-byte identical to FlashInfer's
`_roce_proxy.c` after its 9-line provenance header, and
`.github/workflows/native-serving.yml` only ran `cargo check` for
`--features roce` without executing `execution::roce` unit tests. That allowed
protocol drift and left C/FFI preflight and handshake tests unexecuted in CI.

What changed:
- Before: `tests/preparation/` had no RoCE proxy parity check or unit test for
  `create_roce_runtime`'s per-HCA GID dispatch; `.github/workflows/native-serving.yml`'s
  `rdma` job stopped after `cargo check --tests --features roce,rdma`.
- After: Added `tests/preparation/test_roce_proxy_parity.py` (executed by
  `.github/workflows/python-cpu.yml`) asserting LF line endings, the 9-line
  SPDX/provenance header, and 0-byte diff between `helios/native/roce_proxy.c`
  lines 10..EOF and the installed FlashInfer package's `_roce_proxy.c`, plus
  contract tests for `create_roce_runtime` per-HCA GID forwarding and loud
  rejection of mixed-GID hosts on older FlashInfer builds. Added a
  `cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce`
  step to `.github/workflows/native-serving.yml`.

Claimed benefit: Prevents future preparation-vs-serving RoCE proxy drift and
executes native RoCE C/FFI and fabric planner unit tests automatically in CI.

Supporting evidence and limitations: Verified locally with
`PYTHONPATH=<unified-flashinfer>:<flare-worktree> pytest tests/preparation/test_roce_proxy_parity.py tests/preparation/test_core_boundary.py tests/preparation/test_capture_roce_wait.py`
(7 passed, 0 failed), `pytest tests/cli` (148 passed, 0 failed), and
`cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce`
(38 passed, 0 failed). In GitHub Actions `python-cpu.yml`, parity will pass once
`pyproject.toml` pins the merged FlashInfer revision carrying `#209 + #195 + #157`.

Design-Signed-Off-By: Antigravity (Gemini 4); design-review=2e5b
Why: `tests/preparation/test_roce_proxy_parity.py` enforces byte-for-byte
parity between vendored `helios/native/roce_proxy.c` and the installed
`flashinfer-python` source `_roce_proxy.c`. Keeping `pyproject.toml` on
the prior FlashInfer commit (`5a8ceed80c`) would fail `python-cpu.yml`
until the companion FlashInfer PR merges.

What changed: Updated `[tool.uv.sources].flashinfer-python.rev` in
`pyproject.toml` from `5a8ceed80ccc58e11a4d49ccc910f52967699c09` to
`524799c47fca54229c15b6db12261171854a7b7d` (HEAD of
`local-inference-lab/flashinfer#213`). Update this revision again to the
merged `main` commit if `flashinfer#213` is squash-merged.

Verification: Verified `pyproject.toml` parses via `tomllib` and confirmed
that commit `524799c47fca54229c15b6db12261171854a7b7d` exists on
`local-inference-lab/flashinfer` and matches `helios/native/roce_proxy.c`
below line 9 (SHA-256 `1f6b3ea80dd0ebe55aa33f9c3af175c61d5a72af948991c568b485ad1b1c25bc`).

Design-Signed-Off-By: Antigravity (Gemini 4); design-review=2e5b
@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 707.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added area:rocenante RoCEnante cross-host GPU collectives and RoCE transport. enhancement New feature or request performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:review Proposed change needs code review; this does not imply merge readiness. labels Dec 3, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

The per-HCA GID plumbing, the mesh relay-plan derivation with its Rust preflight, the CI parity guard, and the new execution::roce CI step are well built and verified clean at 81ef561 — no defect found in roce_fabric.rs discovery/planning, roce.rs preflight/ordering, heliopause, flare doctor, or cluster.rs. Three blockers remain: a verified state-machine defect in the vendored proxy's cross-family credit holding, the unrun mandatory multi-GPU collective gate that docs/design-review.md:252-259 names for exactly these files, and a default-on relay data path shipped with no measurement, reversing a documented decision from merged #279.

  • Blockers: 3 · Should fix: 2 · Subtract/Simplify: 5 · Nits: 4
Walkthrough
  • helios/native/roce_proxy.c (+339/−59): re-vendored to add per-HCA roce_create_with_gids (:557, roce_create kept as wrapper :611), RING_WINDOW 16 (:223), ring_window/ring_bytes handshake validation (:665-666, :744-761), KIND_RING_RS/AG/RSAG = 7/8/9 (:194-196) with run_ring_bidir_op (:1768), send-queue split ROCE_RESERVE_OPS 48 < ROCE_RELAY_OPS 64 (:156-159), and drain_cqs before ring_service in drain_all (:1271-1276). ROCE_ABI_VERSION remains 14.
  • helios/src/execution/roce_fabric.rs (+375/−34): gid_indices: Vec<u32> replaces the scalar index, per-HCA pick_gid_index (:409-415), partners()/relay_plan() (:979-1061) ported from FlashInfer _routes.py, Topology::relay_plan populated only for Shape::Mesh (:1128-1131).
  • helios/src/execution/roce.rs (+231/−7): roce_create_with_gids FFI with length-alignment check before the region is zeroed (:214-241), validate_relay_plan (:102-132), roce_set_relay invoked between roce_connect and roce_start (:344-353), plus 1176/1168 tripwire tests (:491, :502).
  • ignition/preparation/collectives.py:83-97: roce_devices() forwarding of hca_names + gid_indices, with a RuntimeError on mixed-GID hosts against a legacy AllReduce.
  • flare-cli/src/doctor/spark.rs:161-190,259-273 per-device GID validation and format_gid_indices; flare-cli/src/cluster.rs:108-112 appends ", all-gather relay" only when relay_plan.is_some().
  • .github/workflows/native-serving.yml:114-115 adds the execution::roce lib tests to the Linux rdma job; tests/preparation/test_roce_proxy_parity.py (new, 131 lines) enforces header + 0-byte parity and exercises create_roce_runtime.
Merge Risk: High · up to 81ef561
  • Default-on collective-routing change on already-exported ABI-14 cores. roce.rs:344-353 now calls roce_set_relay for every Shape::Mesh + Links::All + even world >= 4 mutual-pair fabric; opt-out is only --roce-switch-only. Existing 4-rank cabled mesh jobs change all-gather routing without re-export, and the benefit is stated as "expected", never measured.
  • Wire-format change inside an unchanged ABI number. roce_blob_t grows 1168 → 1176 bytes (roce_proxy.c:257-269) while ROCE_ABI_VERSION stays 14, so mixed-revision rank sets fail only at roce_connect (:754-761). ROCE_ABI_VERSION gives no protection here.
  • Pin targets unmerged upstream. pyproject.toml:47 points at 524799c4… from still-open FlashInfer Read every checkpoint through b12x's pinned-host reader #213; the new parity test (tests/preparation/test_roce_proxy_parity.py:35-65, run by python-cpu.yml:33) hard-fails if that branch is squashed or force-pushed, and no uv.lock exists in the repo to fall back on.
Pre-merge checks: ✅ 1 passed · ⚠️ 3 warnings

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

Want a frontier second opinion? If these findings look noisy, request a one-time SuperAgent Review on 81ef561 (~3–4 min; re-adjudicates existing findings without re-running discovery).

To opt out, include #autobot:ignore in your post or comment.

…ashInfer, and keep roce_gid_index fallback

Why:
PR #707 review identified three issues: (1) enabling `roce_set_relay` by
default reversed #279's documented serving behavior without a 4-node
paired-cable + switch mesh A/B measurement, (2) `pyproject.toml` pointed at
an unmerged FlashInfer branch commit before `local-inference-lab/flashinfer#213`
merged to `main`, and (3) `flare-cli/src/doctor/spark.rs` retained an
unreachable empty arm in `format_gid_indices`. In addition, calling
`flare_heliopause.roce_devices()` unconditionally in
`ignition/preparation/collectives.py` broke downstream test stubs in
`hyperflare-recipes/tests/preparation/test_collectives.py` that provide
only `roce_gid_index`.

What changed:
- Removed `partners()`, `relay_plan()`, `Topology::relay_plan`,
  `validate_relay_plan`, the `roce_set_relay` FFI call, and the
  `cluster.rs` relay summary from this branch (preserved separately on
  `wire-roce-set-relay`), and restored `docs/roce-ring.md` to state that
  serving does not enable FlashInfer's mesh all-gather relay.
- Updated `[tool.uv.sources].flashinfer-python.rev` in `pyproject.toml` to
  merged `local-inference-lab/flashinfer` `main` commit
  `1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e` (identical `_roce_proxy.c` body
  SHA-256 `1f6b3ea80dd0ebe55aa33f9c3af175c61d5a72af948991c568b485ad1b1c25bc`).
- Updated `ignition/preparation/collectives.py` to check
  `getattr(flare_heliopause, "roce_devices", None)` before calling it,
  falling back to `roce_gid_index()` only when `roce_devices` is absent,
  and added coverage in `tests/preparation/test_roce_proxy_parity.py`.
- Changed `format_gid_indices` in `flare-cli/src/doctor/spark.rs` to take
  `(first: u32, rest: &[u32])`, eliminating the unreachable empty arm.

Claimed benefit and result:
Keeps #707 focused on the merged ABI-14 RoCE proxy sync, per-HCA GID
selection, and CI parity/test coverage without reversing #279 or breaking
downstream `hyperflare-recipes` unit tests.

Supporting evidence and limitations:
- `RUSTFLAGS="-D warnings" cargo check --locked --release` on `helios`
  (`--features runtime-core,server,roce`) and `flare-cli` (`--tests --features roce`):
  PASS (0 warnings).
- `cargo test --locked --release --manifest-path helios/Cargo.toml --features roce --lib execution::roce`:
  35 passed, 0 failed.
- `cargo test --locked --release --manifest-path flare-cli/Cargo.toml --features roce`:
  247 passed, 0 failed.
- `tests/preparation/{test_roce_proxy_parity,test_core_boundary,test_capture_roce_wait}.py`:
  7 passed, 0 failed; `hyperflare-recipes/tests/preparation/test_collectives.py -k test_roce_setup`:
  2 passed, 0 failed.
- Multi-node 4x GB10 serving validation is executed next on the updated binary.

Design-Signed-Off-By: Antigravity (Gemini 4); design-review=2e5b
@lukealonso lukealonso changed the title helios,ignition,flare-cli: unify ABI-14 RoCE proxy sync, wire roce_set_relay, and enforce CI parity helios,ignition,flare-cli: unify ABI-14 RoCE proxy sync, per-HCA GIDs, and CI parity Dec 3, 2026
@lukealonso

Copy link
Copy Markdown
Collaborator Author

Addressed the review feedback at 41ad1a43:

  • Blocker 3 (roce_set_relay default-on, reversing #279): Split partners(), relay_plan(), roce_set_relay, and the cluster.rs relay summary out of this PR into a separate branch (wire-roce-set-relay) until benchmarked on a 4-node paired-cable + switch mesh. docs/roce-ring.md again states "Serving does not enable FlashInfer's all-gather relay." (which also resolves Should Fix 2 and Subtract/Simplify 3 & 5).
  • Blocker 2 (docs/design-review.md:252-259 multi-GPU collective gate & happens-before analysis):
    • Added the explicit before/after cross-rank happens-before analysis to the PR description.
    • Built 41ad1a43 natively on aarch64 (tachyon.lan: execution::roce 35/35 passed, flare doctor PASS on 4/4 active CX7 HCAs at GID index 3) and served the previously exported ABI-14 DeepSeek-V4.1-Flash TP4 core (gb10-tp4-202612010121, 73.5 GiB/rank, 9,462 kernels, --roce-ring) across all four DGX Sparks (tachyon.lan, graviton.lan, chroniton.lan, luxon.lan): all 4 ranks connected in 0.3s–0.4s (2 rails per neighbor), served short, code, 9.6K/19.1K/29.2K cold-prefill needle retrieval, and 4-way concurrent requests with zero warnings, errors, or cancellations and matched prefill/decode throughput (10,206 vs 10,242 tok/s at 19.1K).
  • Should Fix 1 (pyproject.toml pin): local-inference-lab/flashinfer#213 merged to main as 1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e; repinned pyproject.toml:47 to 1441ce862ffbc9d8550fdda7ad90e97ca04f4b8e and verified 0-byte diff against helios/native/roce_proxy.c lines 10..EOF (SHA-256 1f6b3ea80dd0ebe55aa33f9c3af175c61d5a72af948991c568b485ad1b1c25bc).
  • Blocker 1 (credit_phases() on cross-family transitions, roce_proxy.c:1536-1538): Not a reachable data-corruption race on normal execution. Both 2-phase ops (KIND_TWOSHOT and KIND_RING_RSAG) have a strict cross-rank RS → AG dependency: every rank executes proxy_main in sequence order (:2110-2146), calls post_credits(rank, s) only after both its kernel and proxy finished s - 1, and holds CREDIT_RS until credits_arrived(c, s) confirms every peer entered s. No rank's GPU kernel writes CTRL_READY_AG = s until its RS receive flags for s arrive (_twoshot_cute.py:290-334, _ring_scatter_gather_cute.py:380-428), and AG forwarding only fires on pipe_chunk_arrived(..., s). Thus while any peer is still reading s - 1, zero RS and zero AG writes for s can be posted—the same causal invariant upstream main already uses for credit_phases(KIND_REDUCE_SCATTER, KIND_TWOSHOT) == CREDIT_RS. (Note: holding CREDIT_RS | CREDIT_AG on cross-family transitions is zero-cost defensive hardening for a poisoned _twoshot_cute.py timeout path and can be taken cleanly in a follow-up FlashInfer PR without re-introducing an unmerged pin here.)
  • Subtract/Simplify 1 (roce_gid_index): Kept exported intentionally—local-inference-lab/hyperflare-recipes mocks flare_heliopause with SimpleNamespace(roce_gid_index=lambda: 5) in tests/preparation/test_collectives.py:423. Updated ignition/preparation/collectives.py to check getattr(flare_heliopause, "roce_devices", None) so those downstream tests pass (2 passed, 0 failed verified directly) while production flare_heliopause always uses roce_devices().
  • Subtract/Simplify 2 (format_gid_indices): Updated flare-cli/src/doctor/spark.rs to take (first: u32, rest: &[u32]), removing the unreachable empty arm.
  • Contributor credit: Credited nepenth (#672), FujitsuPolycom (#649), and fordbmorris (#577) in the PR description.

@flare-autobot

@lukealonso
lukealonso merged commit 67ad121 into main Dec 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:rocenante RoCEnante cross-host GPU collectives and RoCE transport. enhancement New feature or request performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants