Explore scratchpad · NVIDIA/hyperflare-inference #698

Raw Markdown for agents: https://autobot.eidonix.com/p/7c0968ec-d13b-4205-81d8-e67a5f0f82e6.md

#1 [high] Research summary

Case file for PR #698 (ebfio, open, ready for review, 1 file +52/−31, no reviews, no CI, no comments).

Key findings a reader cannot get from the description

  1. The claimed test command does not exercise the changed file. helios/src/server/runtime.rs is only compiled under #[cfg(feature = "server")] (helios/src/lib.rs:30-31), but the validation runs cargo test -p flare-helios --features runtime-core ("1243 passed"). Nothing in that run builds the modified module, so the only stated evidence for the new control flow is compilation-free. The suggested command in the Verification section (cargo test -p helios ...) is also the wrong package — the crate is flare-helios (helios/Cargo.toml:2), so as written it fails. No regression test is added; the deadlock itself is GPU-only and the author states no fresh GPU startup reproduction was run for the submission (evidence is the reporter's original GB300 trace).
  2. Error-path drained semantics are not symmetric with the code the comment points at. On RankExecutor::new failure the new code calls let _ = store.close(); and returns Shutdown { drained: true } (runtime.rs:697-706), discarding a close error; Worker::close_store in the same file instead sets drained = false and records the error when store.close() fails (runtime.rs:1354-1362). Likewise the new offload-open failure path returns drained: true unconditionally (runtime.rs:684-690), where the old code derived drained from executor.close(). The comment claims "exact LIFO-symmetric" startup/shutdown; the failure branches are not identical in what they assert to the caller about releasing prepared resources.
  3. std::mem::forget(store) on an undrained shutdown (runtime.rs:721-723, :791-793) is a new deliberate leak of the store to keep registered slabs alive — the same intent as the ManuallyDrop handling at runtime.rs:1348-1352, but reached through a different mechanism than close_store.
  4. One description step could not be confirmed in the tree. The description's cause #1 says helios/src/runtime_core/mod.rs defers the kv_codec_gpu cubin load during Prepare kernels; runtime_core/mod.rs contains no reference to kernels/codec modules, and I could not locate the definition of NativeResources::prepare_kernels anywhere under helios/src (only call sites: runtime_core/model.rs:821, runtime_core/event_tests.rs:115 (not opened), phase name at model.rs:819, startup.rs:79 (not opened)). The rest of the chain is verified (below).
  5. This fixes a regression introduced 7 days earlier by merged PR #504 (pure-CUDA GKV1/ZKV1 lossless compression, yatesdr, merged 2026-11-25), which added gpu_codec.rs, the embedded cubin, the offload::open call in ModelRuntime::start, and changed helios/src/server/runtime.rs (+5/−2). That review thread already carried an Autobot blocker about GPU codec module/workspace teardown requiring the rank's context to be current (gpu_codec.rs:332-345, :183-193), i.e. the same context-currency class of problem.

The change (verified from the diff and head files). crate::offload::open(prepared, gpu_cubins, copy_gate) moves from after RankExecutor::new to before it (new block runtime.rs:663-691), now reading manifest.offload directly instead of executor.manifest().offload; plus LIFO cleanup on the three later early-error paths (:697-706, :714-726, :784-796). Undeclared side effect: worker_metrics.codec_placement(...) and the prepared.intake_warning() stderr warning now fire before executor construction (log ordering change). Verified that taking the offload payload early is safe for RankExecutor::new, which only reads manifest.offload…copy_gate() (execution/ranks.rs:127), and copy_gate is a separate clone-able field (offload/mod.rs:58-60).

Mechanism, verified. RankExecutor::new → GraphExecutor::new → finish_startup, which calls control.start()? on the first persistent worker (execution/transport.rs:793-808); offload::open (offload/mod.rs:135-144) spawns flare-offload-{rank} threads (offload/transfer.rs:602-636) whose RankWorker::open calls stream.load_module(cubin) (offload/transfer/gpu_codec.rs:282) → cuModuleLoadData (cuda.rs:1140-1155, symbol cuda.rs:294). So the described same-context, kernel-active-during-module-load ordering is real in code.

The why / related work. No linked issue; the only report is the PR body itself (GB300 SM103, CUDA 13.2, gdb backtrace in cuModuleLoadData, >400 s hang, 0.6 s after). Origin: #504; earlier closed attempt #492. Same-area: #628 (merged, CE gating during peer-copy graphs), #607 (merged, offload lifecycle bugs), #579 (merged, "TP startup drain hang" — same startup/drain region), #625 (merged, offload startup timings), #640 (open, original-el8, persistent workers on rank 0 of local multi-rank cores — overlapping persistent-worker startup ordering, threaded.rs finish_startup), #674/#694 (open, yatesdr, same files). Not the same bug: #534 (checkpoint captures deadlock, judged fork-specific), #627 (closed, TP2 peer-CE deadlock). Several unrelated open PRs touch other regions of runtime.rs (#692, #697, #691, #548-#560, #483, #576).

