Skip to content

fix(helios,roce): select RoCEv2 IPv4 GID index per HCA - #672

Open
nepenth wants to merge 2 commits into
NVIDIA:mainfrom
nepenth:fix/roce-per-hca-gid
Open

nepenth wants to merge 2 commits into
NVIDIA:mainfrom
nepenth:fix/roce-per-hca-gid

Conversation

@nepenth

@nepenth nepenth commented Dec 2, 2026 •

Copy link
Copy Markdown

Summary

Fixes RoCEv2 discovery, native transport setup, preparation parity, and flare doctor on multi-HCA Linux hosts where active RDMA devices place their IPv4 RoCEv2 GID at different GID table indices (for example, roceP2p1s0f0 at index 3 and rocep1s0f0 at index 5 on dual-ConnectX-7 DGX Spark / ASUS GX10 hosts when an extra IPv6 link-local/ULA or VLAN entry shifts one HCA's GID table).

Companion FlashInfer PR: local-inference-lab/flashinfer#209 — helios/native/roce_proxy.c is re-vendored byte-for-byte identically (after the 9-line header) from _roce_proxy.c in that PR.

Problem

Previously, roce_fabric::discover_in required all active HCAs to share one single GID index (3, or the first index where any device had a RoCEv2 IPv4 GID) and dropped any active HCA whose IPv4 RoCEv2 GID was at another slot. On dual-CX7 GB10 hosts where one rail is at GID index 3 and the second rail is at GID index 5, serving silently fell back to a single 100 GbE rail (or failed when the other rail was selected), and flare doctor reported only one usable CX7 device.

Changes

  • helios/native/roce_proxy.c (byte-identical to local-inference-lab/flashinfer#209):
    • Store gid_index per HCA on roce_hca_t (removing the context-wide roce_ctx_t.gid_index), and use hca->gid_index in open_hca (ibv_query_gid) and connect_qp (ah_attr.grh.sgid_index).
    • Add roce_create_with_gids(..., const int* gid_indices, ...) with validation for gid_indices == NULL and per-HCA bounds 0..=255.
    • Keep roce_create(..., int gid_index, ...) as a backwards-compatible wrapper delegating to roce_create_with_gids (ABI version remains 14).
  • helios/src/execution/roce_fabric.rs:
    • Select each active HCA's own RoCEv2 IPv4 GID index independently: prefer PREFERRED_GID_INDEX (3) when valid on that HCA, otherwise fall back to that HCA's lowest valid RoCEv2 IPv4 GID index.
    • Replace the scalar gid_index field on Fabric and Topology with a single pub gid_indices: Vec<u32> source of truth, adding Fabric::gid_index(&self) -> u32 and Fabric::gid_index_for(&self, index: usize) -> Option<u32>, and validating self.gid_indices.len() == self.endpoints.len() in Fabric::topology.
  • helios/src/execution/roce.rs:
    • Validate topology.gid_indices.len() == topology.hcas.len() in RoceTransport::open preflight before touching the region, and pass the per-HCA indices to roce_create_with_gids.
  • heliopause/src/python.rs & ignition/preparation/collectives.py:
    • Expose flare_heliopause.roce_devices() -> list[tuple[str, int]] returning the discovered HCAs and their per-device GID indices in name-sorted order (updating roce_gid_index() to delegate to fabric.gid_index() with accurate docs).
    • Pass aligned hca_names and gid_indices into roce.AllReduce during preparation when supported by the installed b12x RoCE runtime (local-inference-lab/flashinfer#209), falling back cleanly to gid_index=flare_heliopause.roce_gid_index() on older pinned FlashInfer builds.
  • flare-cli/src/doctor/spark.rs & docs/cli-design.md:
    • Store gid_index: u32 on Interface, look up each HCA's own ports/1/gid_attrs/ndevs/{gid_index}, format uniform vs. mixed GID indices via format_gid_indices in both Pass and Warn paths, and update docs/cli-design.md wording.

Verification

Verified on ARM64 Linux (dual-CX7 GB10 host):

  1. Byte-identity check against local-inference-lab/flashinfer#209:

    • Verified helios/native/roce_proxy.c lines 10..EOF are byte-for-byte identical to flashinfer/experimental/b12x/comm/roce/_roce_proxy.c (0 diff bytes).
  2. Rust formatting:

    rustfmt --edition 2024 --check \
      helios/src/execution/roce.rs \
      helios/src/execution/roce_fabric.rs \
      flare-cli/src/doctor/spark.rs

    Result: passed (0 diffs).

  3. Unit tests (including C/FFI roce_create_with_gids and preflight checks):

    cargo test --manifest-path helios/Cargo.toml --features roce --lib execution::roce

    Result: test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 1220 filtered out; finished in 0.62s

    cargo test --manifest-path flare-cli/Cargo.toml --bin flare doctor::spark

    Result: test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 219 filtered out; finished in 0.02s

    cargo check --manifest-path heliopause/Cargo.toml

    Result: compiled cleanly with 0 errors.

  4. Companion FlashInfer pytest suite (local-inference-lab/flashinfer#209):

    • pytest -v tests/experimental/b12x/comm/test_roce_proxy.py tests/experimental/b12x/comm/test_roce_routes.py: 66 passed in 0.62s.
  5. Hardware validation:

    • Verified on a 2-node dual-ConnectX-7 GB10 cluster (roceP2p1s0f0 at GID 3, rocep1s0f0 at GID 5): both rails open and serve TP2 RDMA traffic cleanly, and flare doctor reports 2 of 2 active CX7 devices supply IPv4 endpoints for serving at RoCEv2 GID indices [3, 5].

@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 672.
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. bug Something isn't working priority:P2 Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround. triage:review Proposed change needs code review; this does not imply merge readiness. labels Dec 2, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

The per-HCA GID discovery rewrite in helios/src/execution/roce_fabric.rs and the rank-local per-HCA SGID plumbing in helios/src/execution/roce.rs and helios/native/roce_proxy.c are technically sound and fix a real dual-rail ConnectX-7 defect at the right layer, but two blockers prevent merge. helios/native/roce_proxy.c is locally forked ahead of its pinned upstream FlashInfer source (breaking the byte-identity invariant enforced on #643/#577), and the PR ships its FFI/C changes with zero executable test coverage alongside blanked, unreproducible verification commands.

  • Blockers: 2 · Should fix: 2 · Subtract/Simplify: 3 · Nits: 2
Walkthrough
  • helios/src/execution/roce_fabric.rs:223-228, 308-321, 381-476, 1006-1044: Replaces global host-wide GID selection in discover_in with per-device pick_gid_index (preferring PREFERRED_GID_INDEX = 3 per HCA, else that HCA's lowest RoCEv2 IPv4 GID in 0..16); adds gid_indices: Vec<u32> to Fabric and Topology, sets Fabric::gid_index = devices[0].1, adds Fabric::gid_index_for and Topology propagation with scalar fallbacks, and adds unit test mixed_per_hca_gid_indices_discover_both_ipv4_rails (:1182-1219).
  • helios/native/roce_proxy.c:259, 461, 531-601, 680: Adds per-HCA roce_hca_t.gid_index, uses hca->gid_index in open_hca (ibv_query_gid) and connect_qp (grh.sgid_index), adds roce_create_with_gids with NULL and 0..=255 bounds validation, and retains roce_create as a wrapper while still setting write-only c->gid_index = gid_indices[0].
  • helios/src/execution/roce.rs:46-61, 199-221, 397: Switches FFI from roce_create to roce_create_with_gids, builds Vec<c_int> from topology.gid_indices (with a length-mismatch fallback to topology.gid_index), and initializes gid_indices: Vec::new() in tests::specification().
  • flare-cli/src/doctor/spark.rs:150-203, 540-578: Looks up each endpoint's gid_attrs/ndevs/{gid_index} via fabric.gid_index_for(idx), tracks ready_gids to format index N (uniform) vs indices [a, b] (mixed), and adds cx7_readiness_handles_distinct_per_hca_gid_indices.
Merge Risk: Medium · up to c582b10
  • Vendored transport fork: helios/native/roce_proxy.c must remain byte-for-byte identical to FlashInfer's _roce_proxy.c (not opened) after its 9-line header (roce_proxy.c:6-8, roce_proxy_dlopen.c:7-9, docs/roce-ring.md:360-364). Merging a local fork one day after #643 restored parity splits preparation from serving and creates merge/re-vendor friction with open #577 and #649.
  • Preparation vs. serving divergence on mixed-index hosts: Serving now retains both HCAs (rails = 2) on mixed-index hosts, while ignition/preparation/collectives.py:83 still passes a single scalar flare_heliopause.roce_gid_index() (now devices[0].1). If the second HCA's slot at that index is empty or IPv6, preparation can compile 1-rail kernels while serving connects 2 rails—inverting the exact n_rail flag-offset mismatch (roce_proxy.c:1259) with no startup preflight check (RoceSpec does not record rail count).
  • Untested FFI/C path, low hot-path risk: Neither CI (.github/workflows/native-serving.yml:63 (not opened), 109-113) nor any unit test executes roce.rs:199-221 or roce_create_with_gids. On uniform-GID hosts, discovery, wire format (roce_blob_t), proxy hot paths (proxy_main, post_op, post_striped, ring_service), and ABI-14 core loading are unchanged.
Pre-merge checks: ✅ 1 passed · ⚠️ 3 warnings
  • ✅ Security / malicious screen: Pure local sysfs GID scanning, bounds-checked (0..=255) C array validation, and per-QP sgid_index wiring; no new network exposure, env vars, or unsafe boundary weakenings.
  • ⚠️ Charter & value fit: Right problem, right layer, model-agnostic, targets DGX Spark/SM121 with no new flags/defaults, but breaks the vendored FlashInfer parity invariant (docs/roce-ring.md:360-364, Charter Track FlashInfer main in the preparation dependency instead of a pinned commit #215) and omits verifiable evidence (AGENTS.md:103-112).
  • ⚠️ Related / duplicate / conflict check: Genuinely additive on top of #369, #506, and #666 (no functional duplicate; #151's environment had both rails at GID 3), but edits the vendored helios/native/roce_proxy.c concurrently touched by open #577 and #649 with no companion FlashInfer PR linked.
  • ⚠️ Tests & verification evidence: CI never runs --features roce tests (.github/workflows/native-serving.yml:63 (not opened), 109-113), no unit test exercises roce.rs:199-221 or roce_create_with_gids, and the PR body's cargo test commands are blanked with no counts or reproducible hardware logs.

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

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

Signed-off-by: nepenth <16943149+nepenth@users.noreply.github.com>
@nepenth
nepenth force-pushed the fix/roce-per-hca-gid branch from c582b10 to 5fa291d Compare December 2, 2026 17:55
@nepenth

nepenth commented Dec 2, 2026

Copy link
Copy Markdown
Author

Addressed all review feedback and rebased onto main:

  1. Vendored roce_proxy.c byte-identity invariant: Opened companion FlashInfer PR local-inference-lab/flashinfer#209 (66/66 pytest passing against libibverbs), deleted the write-only roce_ctx_t.gid_index field, and re-vendored helios/native/roce_proxy.c byte-for-byte identically (after the 9-line header) from _roce_proxy.c.
  2. Executable C/FFI & preflight tests + exact test output: Added roce_create_with_gids_rejects_null_and_out_of_range_gid_indices (NULL, -1, 256) and mismatched topology.gid_indices preflight rejection in helios/src/execution/roce.rs, plus preferred_gid_index_wins_per_hca_over_lower_roce_v2_index in roce_fabric.rs. Updated the PR description with the exact commands and pass counts (35 passed; 0 failed with --features roce, 4 passed; 0 failed in doctor::spark, cargo check on heliopause).
  3. Single source of truth (gid_indices only): Removed the duplicate scalar gid_index field from Fabric and Topology and eliminated the silent fallback branches; Fabric::topology and RoceTransport::open now reject length mismatches explicitly, and test fixtures populate real gid_indices.
  4. Preparation parity: Added flare_heliopause.roce_devices() (and updated roce_gid_index() docs) and wired ignition/preparation/collectives.py to pass aligned hca_names + gid_indices when the installed b12x RoCE runtime supports gid_indices, falling back cleanly to roce_gid_index() until flashinfer#209 is pinned.
  5. Doctor & docs polish: Folded gid_index: u32 into doctor::spark::Interface, reused format_gid_indices in the Warn fallback path, added a decoy IPv6 gids/3 + ndevs/3 on roce1 and a Warn-path assertion in cx7_readiness_handles_distinct_per_hca_gid_indices, and updated singular wording in docs/cli-design.md and roce_fabric.rs.

@flare-autobot please re-review.

@flare-autobot flare-autobot added the performance Performance, latency, throughput, or memory-efficiency investigation or improvement. label Dec 2, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

Round 1's GID plumbing, preflight rejection, and --features roce test coverage are verified sound at 5fa291d6 with no wire-ABI or hot-path regressions. Merge must hold until upstream local-inference-lab/flashinfer#209 lands, so the vendored helios/native/roce_proxy.c stays byte-identical, and the silent mixed-index preparation fallback is closed.

  • Blockers: 1 · Should fix: 1 · Subtract/Simplify: 1 · Nits: 2
Walkthrough
  • helios/native/roce_proxy.c:259, 262-269, 423, 460-464, 531-595, 673-674: Moves gid_index from roce_ctx_t onto per-HCA roce_hca_t, passes each HCA's index into open_hca (ibv_query_gid) and connect_qp (ah_attr.grh.sgid_index), adds roce_create_with_gids with NULL and 0..=255 bounds checks before allocation, and keeps roce_create as a compatibility wrapper (ROCE_ABI_VERSION = 14 and roce_blob_t unchanged).
  • helios/src/execution/roce_fabric.rs:224-228, 308-320, 406-430, 468-472, 1005-1047, 1189-1253: Selects each active HCA's RoCEv2 IPv4 GID index independently (preferring PREFERRED_GID_INDEX = 3 per HCA, else that HCA's lowest valid index in 0..16), replaces scalar gid_index with pub gid_indices: Vec<u32> on Fabric and Topology, validates gid_indices.len() == endpoints.len() in Fabric::topology, and adds mixed-index and per-HCA preference-3 unit tests.
  • helios/src/execution/roce.rs:46-61, 181-187, 206-224, 397-406, 483-485, 537-599: Switches FFI from roce_create to roce_create_with_gids, rejects topology.gid_indices.len() != topology.hcas.len() in RoceTransport::open preflight before zeroing the region or loading libibverbs, and adds unit tests covering the length-mismatch preflight and C NULL/-1/256 rejection.
  • heliopause/src/python.rs:668-669, 693-727 & ignition/preparation/collectives.py:80-98: Exposes flare_heliopause.roce_devices() -> list[tuple[str, int]], updates roce_gid_index() docs/delegation, and passes aligned hca_names and gid_indices into roce.AllReduce when supported by roce.AllReduce.__init__ (with a scalar fallback otherwise).
  • flare-cli/src/doctor/spark.rs:152-195, 242-281, 550-615 & docs/cli-design.md:1696-1699: Stores gid_index: u32 on Interface, resolves each HCA's own ports/1/gid_attrs/ndevs/{gid_index}, formats uniform vs. mixed indices via shared format_gid_indices on both Pass and Warn paths, adds a decoy-index-3 test covering both paths, and updates docs/cli-design.md.
Merge Risk: Medium · up to 5fa291d
  • Vendored transport divergence until flashinfer#209 merges: helios/native/roce_proxy.c:6-8, helios/native/roce_proxy_dlopen.c:7-9, and docs/roce-ring.md:360-364 mandate byte-for-byte parity with FlashInfer's _roce_proxy.c (not opened) (pyproject.toml:47 tracks FlashInfer main). Merging before #209 lands on main forks the vendored proxy, risks silent drift if #209 changes in review, and collides on the same vendored file with open #577 and #649.
  • Preparation fallback on mixed-index hosts: Until flashinfer#209 merges (or on un-updated local b12x installs), ignition/preparation/collectives.py:86-93 silently takes the scalar gid_index=flare_heliopause.roce_gid_index() branch (first device's index), which can still prepare 1 rail while serving connects 2 rails on mixed-index hosts.
  • Low runtime hot-path risk, pre-existing CI blind spot: No wire struct (roce_blob_t), ROCE_ABI_VERSION (14), or data-path function (proxy_main, post_op, post_striped, ring_service) changed; all added checks are O(n_hca <= 4) on cold startup paths. However, .github/workflows/native-serving.yml:63 (not opened), 111-113 only cargo checks --features roce,rdma, so the new C/FFI and preflight tests (helios/src/execution/roce.rs:483-485, 537-599) do not execute in CI.
Pre-merge checks: ✅ 1 passed · ⚠️ 3 warnings
  • ✅ Security / malicious screen: Pure local sysfs GID scanning, bounds-checked (0..=255) C array validation before allocation/verbs calls, and rank-local sgid_index wiring; no new network exposure, env vars, or unsafe boundary weakenings.
  • ⚠️ Charter & value fit: Right problem, right layer, model-agnostic, targets DGX Spark/SM121 with no new flags or magic defaults, but still lands a vendored helios/native/roce_proxy.c update ahead of unmerged upstream local-inference-lab/flashinfer#209 (docs/roce-ring.md:360-364).
  • ⚠️ Related / duplicate / conflict check: Genuinely additive on top of #369, #506, #643, and #666 (no duplicate), but depends on unmerged local-inference-lab/flashinfer#209 and touches helios/native/roce_proxy.c concurrently with open #577 and #649.
  • ⚠️ Tests & verification evidence: Unit tests and exact commands (35/35 --features roce execution::roce, 4/4 doctor::spark, 66/66 FlashInfer pytest, 2-node dual-CX7 GB10 serving [3, 5]) are verified and consistent with the codebase; warning remains because .github/workflows/native-serving.yml:63 (not opened), 111-113 never executes --features roce tests in CI and the cited Rust runs were debug rather than --locked --release.

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

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

@nepenth

nepenth commented Dec 3, 2026

Copy link
Copy Markdown
Author

Addressed the actionable review items from Round 2 in fa2ad7f:

  1. Fail loudly on mixed-GID hosts with older b12x (ignition/preparation/collectives.py):
    • create_roce_runtime() now calls flare_heliopause.roce_devices() before inspecting roce.AllReduce.__init__.
    • When the installed b12x does not accept gid_indices, uniform-GID hosts still pass gid_index, while mixed-index hosts (e.g., [3, 5]) raise a RuntimeError listing the discovered per-HCA GIDs and directing the user to update flashinfer-python (with local-inference-lab/flashinfer#209) rather than silently preparing with only the first HCA's GID index.
    • Updated the comment from "pinned" to "installed" to match pyproject.toml.
    • Added unit tests in tests/preparation/test_roce_collectives.py covering modern gid_indices, legacy uniform fallback, and legacy mixed-GID rejection.
  2. Assert roce_devices PyO3 export (heliopause/src/python.rs):
    • Added assert!(module.hasattr("roce_devices").unwrap()); to binding_tests::raw_replay_exports_require_qualification_feature.
  3. Re-verified with --locked --release (including heliopause unit tests):
    • 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 --bin flare doctor::spark -> 4 passed; 0 failed
    • cargo test --locked --release --manifest-path heliopause/Cargo.toml -> 229 passed; 0 failed; 6 ignored
    • pytest -v tests/preparation/test_roce_collectives.py tests/preparation/test_capture_roce_wait.py -> 4 passed

Merge-order note: local-inference-lab/flashinfer#209 is currently open awaiting upstream merge. Once #209 lands on FlashInfer main, I will re-verify 0 diff bytes on tail -n +10 helios/native/roce_proxy.c, cite the merged FlashInfer commit SHA in the PR description, and simplify ignition/preparation/collectives.py to pass hca_names + gid_indices unconditionally (removing the legacy compatibility shim).

lukealonso added a commit that referenced this pull request Dec 3, 2026
…, and CI parity (#707)

* helios,flare-cli,ignition: sync ABI-14 RoCE proxy (#672/#649/#577) and 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

* ci,tests: enforce vendored RoCE proxy byte parity and run roce unit tests

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

* pyproject: pin flashinfer-python to unified RoCE ABI-14 proxy commit

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

* helios,ignition,flare-cli: defer mesh roce_set_relay, repin merged FlashInfer, 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
Signed-off-by: Luke Alonso <lalonso@gmail.com>
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. bug Something isn't working performance Performance, latency, throughput, or memory-efficiency investigation or improvement. priority:P2 Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround. 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