Final review report · NVIDIA/hyperflare-inference #672

Raw Markdown for agents: https://autobot.eidonix.com/p/cf2b6a3a-d83d-4974-b0db-0645b288338d.md

Recommendation: Changes Requested

The core 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, solve a real dual-rail ConnectX-7 defect at the right layer, and add no hot-path overhead or config switches. However, two blockers prevent merge as-is: helios/native/roce_proxy.c is locally forked ahead of its pinned upstream FlashInfer source (breaking the byte-identity invariant enforced on #643 and #577), and the PR ships its FFI/C changes with zero executable test coverage in CI or unit tests alongside blanked, unreproducible verification commands. In addition, silently redefining Fabric::gid_index to devices[0].1 breaks flare_heliopause.roce_gid_index()'s documented contract and leaves multi-host preparation one-sided on mixed-index hosts.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

  1. Vendored helios/native/roce_proxy.c is locally forked without a merged upstream FlashInfer revision (helios/native/roce_proxy.c:6-8, 259, 461, 531-601, 680; helios/native/roce_proxy_dlopen.c:7-9; docs/roce-ring.md:360-364; NOTICE:16-19)

    • Behavior / impact: Both C provenance headers and docs/roce-ring.md:360-364 mandate keeping helios/native/roce_proxy.c byte-for-byte identical to FlashInfer's flashinfer/experimental/b12x/comm/roce/_roce_proxy.c (not opened) after the 9-line header so preparation and serving share the exact transport implementation. Maintainers enforced this invariant directly on #643 (merged one day before this PR to restore 0-byte diff against FlashInfer 2a07747b8) and #577. Editing roce_proxy.c locally without an upstream FlashInfer commit breaks parity, leaves NOTICE:18-19's "implementation is unchanged" statement false, and forces future re-vendors (#577, #649) to reconcile an untracked fork.
    • Fix: Land roce_create_with_gids and per-HCA roce_hca_t.gid_index upstream in local-inference-lab/flashinfer first (keeping ROCE_ABI_VERSION = 14 unchanged so existing exported cores continue to load), then re-vendor _roce_proxy.c (not opened) byte-for-byte after the provenance header and cite the merged upstream FlashInfer commit SHA in the PR description.
  2. Missing executable test coverage for roce.rs / roce_proxy.c and unreproducible verification claims (.github/workflows/native-serving.yml:63 (not opened), 109-113; helios/src/execution.rs:16-17; helios/src/execution/roce.rs:199-221, 394-406, 408-529; docs/roce-ring.md:381-384; docs/design-review.md:247-259; AGENTS.md:103-112)

    • Behavior / impact: helios/src/execution/roce.rs is gated on #[cfg(feature = "roce")]. CI's native job omits roce, and the rdma job only runs cargo check --locked --manifest-path flare-cli/Cargo.toml (not opened) --tests --features roce,rdma. Every existing test in roce.rs:408-529 fails preflight before line 199 (and specification() sets gid_indices: Vec::new() at :397), so neither the Rust per-HCA dispatch (roce.rs:199-221) nor the new C validation loop (roce_proxy.c:538-549) is exercised anywhere. Meanwhile, both cargo test bullets in the PR description render with blanked code spans (no commands, crates, features, or pass counts), no --features roce execution is reported (required by docs/design-review.md:247-251), and the hardware claim omits commands, core ID, and results (AGENTS.md:103-112).
    • Fix:
      • Add unit tests in helios/src/execution/roce.rs that populate non-empty topology.gid_indices and directly exercise roce_create_with_gids bounds validation (NULL gid_indices, < 0, > 255—which runs at roce_proxy.c:538-549 before open_hca and requires no RDMA hardware).
      • Run and report exact commands and counts for cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features roce --lib execution::roce and the flare-cli doctor tests (plus exact hardware verification command/core/outcome details in the PR description), and ensure the commit carries a valid Design-Signed-Off-By trailer per .githooks/commit-msg:56-63.

Should Fix

  1. One-sided serving fix silently changes Fabric::gid_index / flare_heliopause.roce_gid_index() and leaves mixed-index preparation inconsistent (helios/src/execution/roce_fabric.rs:430; heliopause/src/python.rs:692-700; ignition/preparation/collectives.py:80-85; helios/native/roce_proxy.c:1259; helios/src/runtime_core/model.rs:46-59; helios/src/execution/roce.rs:147-162)

    • Fabric::gid_index changed from the host-wide rule ("3 when every active device has a RoCEv2 IPv4 GID there, otherwise the lowest index at which one does") to devices[0].1 (whichever active device sorts first by name). heliopause/src/python.rs:692-699 still documents the old rule and passes fabric.gid_index into ignition/preparation/collectives.py:83 (roce.AllReduce(..., gid_index=flare_heliopause.roce_gid_index())).
    • On a mixed-index host (e.g., roceP2p1s0f0 at 5 and rocep1s0f0 at 3, or roceP2p1s0f0 at 3 and rocep1s0f0 at 5 with empty gids/3), roce_gid_index() returns devices[0].1, causing b12x preparation to either drop the second HCA (preparing 1-rail kernels while serving opens 2 rails—inverting the exact n_rail flag-offset mismatch in roce_proxy.c:1259, undetected because RoceSpec does not record rail count) or open the second HCA at a non-IPv4 GID.
    • Fix: Pair the upstream FlashInfer PR with per-HCA gid_indices support in b12x.comm.roce.AllReduce and thread per-HCA indices through flare_heliopause into ignition/preparation/collectives.py:83. If preparation support is explicitly deferred to a follow-up, update heliopause/src/python.rs:692-699 to state the actual semantics accurately and disclose the mixed-index preparation limitation in the PR description.
  2. Doctor's terminal Warn fallback and CLI doc still assume a single host-wide GID index (flare-cli/src/doctor/spark.rs:250-256; docs/cli-design.md:1695; helios/src/execution/roce_fabric.rs:221)

    • When discover() succeeds on a mixed-index host (e.g., [3, 5]) but no active CX7 endpoint resolves a local IPv4 prefix, spark.rs:252-255 still reports "at RoCEv2 GID index {}" with only fabric.gid_index (devices[0].1), misleading operators about the second HCA's index. docs/cli-design.md:1695 ("serving's RoCEv2 GID index") and roce_fabric.rs:221 ("the GID index ... they use") are similarly singular.
    • Fix: Format uniform vs. mixed indices consistently in spark.rs:252-255 (reusing the same label helper as :187-198), and update docs/cli-design.md:1695 and helios/src/execution/roce_fabric.rs:221 to reflect per-HCA GID indices.

Subtract / Simplify

  1. Delete write-only roce_ctx_t.gid_index (helios/native/roce_proxy.c:268, 558): c->gid_index is written once (c->gid_index = gid_indices[0];) and read nowhere in the file (open_hca at :461 and connect_qp at :680 both use hca->gid_index). roce_ctx_t is opaque across FFI and not part of roce_blob_t. Remove both lines (in the upstream FlashInfer change as well) to eliminate dead, misleading state.
  2. Collapse duplicate gid_index / gid_indices storage and three unreachable fallback branches (helios/src/execution/roce_fabric.rs:224-225, 310-311, 1009-1011, 1027-1031, 1567, 1682, 1834; helios/src/execution/roce.rs:199-203, 397): discover_in always populates gid_indices 1:1 with non-empty endpoints. Keeping both fields and three silent scalar fallbacks violates AGENTS.md:188-193 ("no speculative compatibility or fallback layers") and silently masks truncated/mismatched vectors instead of failing fast. Store only gid_indices: Vec<u32> on Fabric and Topology (with a derived gid_index(&self) -> u32 accessor if heliopause still needs a scalar), validate topology.gid_indices.len() == topology.hcas.len() in RoceTransport::open preflight (roce.rs:152-180), and populate real gid_indices in the four test fixtures.
  3. Avoid dead roce_create shim in-tree and fold doctor's parallel ready_gids vec into Interface (helios/native/roce_proxy.c:587-601; flare-cli/src/doctor/spark.rs:150, 172-198, 267-273): roce_create has zero in-tree callers and duplicates the n_hca bounds check (:591-594 vs :538); if FlashInfer's Python callers switch to roce_create_with_gids when upstreaming, drop roce_create upstream too (otherwise cover it in FlashInfer's proxy tests). In spark.rs, add gid_index: u32 to Interface (:267-273) instead of maintaining a parallel ready_gids vector (:150, 179).

Nits

  1. Tighten per-HCA test coverage (helios/src/execution/roce_fabric.rs:1182-1219; flare-cli/src/doctor/spark.rs:540-578): Add a case in roce_fabric.rs where an HCA has valid IPv4 RoCEv2 GIDs at both index 1 and index 3 (pinning the per-HCA PREFERRED_GID_INDEX = 3 preference), and write a decoy IPv6 gids/3 + gid_attrs/ndevs/3 on roce1 in spark.rs:540 so the doctor test fails if it regresses to reading ndevs/3.
  2. Restore blanked inline code spans in the PR description: Multiple filenames, symbols, and both cargo test commands rendered as blanks in the PR body (AGENTS.md:134-135).

Dropped on verification