Repository navigation
Description
Setup
- Flare
972e28e, built from source with one metrics-only patch (adds amodel_namelabel to/metrics). - DeepSeek V4.1 Flash 1017 (
gb202payload package), 4 × RTX PRO 6000 Blackwell (SM120), TP4. --scheduler-policy throughput --mtp-draft-tokens 7 --mtp-adaptive-verification --prefix-cache-memory 60G --prefix-cache-disk <dir> --prefix-cache-disk-limit 800G- Traffic: agentic coding sessions (long shared prefixes, prompts up to ~165k tokens), ~21k requests/day.
What happens
When a request's prefix is found in the host cache, roughly 30 % of those hits are thrown away because the restore does not fit in GPU KV pages at that moment. The request is then admitted without the restore and the whole prefix is prefilled again.
Last 24 h, flare_host_cache_lookup_outcomes_total:
| reason | count |
|---|---|
| no_match | 14023 |
| admitted | 4068 |
| capacity_rejected | 1724 |
| cost_rejected | 73 |
So 1724 of 5792 usable hits (30 %) end up as full recomputation, often of long prefixes. That is exactly the work the host cache exists to avoid.
Where it comes from
helios/src/server/runtime.rs, admission with a host-cache hit:
let admitted = match scheduler.admit_planned(spec.clone(), plan, Some(inbound)) {
Ok(admitted) => admitted,
Err(Error::Admission(AdmissionError::Capacity(_))) => {
let handle = scheduler.admit(spec)?;
scheduler.record_host_lookup();
return Ok((handle, Some(LookupOutcome::CapacityRejected)));
}
...ensure_resources (helios/src/scheduler.rs) returns Capacity for two different reasons:
- "request resources are awaiting GPU retirement": enough pages exist but are still fenced.
- "live request resources are exhausted or awaiting GPU retirement": nothing more can be evicted.
In both cases the hit is dropped right away. The plain admit(spec) fallback then succeeds, so the request was admissible. It just could not take all the restore pages at once.
The rejections don't only happen when the pool is empty. Bucketing the 24 h by the minimum of flare_free_kv_pages in each 5-minute window:
| min free KV pages (5 min) | capacity_rejected |
|---|---|
| 0–10 | 495 |
| 11–100 | 332 |
| 101–1000 | 417 |
| > 1000 | 480 |
(The gauge is sampled, so short dips may be missed. Still, a good share happens with plenty of free pages, which points at fenced pages awaiting retirement and/or restores larger than the instantaneous free set.)
Suggestions (any of these would help)
- Split the outcome: count the two
Capacityreasons separately (capacity_pending_retirementvscapacity_exhausted), so operators can tell them apart. - Defer instead of dropping on "awaiting GPU retirement": keep the request queued with its hit and retry admission once the fenced pages retire, rather than falling back to a full prefill.
- Partial restore: if only part of the hit fits, restore the longest prefix that fits and prefill the rest.
Happy to test a patch on this setup and report the before/after counters.
Activity
original-el8 commentedon Nov 13, 2026
Categorized as P2 cache performance investigation. Main
97cfeb00still falls back from a capacity-rejected host restore to ordinary admission inhelios/src/server/runtime.rs; recent cache changes do not by themselves establish closure.Distinguish pages awaiting retirement from a restore that cannot fit before choosing queued retry or partial restore. Verify that a proposed change preserves request progress, checkpoint pin lifetimes and cancellation under pressure. The sampled free-page gauge cannot establish instantaneous restore capacity.
original-el8 commentedon Nov 18, 2026
Main now contains a targeted change for this mechanism: #298, merged as 29192ef. In server/runtime.rs, a capacity-rejected host restore can wait while resource holders are in flight, with the wait bounded by the estimated advantage over prefill, instead of immediately abandoning the hit. That supersedes my earlier source observation at 97cfeb0. Marking this for verification against the original workload: compare lookup outcomes, restored tokens, cancellations and request progress under the reported memory pressure. #327 is a separate fresh report of zero host reuse and must not be treated as resolved by the merge. No hardware reproduction was run for this update.
yatesdr commentedon Nov 19, 2026
Main now waits for an in-flight restore instead of rejecting it: #298 (29192ef) added
RestoreWait(helios/src/server/runtime.rs:217), with the wait capped at half the estimated prefill saved. A hit is still dropped when nothing in flight can free the needed snapshot row, when the wait budget is too small, or when the wait expires.@alejandroed, could you rebuild at main (1f1aec7 or later) and run it with the same flags, host and traffic for 24 hours, then post from
/metrics:host_cache_lookup_outcomes_totalvalues;free_snapshots,snapshot_backing_pagesandfree_kv_pages, sampled once a minute.If the capacity-rejected share of usable hits falls well below 30%, this closes as fixed by #298; if not, those readings show which case remains. Without a reply in 21 days, this issue will be closed.
alejandroed commentedon Nov 19, 2026
Thanks. One data point before the 24 h run: f9aec99 (which includes #298), same host and flags, two short windows yesterday.
capacity_rejecteddropped to 0 as expected, butcost_rejectedrose from a few % of usable hits to 64/83 and 82/83, and latency under concurrency regressed: with 8 / 32 concurrent mixed requests, p50 went from ~2.5 s / ~7.5 s on 972e28e to 5–9 s / 23–40 s, with whole batches stalling ~40 s (max 95 s). Single-request latency and MTP acceptance were unchanged. Is a request that gives up onRestoreWaitcounted ascost_rejected? The stalls look like batches waiting on a restore.I'll rebuild at current main and first check latency under load in a short window; if it no longer stalls, I'll run it for 24 h and post the four counters and the per-minute gauges.
yatesdr commentedon Nov 19, 2026
No. A request that stops waiting is counted as
capacity_rejected, both at f9aec99 and on current main (helios/src/server/runtime.rs, line numbers from main 1a53275):cost_rejectedis recorded only when no hit the lookup returns passesflare_selene::worth_fetching(2746-2749); the request is then admitted without the host cache.RestoreWait::deferkeeps the request queued while resources are in flight, the transfer is still worth it with the wait added, and the wait plus the estimated transfer time stays under half the prefill time of the restored tokens (RestoreWait::deferat 223-235, called at 2768-2772). Once that budget is spent, the request is admitted without the host cache and recorded ascapacity_rejected(2774-2777).One interaction matters for your numbers: each admission attempt of a queued request repeats the lookup and the
worth_fetchingcheck, and a hit'sestimated_secondsis computed from the measured inbound rates (selene/src/composite.rs:357). A request that waited and is then counted ascost_rejectedon a later attempt therefore failed the cost check at that attempt, not the wait budget.alejandroed commentedon Nov 25, 2026
24 h on main 1a53275 (built with only our metrics-label patch), same flags, same traffic source, 2026-11-19 09:28Z → 2026-11-20 09:22Z, no restarts.
Two differences from the original report, so absolute counts are not directly comparable: the machine now has full PCIe x16 links to the four GPUs (it was moved on 11-17), and traffic was lower (~12.5k requests vs ~30k on a normal weekday). For reference, a 24 h window on 972e28e from 11-16:
host_cache_lookup_outcomes_totalSo
capacity_rejectedwent from ~36 % to ~6 % of usable hits, which looks fixed by #298 to me. One thing I can't explain:cost_rejectedis now 22 % of usable hits (71/323), up from ~1 %, while the histograms average 0.47 s estimated transfer against 23 s estimated prefill. If that's not expected, I can dig into it.Gauges, sampled once a minute (1434 samples):
free_snapshotssnapshot_backing_pagesfree_kv_pagesLatency: the ~40 s stalls we saw on f9aec99 did not show up on main. A short 8/32-concurrency check at the start matched 972e28e, and over the 24 h, time to first token for prompts ≥ 20k tokens was p50 0.3 s / p90 2.5 s.
Per-minute gauges (CSV, UTC, max over the instance)
yatesdr commentedon Dec 3, 2026
Thanks for the 24h follow-up confirming
#298broughtcapacity_rejecteddown from 36.5% to 5.9% and cleared the concurrency stalls.Both remaining anomalies in your Nov 25 data are directly addressed by #674:
snapshot_backing_pagessitting at 111k–125k (leavingfree_kv_pagesat 1–361): Caused by snapshot alias plane over-exclusion (Snapshot aliasing admits only the largest cache plane, so a snapshot excludes ~3.16x its own page cost #451).#674replaces the single-plane rule with midpoint-ordered exact half-width alias packing (plan_mapping_handles) plus pressure-aware eviction (evict_for_pressure), cuttingsnapshot_backing_pagesby 59.6% and increasingsnapshot_capacity2.50× onDeepSeek-V4.1-FlashTP4.cost_rejectedrising to 22% despite 0.47s avg transfer vs 23s avg prefill: Caused by the noisy wall-clockprefill_rateEMA.#674replaces it with read-only scheduler graph-timing pricing (estimate_prefill_delta_ns) paired with separate per-sourceRowRestoreLatencytracking, and keeps host/pool lookups active when a deeper prefix can extend a partially resident GPU prefix.Once
#674merges, re-checking those counters on the same workload should confirm both are resolved and we can close this out.