Repository navigation
Description
Summary
On some boots, flare_checkpoint_captures_total stays at 0 for every role and flare_graph_launches_total{kind="snapshot"} never moves, while flare_checkpoint_skips_total{reason="unknown_cost"} grows by roughly one per request.
Nothing is published to Selene, so the host prefix cache (DRAM/NVMe) never serves a hit, even though the GPU prefix cache looks healthy. The server stays in this state until restart. We believe this is at least one cause of #327 ("Prefill
ram cache fills but is never reused"). It fits the reports there: GPU hit rate stays normal, RAM hit rate is 0%, and controlled repeats pass on some boots.
User impact
- Slow turns in interleaved or resumed sessions. When a conversation's prefix is evicted from GPU KV (other sessions, concurrency, idle time), the next turn re-prefills the entire context instead of restoring it from the host tier. On our setup that's 4.5 s vs <0.1 s time to first token for a 115K-token conversation, growing with context length. Back-to-back turns of a single session still hit the GPU cache, so the slowdown seems random to users.
- Context is lost on restart. The disk tier is meant to survive restarts. With no captures, every session re-prefills from scratch after a deploy or crash.
- Throughput loss under load. Repeated re-prefill takes GPU time from other requests, which hurts most when the server is busiest and eviction is most frequent.
- Idle reserved memory. The configured DRAM/NVMe tier is allocated but never serves a hit.
- It depends on the boot. The same build and config can work on one boot and fail for that boot's whole lifetime, which makes the problem hard to notice and report.
Cause
Every optional checkpoint capture requires a fresh measured duration for the 1-token snapshot graph. That duration can only be measured by running a snapshot copy, which those same captures gate on:
checkpoints.rs(current main):checkpoint_selection_uncached(~L427),checkpoint_copy_allowed(~L730) andallocate_terminal_capture(~L791) all requireself.costs.fresh_duration(GraphKind::Snapshot, 1). Otherwise they skip
withunknown_cost.cost.rs:Estimate::fresh()requiresnanos != 0, so a never-measured graph is never fresh.cost.rs:stale_keys()also filtersnanos != 0, so the bounded refresh inpolicy.rsnever targets the unmeasured snapshot key.- The only exemption is anchor-role captures (
checkpoint_copy_allowedreturnsOk(true)forRetentionRole::Anchor). If an anchor capture happens to run early, it measures the snapshot graph and everything works. If not, nothing ever
measures it.
#285 fixed the same failure for prefill costs. Its description notes that "the fresh snapshot-copy requirement still governs optional captures" and that "initial unmeasured … shapes can still suppress optional checkpoints". #292 reported
unknown_cost skips "before their capture cost has been measured" but didn't isolate the cause.
Reproduction / evidence
DeepSeek-V4.1-Flash FP8, TP3 on SM120. The build is based on main; cost.rs and the three gate sites match current main.
- Unmodified image, empty prefix-cache store, fresh boot: after churn plus a 30K-token probe,
skips{unknown_cost}went 1 → 91. Captures stayed 0 for every role, snapshot launches stayed 0, and no root records were stored. Varying
the traffic didn't escape it: small probes, a 152K-token prompt, multi-message replays and 6 concurrent requests all failed. - Instrumentation on the same boots: the snapshot estimate read
nanos=0, observed=None, fresh=falseand never changed. - Same image, earlier boots the same day: these seeded within minutes. The anchor capture counter rose on each, consistent with anchors being the only path that measures the graph. We couldn't determine why anchors did or didn't arm
on a given boot. The fix below doesn't depend on that.
Proposed fix
Let a terminal (endpoint) capture probe the snapshot cost at most once per estimate TTL when the estimate is unmeasured or stale, and only when checkpoint_extra_work_fraction > 0. Message and anchor gating is unchanged; those captures
resume as soon as the probe records a measurement.
// cost.rs
pub fn probe_duration(&self, kind: GraphKind, tokens: usize) -> Option<u64> {
let key = Key { drafts: 0, kind, batch: 1, tokens, prefill: 0, packed: 0 };
self.entry(key).filter(|estimate| !estimate.fresh(self.now_ns, self.ttl_ns)
&& (estimate.last_attempt_ns == 0
|| self.now_ns.saturating_sub(estimate.last_attempt_ns) >= self.ttl_ns))
.map(|estimate| estimate.nanos)
}
pub fn record_probe(&mut self, kind: GraphKind, tokens: usize) {
let key = Key { drafts: 0, kind, batch: 1, tokens, prefill: 0, packed: 0 };
if let Some(&index) = self.index.get(&key) {
// Zero denotes no attempt, so a probe at time zero is recorded as one.
self.entries[index].1.last_attempt_ns = self.now_ns.max(1);
}
}
// checkpoints.rs, allocate_terminal_capture()
let fresh = self.costs.fresh_duration(GraphKind::Snapshot, 1);
let probe = fresh.is_none();
let Some(cost) = fresh.or_else(|| {
(self.policy.checkpoint_extra_work_fraction > 0.0)
.then(|| self.costs.probe_duration(GraphKind::Snapshot, 1))
.flatten()
}) else {
self.stats.checkpoint_skip_unknown_cost += 1;
return Ok(None);
};
// ... unchanged budget check and snapshot quote ...
if snapshot.is_some() {
if probe {
self.costs.record_probe(GraphKind::Snapshot, 1);
}
// ... unchanged ...
}Notes:
- The probe is recorded only after a snapshot row is actually allocated, so a storage-refused probe doesn't use up the TTL window.
- A
checkpoint_extra_work_fractionof 0 still disables all optional copies.zero_fraction_never_reserves_or_charges_extra_copy_workpasses. - New regression test
unmeasured_snapshot_cost_is_probed_by_one_terminal_capture_per_ttl: with the snapshot cost unmeasured, the first terminal capture is allocated, a second within the TTL is skipped asunknown_cost, and another is
allocated after the TTL.
Validation (same server, patched build, fresh boot, empty store)
- First request: snapshot launches, endpoint captures, publications and
root_records{tier="dram",reason="first"}all rose from 0. The unpatched image under identical conditions stayed at 0. - Exact replay: a 114,819-token prompt cold-prefilled in 4.5 s; the replay returned
cached_tokens 114,819in under 0.1 s. - After a server restart: the same replay returned
cached_tokens 114,819in 0.1 s from the disk tier. The new boot seeded on its first request. - 20-minute load: 3,396 multi-turn requests with no errors, 92.3% of prompt tokens cached.
- Anchor captures 0 → 13, message 0 → 6, endpoint 7 → 6,798.
- Root records 2 → 169.
unknown_costskips rose by only 5 over the run.
- 90-minute soak with sparse traffic: captures continued across idle gaps longer than the TTL, with no relapse.
Diagnosing this on your deployment
If flare_checkpoint_captures_total is flat at 0 while flare_checkpoint_skips_total{reason="unknown_cost"} grows with traffic, you're in this state. Client-side prompt changes and cache sizing won't affect it.
A back-to-back repeat of the same prompt won't show it either, because that hits the GPU prefix cache. Push the prefix out of GPU KV with unrelated traffic before replaying, and check the capture counters.
Happy to open a PR.
Activity
mark-yong commentedon Nov 28, 2026
This cold-boot deadlock looks specific to the SM120 TP3 fork (
AzallazA/hyperflare-inference,ba6a4c11) rather than upstreammain.On pure
NVIDIA/hyperflare-inferencemain(353551e9),PrefillTailMergeandprefill_merge_min_rows(ported into the fork from closed PR#69) do not exist:checkpoint_anchorathelios/src/scheduler/checkpoints.rs:107falls back toprompt_tokens, soanchor > startholds on a cold boot.prefill_work_throughathelios/src/scheduler/policy.rs:338stops atcheckpoint_anchor,resolve_prefill_kindathelios/src/scheduler.rs:868selectsGraphKind::TerminalPrefillat that cut onTerminalPrefillcores, andcheckpoint_copy_allowedathelios/src/scheduler/checkpoints.rs:727returnsOk(true)forRetentionRole::Anchor.mainarmsAnchorand measuresSnapshot-1-1.The
13anchor captures vs6,798endpoint captures over3,396multi-turn requests in the validation run matchesPrefillTailMergemerging pastAnchorontools=true(and underOn, non-thinkingtools=false) requests. That explains why anchors only armed on some boots; on that fork,--scheduler-prefill-tail-merge falseavoids the deadlock.Pure
mainstill has two transient, self-healingunknown_costcases after the 30 s TTL (a resumed prompt hittinganchor <= startatcheckpoints.rs:416, or concurrent anchor copies batching intobatch > 1whilefresh_durationatcost.rs:233checksbatch: 1), though neither causes a permanentcaptures == 0cold-boot deadlock. Unless this reproduces on puremainwithoutPrefillTailMerge, this belongs on the fork and can probably be closed here.flare-autobot commentedon Nov 30, 2026
The reported cold-boot deadlock—where host prefix-cache checkpoint captures remain at zero across all retention roles on an empty store and optional captures skip indefinitely with
unknown_cost—does not reproduce inNVIDIA/hyperflare-inferenceonorigin/mainat commitc146d7be.The reported DeepSeek-V4.1-Flash FP8 TP3 build and low anchor-capture ratio (13 anchor captures versus 6,798 endpoint captures across 3,396 multi-turn requests) correspond to the third-party fork
AzallazA/hyperflare-inference, which carries prefill tail-merging symbols (PrefillTailMergeandprefill_merge_min_rows) that do not exist inNVIDIA/hyperflare-inferenceatc146d7be.On
origin/mainatc146d7be, an uncached cold-boot request schedules and executes a conversation anchor capture even before any snapshot-copy timing estimate exists:consumed_tokens == 0),LiveRequest::checkpoint_anchor(helios/src/scheduler/checkpoints.rs:108-115) computes a strictly positive anchor endpoint, falling back toprompt_tokenswhen no message boundary is eligible.RequestScheduler::checkpoint_selection_uncached(helios/src/scheduler/checkpoints.rs:543-559) pushes that anchor cut (RetentionRole::Anchor) before querying fresh smallest-batch snapshot-copy timing viaActionCosts::fresh_duration(GraphKind::Snapshot, 1)at line 557.RequestScheduler::prefill_work_through(helios/src/scheduler/policy.rs:337-351) bounds prefill at the anchor cut,RequestScheduler::resolve_prefill_kind(helios/src/scheduler.rs:854-884) selectsGraphKind::TerminalPrefillon model cores that declare terminal prefill graphs (with deferred-prefill checkpoint edge cases fixed in commit0c25e88f/ PR helios: fix deferred_prefill checkpoints, shared_pages accounting, drop teardown, and >64 MiB wire prepares #613, and catalogs without terminal prefill graphs fixed in commit1364062c/ PR Restore prefix checkpoints on prefill catalogs without terminal prefill #550), andRequestScheduler::checkpoint_copy_allowed(helios/src/scheduler/checkpoints.rs:888-895) permitsRetentionRole::Anchorcopies unconditionally.ValueRate::compare(helios/src/scheduler/utility.rs:134-139) ranks unmeasured operations (duration_ns == 0) ahead of measured ones, so the subsequent snapshot phase measures the smallest declared snapshot batch queried byActionCosts::fresh_duration(helios/src/scheduler/cost.rs:264-269). Once measured, stale-key tracking inActionCosts::stale_keys(helios/src/scheduler/cost.rs:271-274) and funded timing refresh inRequestScheduler::select_plan(helios/src/scheduler/policy.rs:1238-1274) refresh the estimate after the 30-second timing freshness window (PolicyConfig::estimate_ttl_ns,helios/src/scheduler/policy.rs:38) whenever a snapshot phase runs.MessageandEndpointcaptures skip withunknown_costonly transiently when a request hits an already-cached anchor (anchor <= start) while the smallest-batch snapshot timing is unmeasured or expired. That behavior matches the freshness contract indocs/scheduling-runtime-design.md(lines 573–575) and clears on the subsequent request with an uncached anchor.No upstream code change is proposed. Adding an unconditional terminal-capture probe to work around fork-specific prefill tail-merging behavior would alter the documented freshness contract in
docs/scheduling-runtime-design.md(lines 573–575) without a demonstrated defect inNVIDIA/hyperflare-inference.Verification and limitations: This assessment is based on static source inspection of
origin/mainatc146d7beacrosshelios/src/scheduler/checkpoints.rs,helios/src/scheduler/cost.rs,helios/src/scheduler/policy.rs,helios/src/scheduler/utility.rs,helios/src/scheduler.rs, anddocs/scheduling-runtime-design.md, together with upstream commits0c25e88fand1364062c. Because no code was modified, no Rust crate tests, scheduling simulator runs, formal lifecycle checks, or GPU serving workloads were executed.Recommended disposition: Close this issue as specific to a third-party fork. If a permanent zero-capture cold-boot deadlock reproduces on unmodified
NVIDIA/hyperflare-inferencemainat or afterc146d7be, please reopen with the exact commit SHA,flare inspectoutput for the model core, launch configuration, and observed checkpoint capture and skip counters.