Repository navigation
Conversation
|
A case file has been opened for 672. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe per-HCA GID discovery rewrite in
Walkthrough
Merge Risk: Medium · up to
|
Signed-off-by: nepenth <16943149+nepenth@users.noreply.github.com>
c582b10 to
5fa291d
Compare
|
Addressed all review feedback and rebased onto
@flare-autobot please re-review. |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedRound 1's GID plumbing, preflight rejection, and
Walkthrough
Merge Risk: Medium · up to
|
…sert roce_devices export
|
Addressed the actionable review items from Round 2 in
Merge-order note: |
…, 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>
Summary
Fixes RoCEv2 discovery, native transport setup, preparation parity, and
flare doctoron multi-HCA Linux hosts where active RDMA devices place their IPv4 RoCEv2 GID at different GID table indices (for example,roceP2p1s0f0at index3androcep1s0f0at index5on 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.cis re-vendored byte-for-byte identically (after the 9-line header) from_roce_proxy.cin that PR.Problem
Previously,
roce_fabric::discover_inrequired 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 index3and the second rail is at GID index5, serving silently fell back to a single 100 GbE rail (or failed when the other rail was selected), andflare doctorreported only one usable CX7 device.Changes
helios/native/roce_proxy.c(byte-identical tolocal-inference-lab/flashinfer#209):gid_indexper HCA onroce_hca_t(removing the context-wideroce_ctx_t.gid_index), and usehca->gid_indexinopen_hca(ibv_query_gid) andconnect_qp(ah_attr.grh.sgid_index).roce_create_with_gids(..., const int* gid_indices, ...)with validation forgid_indices == NULLand per-HCA bounds0..=255.roce_create(..., int gid_index, ...)as a backwards-compatible wrapper delegating toroce_create_with_gids(ABI version remains14).helios/src/execution/roce_fabric.rs:PREFERRED_GID_INDEX(3) when valid on that HCA, otherwise fall back to that HCA's lowest valid RoCEv2 IPv4 GID index.gid_indexfield onFabricandTopologywith a singlepub gid_indices: Vec<u32>source of truth, addingFabric::gid_index(&self) -> u32andFabric::gid_index_for(&self, index: usize) -> Option<u32>, and validatingself.gid_indices.len() == self.endpoints.len()inFabric::topology.helios/src/execution/roce.rs:topology.gid_indices.len() == topology.hcas.len()inRoceTransport::openpreflight before touching the region, and pass the per-HCA indices toroce_create_with_gids.heliopause/src/python.rs&ignition/preparation/collectives.py:flare_heliopause.roce_devices() -> list[tuple[str, int]]returning the discovered HCAs and their per-device GID indices in name-sorted order (updatingroce_gid_index()to delegate tofabric.gid_index()with accurate docs).hca_namesandgid_indicesintoroce.AllReduceduring preparation when supported by the installedb12xRoCE runtime (local-inference-lab/flashinfer#209), falling back cleanly togid_index=flare_heliopause.roce_gid_index()on older pinned FlashInfer builds.flare-cli/src/doctor/spark.rs&docs/cli-design.md:gid_index: u32onInterface, look up each HCA's ownports/1/gid_attrs/ndevs/{gid_index}, format uniform vs. mixed GID indices viaformat_gid_indicesin both Pass and Warn paths, and updatedocs/cli-design.mdwording.Verification
Verified on ARM64 Linux (dual-CX7 GB10 host):
Byte-identity check against
local-inference-lab/flashinfer#209:helios/native/roce_proxy.clines10..EOFare byte-for-byte identical toflashinfer/experimental/b12x/comm/roce/_roce_proxy.c(0diff bytes).Rust formatting:
Result: passed (
0diffs).Unit tests (including C/FFI
roce_create_with_gidsand preflight checks):cargo test --manifest-path helios/Cargo.toml --features roce --lib execution::roceResult:
test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 1220 filtered out; finished in 0.62scargo test --manifest-path flare-cli/Cargo.toml --bin flare doctor::sparkResult:
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 219 filtered out; finished in 0.02sResult: compiled cleanly with 0 errors.
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.Hardware validation:
roceP2p1s0f0at GID3,rocep1s0f0at GID5): both rails open and serve TP2 RDMA traffic cleanly, andflare doctorreports2 of 2 active CX7 devices supply IPv4 endpoints for serving at RoCEv2 GID indices [3, 5].