Recent activity. Commit lookup for helios/src failed with a git error (packet and search_history both), so I could not get commit-level authorship/dates; area ownership is inferred from PRs: yatesdr owns offload/selene (#80, #92, #141, #504, #628, #674, #694), lukealonso (priority contributor per charter) owns startup/shutdown deadlock fixes in this file (#579, #607, #619, #620, #626), plus FujitsuPolycom and jcartu. This PR builds directly on #504 and conflicts with it in no textual way but reverses no work.

People. ebfio: FIRST_TIME_CONTRIBUTOR, 0 merged PRs, 2 open (#699 /dev/shm MemAvailable, #682 RemoveIPC docs), both opened the same day as #698 — no prior history in this code, not on the charter's priority list.

Community. No comments, reviews, reactions; no labels; head 9ed34da, base main; opened and last updated 2026-12-02 (age < 1 day).

Project fit. Lines up: root-cause fix rather than a swallow/retry (charter: "Bug fixes need to address the root cause… #397"); no new flags or per-model branches; description has all four parts the charter expects. Tensions/open ends: the admitted remaining GKV1 contention with cooperative decode graphs on SM103 Green Context cores (model.rs opens the codec stream on rank.execution_context()) sits on a hardware target the charter names (SM103/SM120/SM121), and the changed file's test coverage claim doesn't hold (finding 1).

Reach. All flare run startup when prefix-cache offload is configured — not only GPU compression: the reordered offload::open and the new cleanup run for every offload configuration (store is None only when offload is absent). Affects operators of persistent-worker cores on SM103/120/121 with --lossless-kv-compression gpu; no defaults, config keys, or dependencies change; no docs touched.

Not verified / left open: whether any existing server-feature test (helios/src/server/runtime/phase_tests.rs (not opened)) covers startup ordering; docs coverage of startup/shutdown ordering; and the actual prepare_kernels deferral code from cause #1.

#2 [high] Change: what PR #698 actually does in helios/src/server/runtime.rs

PR #698 (ebfio), head 9ed34da, base main, state open/ready-for-review, 1 file +52/−31, all in helios/src/server/runtime.rs (pr_diff result 1).

What it does, verified at head:

Undeclared side effects:

Safety of taking the payload early, verified: RankExecutor::new only reads manifest.offload.as_ref().and_then(|b| b.copy_gate()) (helios/src/execution/ranks.rs:127) and copy_gate is a separate Clone field (helios/src/offload/mod.rs:58-60, 78-83), so a taken Prepared does not disturb it. Binding::sharded()/inputs() used at runtime.rs:608-611 also run before.

#3 [high] Claims and evidence: the cited test command cannot compile the changed file

Evidence claims in the PR body vs what backs them:

#4 [high] Mechanism: verified call chain from RankExecutor::new to cuModuleLoadData

Verified in-tree chain backing the PR's diagnosis:

  1. RankExecutor::new → for peers None → GraphExecutor::new (helios/src/execution/ranks.rs:123-145, 138-139).
  2. GraphExecutor::new → new_unstarted then finish_startup (helios/src/execution/transport.rs:604-611).
  3. finish_startup calls control.start()? on manifest.persistent_workers.first() — launching the persistent worker kernel (helios/src/execution/transport.rs:793-808; error text "persistent worker requires green-context runtime control").
  4. crate::offload::open(prepared, gpu_cubins, copy_gate) → flare_selene::offload::open(..., &transfer::Copiers::with_gate(...)) (helios/src/offload/mod.rs:135-144).
  5. Transfers::start_parts spawns one thread named flare-offload-{rank} per rank (helios/src/offload/transfer.rs:533-656, thread at :602-636) and blocks on ready.recv() until RankWorker::open succeeds (:642-652).
  6. RankWorker::open → GpuRankCodec::new → stream.load_module(cubin) (helios/src/offload/transfer/gpu_codec.rs:268-283), which is cuModuleLoadData (helios/src/cuda.rs:1140-1155, driver symbol at cuda.rs:294). So flare-model blocks in step 5 on flare-offload-0 while step 3's kernel is resident on the same context — the described ordering exists in code.

NOT confirmed: the PR's cause #1 ("helios/src/runtime_core/mod.rs defers loading the embedded kv_codec_gpu cubin during Prepare kernels"). helios/src/runtime_core/mod.rs has no kernels/codec/module references, and I could not find the definition of NativeResources::prepare_kernels under helios/src — only call sites helios/src/runtime_core/model.rs:821 (rank.prepare_kernels(path, core, &phase, codec_gpu_module.as_deref())) and helios/src/runtime_core/event_tests.rs:115; phase name "Prepare kernels" at model.rs:819 and startup.rs:79. Cubin selection/embedding side is confirmed: codec_gpu_module resolution and per-rank cubin read at model.rs:628-658 (gpu_codec_cubins), accessor model.rs:1093-1094. Note: cubin image loading is deferred, but the module is embedded per rank in the core; the deadlock does not require reading the file, only the cuModuleLoadData on the shared context.

#6 [high] Related work: #504 introduced the hazard; #492/#628/#607/#579/#625/#640/#674/#694 same area

Origin (the change this one repairs):

Same code, overlapping:

Not the same bug (checked and excluded):

Nothing found that is competing with, stacked on, or undone by #698; it supersedes nothing and is not superseded.

#11 [high] Reach: every offload-configured startup, not only GPU compression; error-path drain semantics

Who/what is affected:

Error-path asymmetry (worth a reviewer's attention, verified):

#5 [medium] Why: no linked issue; the only report is the PR body itself (GB300, gdb, >400 s hang)

#7 [medium] Recent activity: commit history for helios/src unreadable; area ownership inferred from PRs

#8 [medium] People: ebfio first-time contributor, 0 merged; area owners yatesdr/lukealonso

Author:

Who usually works here (from items_touching on helios/src/server/runtime.rs and helios/src/offload/mod.rs):

#10 [medium] Project fit: aligns with charter root-cause rule; SM103 contention left open; test claim doesn't hold

Charter (read_charter, result 3) mapped to #698:

#9 [low] Community: zero engagement, no labels, no CI, under a day old

#12 [low] Process: ready for review, no CI, no review, wrong package name in suggestion