Explore report · NVIDIA/hyperflare-inference #628

Raw Markdown for agents: https://autobot.eidonix.com/p/2ee4dc9d-107b-4ae1-aa57-feaa4677ccae.md

Amendments to the report of 2026-11-30 (PR #628, head moved 1870a27 → 76e1813)

Key findings (amendment level)

  1. The PR moved and got substantially bigger. New head 76e18130 "helios: bound CopyEngineGate fairness, scope gating to peer-copy models, and preserve metrics" (yatesdr, 2026-11-30) answers the @flare-autobot "Changes Requested" review of 11:59 UTC. pr_files now shows 19 files, +1,165/−154 (was 14 files, +572/−72); helios/src/offload/copy_gate.rs is 584 lines (was 263). Five of my seven original findings are now closed and must not be repeated as live defects.
  2. The biggest new risk: the anti-starvation turnaround only works in the in-process loop. It depends solely on RankExecutor::can_submit (helios/src/execution/ranks.rs:181-184), and serve_rank — the multi-process/multi-host rank loop — takes the lease with no such check (helios/src/execution/parallel.rs:652-656), so offload can still starve indefinitely on RankPeers::Processes, the exact layout this same commit newly wires into the gate (flare-cli/src/cluster.rs:254-261 → helios/src/offload/shard.rs:47-61).
  3. A documented invariant is now honestly documented, but the gate's scope is understated in the docs. The new wording says the drain is "bounded in-flight 16 MiB batch" (docs/prefix-cache-offload.md:1025-1029), yet at the five GPU-codec sites the lease is held across encode/decode compute under the gpu.codec mutex (helios/src/offload/transfer/codec.rs:288-303,318-338,748-780).
  4. A stuck offload batch can now shut down the served worker. ExecutionError::Drain after 120 s (copy_gate.rs:25-28,131-147) propagates through RankExecutor::submit (ranks.rs:153-156) and Worker::submit's ? (helios/src/server/runtime.rs:2332-2339) into worker.fail_all + executor teardown (runtime.rs:759-776). Undocumented.
  5. Performance/root-cause rules still unmet and the author says so. No A/B offload figure, no gate-cost measurement; the author defers: "the new gated CUDA transfer tests and a peer-copy A/B offload latency measurement have not yet been run on 76e1813 because the SM120 test host's GPUs are currently occupied."

1. Event and timeline

2. Size / shape change (pr_files)

docs/prefix-cache-offload.md (+18/−6), flare-cli/src/cluster.rs (+2/−1), heliopause/src/python.rs (+1), helios/src/execution/{manifest,parallel,ranks,tests}.rs (+10, +11/−2, +141/−33, +1), helios/src/model/{contract,testing}.rs, helios/src/offload/{mod,shard,transfer,transfer/codec}.rs (+23/−2, +12/−1, +154/−18, +134/−61), helios/src/offload/copy_gate.rs (added, +583), helios/src/offload/transfer/lifecycle_tests.rs (not opened) (+2), helios/src/runtime_core/{mod,model,serving}.rs (+16, +23/−5, +3), helios/src/server/runtime.rs (+29/−24).

Three newly touched files materially change prior findings: docs/prefix-cache-offload.md, heliopause/src/python.rs, helios/src/runtime_core/serving.rs.

3. Original findings now CLOSED (do not restate as live defects)

  1. Documented no-blocking invariant — fixed rather than violated. docs/prefix-cache-offload.md:133-138: "Offload work never blocks the model stream, and never blocks the model worker thread except for the bounded Copy Engine drain before launching a graph that contains in-graph peer-to-peer Copy Engine nodes (Node::Copy with a Memory::Peer endpoint). Single-GPU and non-peer-copy models stay ungated." §2.10 :913-928 now describes the per-model CopyEngineGate, the 120 s bound and the fairness turns; §2.12 :1025-1029 reworded. Residual: docs/same-process-tp.md:177-180 (not opened) still lists the parked-rank/checkpoint region as not qualified and was not updated.
  2. Per-batch sync no longer applies to every prefix-cache run. NativeModel.copy_gate: Option<Arc<CopyEngineGate>> (helios/src/runtime_core/model.rs:27,662), assigned only when a rank reconstructed a peer-copy graph (model.rs:827-831, helios/src/runtime_core/mod.rs:1347-1349), threaded through Binding (offload/mod.rs:42,49,58), attach_offload (model.rs:990-996), manifests() (model.rs:1041-1047), open_with_gate (server/runtime.rs:719-731). Verified in code: copy_batch_gated syncs per batch only when Some (helios/src/offload/transfer.rs:308-338), and the ungated path keeps one record+sync at window end (transfer.rs:460-474). This closes the finding that the change opposed #497 for every prefix-cache user.
  3. Ungated-path claim now essentially true. Multi-host shard peer ranks are gated (offload/shard.rs:47-61, called from flare-cli/src/cluster.rs:254-261). Gate-less constructors remaining: open() (offload/mod.rs:114-119), join_peer (offload/shard.rs:37-45), #[cfg(test)] Copiers::new (offload/transfer.rs:2167-2171). heliopause/src/python.rs:331 still sends peer_copy_graphs: Vec::new(), but that manifest also sets offload: None (:318), so the Heliopause path can never engage a gate.
  4. CI red retracted as a blocker. The only failing check was Python CPU tests, a main-wide breakage: issue #623 (closed 2026-11-30 12:39) fixed by #624 (merged 2026-11-30 12:39, head 078315e, tests-only, +15/−25). Author reports Helios lifecycle (lifecycle + kani) passing on 1870a27; local validation claimed on 76e1813: RUSTFLAGS="-D warnings" cargo check --locked --all-targets on four crates, helios 1,740/1,740 lib tests, flare 245/245, flare-cli 201/201 + 4 integration suites.
  5. ExecutionManifest::has_peer_copies deleted; validate() now rejects a populated peer_copy_graphs whose length differs from graphs (helios/src/execution/manifest.rs:835-843 (not opened), test execution/ranks.rs:215-224). Harmless: the field is introduced by this same PR.
  6. Lease lifecycle consolidated. PeerGraphLeases (helios/src/offload/copy_gate.rs:242-305 — verified: enter, track, release_through, clear, should_drain_for_offload) is reused by RankExecutor (execution/ranks.rs:143) and serve_rank (execution/parallel.rs:563-566,652-663,692); copy_batch_gated/drain_stream deduplicated (offload/transfer.rs:290-339, used from transfer/codec.rs:997).

4. Original findings still OPEN

5. NEW risks introduced by 76e1813 (highest first)

  1. Starvation survives in multi-process TP. The only thing that lets active peer-copy leases drain to zero is RankExecutor::can_submit() returning false while should_drain_for_offload() — ranks.rs:181-184 (note #[cfg(feature = "server")]), consumed at server/runtime.rs:2261. serve_rank takes the lease on COMMIT with no such check: let guard = leases.enter(graph)?; then executor.submit(...) (parallel.rs:652-656). With 2-frame pipelining, peer_graphs_active need never reach 0, so maybe_arm_offload_wave() (copy_gate.rs:54-68, requires peer_graphs_active == 0) never fires and offload batches wait indefinitely — pre-fix starvation on the layout flare-cli/src/cluster.rs:254-261 newly wires into the gate. Correction to my own first draft: the offload wave is not revocable while armed — once turn == Offload with offload_wave_remaining > 0, a new peer graph does wait (copy_gate.rs:118-125). The surviving problem is the narrower can_submit wiring described here.
  2. The fairness test cannot catch that. offload_makes_forward_progress_under_pipelined_peer_graphs (copy_gate.rs:445-500) simulates the pause ("pause pipelining whenever should_drain_for_offload() is true") instead of driving Worker/RankExecutor, so it passes whether or not the real can_submit wiring exists; no multi-process analogue.
  3. Peer-graph drain now covers codec compute, not just a copy. The lease is acquired before the transform under the gpu.codec mutex and released after completion at all five GPU-codec sites (transfer/codec.rs:288-303,318-338,748-780; verified at :288-307 and :318-343), contradicting the docs' "bounded in-flight 16 MiB batch drain" (docs/prefix-cache-offload.md:133-136,1025-1029).
  4. The 120 s bound fails the served worker. PEER_GRAPH_GATE_TIMEOUT = 120 s (copy_gate.rs:25-28) and the ExecutionError::Drain return (copy_gate.rs:131-147) propagate through RankExecutor::submit (ranks.rs:153-156) and Worker::submit's ? (server/runtime.rs:2332-2339) into worker.fail_all + executor.close() (runtime.rs:759-776). Undocumented; the error's own counters are the only diagnostic.
  5. Reply.elapsed now excludes gate wait and feeds a scheduling heuristic. max_gate_wait subtracted in Transfers::absorb (offload/transfer.rs:780,795-798 — verified) → selene/src/memory.rs:1450-1456 → selene/src/levels.rs:57-110 → worth_fetching/worth_transfer deferral (server/runtime.rs:223-229,2805-2860). Defensible ("measure the copy"), but gate-stalled transfers then look faster and more worth doing; max-across-ranks is an approximation.
  6. Multi-process deadline interaction. In serve_rank the lease is taken before executor.submit (parallel.rs:652-657) while the root's per-frame deadline is already running (parallel.rs:670-671, parallel/wire.rs:28 (not opened) = 120 s), so a long gate wait can surface as "rank graph completion deadline expired" (parallel.rs:671) instead of the gate's Drain.
  7. The new gated verification is CI-invisible. #[ignore] on the gated codec test (transfer/codec.rs:1286-1291) and the gated transfer arm lives inside the test requiring two CUDA devices (offload/transfer.rs:1712,2013-2053). Combined with the author's "pending GPU re-run", no gated copy path has yet executed anywhere.

6. Open questions / not found