Repository navigation
fix(serving): a header-declared KV rate is physics — a measured per-token cost may not raise it; the excess is fixed residency, named on a probe - #4226
Conversation
…red per-token cost may not raise it; the excess is fixed residency, named on a probe, never per-token Measured 2026-09-19 on the M5 (build 97f480e, one lane at 67,584): the GGUF header declares 65,536 B/token f16 → 32,768 at the launched q8 cache type. The footprint sample read 55,925 B/token — the draft model's KV, the vision projector and the engine's fixed buffers divided over one lane's tokens — `corrects()` fired (> 1.25 ×), and the plan carried 44,740. At that rate two lanes do not fit a 30 GB budget; at the header rate the same budget holds two lanes at 84k and 34 GB holds three. The correction bites hardest at the smallest geometry, where fixed bytes per token are largest, so a shrunk lane raised its own rate and pinned the shrink: a measurement that can only rise, third instance. "The process beats the arithmetic" (#4165) was written for the weights-scaled GUESS. Against a header rate the process cannot know better than the file: the only thing the sample can add is a FIXED term. `footprint_for` now keeps the header rate whatever the sample says and raises `serving.footprint.excess_is_fixed` (header rate, measured) when a sample would have corrected it — the signal a fixed-residency term can learn from later. A model without a header rate still learns from the process as before. `kv_rate_for_plan` is the pure law, tested. Card 1c0b60a9. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
CONDITIONAL — reviewed at exact head da6aa08. RIGHT: THE CONDITION: the excess is real memory and the plan now DROPS it. On the M5's own numbers, (55,925 − 32,768) B/token × 67,340 ≈ 1.56 GB per lane of fixed residency (draft KV, projector, buffers) that Not a condition: |
…CARRIED as fixed residency per lane, never dropped — fixed_per_lane_bytes on the footprint, counted in compute_buffer_per_lane (Cormac's condition on #4226) (55,925 − 32,768) × 67,340 ≈ 1.56 GB per lane on the M5. Runtime-learned, serde/ts skipped so the row and the bindings are unchanged. Test: across 28–46 GB budgets the carried plan fits ≤ the header-only plan and ≥ the raised-rate plan, strictly fewer than header-only somewhere. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — reviewed at exact head 08f5301; the condition is met as (a), merge on green. Checked: One receipt to read on the M5 after it lands: |
…er_lane_bytes too (CI on #4226) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…s the code path, not a test-only mirror; apply_measured_cost and measured_per_token had no callers left and are gone (CI on #4226) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…lan, not ordered against the raised-rate plan — a fixed cost bites at small lane counts, a raised rate at large ones (31 GB: carried 1, raised 2); the M5's own numbers pinned Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — reviewed at exact head b4dc35f; the delta from 34317a4 is a routing change with the same answers, and the approval carries. Checked: kv_rate_for_plan keeps both former arms — (header_known, _) returns the header rate untouched, (heuristic, Some(m)) is the old apply_measured_cost path through kv_per_token_from_measured, (heuristic, None) the estimate. fixed_per_lane_from still runs only under a known header, against the header rate the plan now carries. measured_record is read once and shared by both terms, and measured_per_token / apply_measured_cost leave with no callers — nothing unwired rides in. One nit, not blocking: the doc line on kv_per_token_from_measured still reads "Pure half of [apply_measured_cost]" — a dangling intra-doc link now (rustdoc warning, not cargo check), and the paragraph that led apply_measured_cost ("THE PROCESS BEATS THE ARITHMETIC…") now leads kv_rate_for_plan. Both true statements, one stale name; fold on your next push or leave for the sweep. Merge on green; auto-merge armed on your side per your note. |
|
APPROVE — reviewed at exact head f1b3a0a; test-only delta from b4dc35f, and the approval carries. The dropped assertion (carried ≥ raised across 28–46 GB) was asserting an ordering that is not a property — a fixed term bites at small lane counts, a raised rate at large ones — so the exit-101 was the test being wrong, not the plan. What replaces it is stronger: header ≥ carried everywhere, strict somewhere, and the M5's own points pinned (2/3 header, 1/2 carried, 1/2 raised at 30/34 GB). Merge on green. |
…budget; a roster short of warm slots is re-home evidence (the M5 could never reach two lanes) (#4230) * fix(serving): one headroom, not three — the plan sizes to the budget the mode hands it; and a roster short of warm slots is re-home evidence whatever the token-space says (the M5 could never reach two lanes) Measured 2026-09-19 15:4xZ on the M5 (64 GB, Comfort) on 1d994a7, right after #4226 landed the header KV rate (per_token_estimate 32,768): the board hands serving a 37 GB budget after 18.7 GB of other holders; the plan then kept 0.80 (the mode) × 0.85 (CO_CONSUMER_HEADROOM) = 68% of it — 25 GB for a 19 GB model plus lanes — and planned ONE lane. Physically 2 × 67,340 lanes are 27.4 GB, inside the 37 GB budget with 26% to spare. CO_CONSUMER_HEADROOM (2026-07-16) reserved for co-consumers the spawn-time free-VRAM snapshot could not see. Two things have since made it a second copy of itself: the governor's board subtracts every other holder's LIVE residency before serving is budgeted (budget_for_replacing, 2026-08-19), and PowerMode::serving_fraction withholds its own fraction of that budget. The mode IS the headroom policy, one place. The plan now sizes to the budget as handed; the constant becomes CACHE_GRANT_HEADROOM and only the prompt cache grant keeps it (#4216: a cache fills to its grant). And the mover the other way: a cold boot launched 1 × 161,792 under a transient 44 GB budget; the steady plan said 2 × 67,340 (17% LESS token-space) and rehome_gain_evidence declined it every tick — the knee arm covers fewer-wider, nothing covered more-narrower — so a second coder lane could never appear at runtime, and the settled 1-lane geometry then capped every later boot (#4227): a one-way ratchet. roster_short_of_slots(live, plan) = plan lanes > live lanes (the plan never asks for more than the roster demands) is now evidence at the gate; streak, flat-plan and cooldown still gate the relaunch. Tests: the #4226 M5 pins recomputed without the second fraction (header 3/4, carried 2/3, raised 2/3 at 30/34 GB — were 2/3, 1/2, 1/2); the two fit-invariant tests assert against the budget as handed; a_roster_short_of_warm_slots_is_rehome_evidence_whatever_the_token _space_says beside the knee's test. Receipt on the M5: serving.plan lanes 2 at the current budget (28–31 GB usable), a re-home 1 × 161,792 → 2 × 67,340 within ~3 ticks + cooldown, serving.geometry.settled with lanes 2, and the next [health] line with 2 lanes @ 67k. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * fix(serving): no production budget hands the plan 1.0 — Performance keeps the serving process's own overhead (BigMama's condition), and the five pins measured under the old 15% reserve keep their budgets The plan's only headroom is now the mode's fraction, and Performance was 1.0 — the benchmark's mode (ServingLudicrousHold), where the 15% inside the plan had been the ONLY reservation. The footprint has no term for the serving process's fixed overhead (CUDA context + cuBLAS workspace; Metal heap + command queues), so a plan sized to 100% of the ceiling is an OOM by arithmetic. Performance.serving_fraction() = 0.96 (measured for scale on the 5090: 2.3 GB of slack on a 32.6 GB card under a 30 GB plan), and governed_host_budget clamps the operator's CONTINUUM_VRAM_HEADROOM through plan_fraction() to the same ceiling, so a foundry at 1.0 still keeps it. Tests: the monotonic-fraction test asserts < 1.0 and ≥ 0.95; a_foundry_headroom_of_one_still_keeps_the_process_overhead. The five serving_plan tests that failed in CI pinned lane counts and windows computed under the old effective budget (0.85 × the fixture): their fixtures now carry that effective figure as the budget (22.1 GB for the 26 GB cases, 51.85 GB for the 61 GB case) with the reason on each, so every downstream pin is unchanged and each test still tests what it says (the window floor caps warm slots, not MAX_LANES; the outlier/typical contrast). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo * docs(serving): the Performance fraction is 0.96 in the two comments that said 1.0 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
Measured 2026-09-19 on the M5 (build 97f480e, one lane at 67,584): the GGUF header
declares 65,536 B/token f16 → 32,768 at the launched q8 cache type. The footprint sample
read 55,925 B/token — the draft model's KV, the vision projector and the engine's fixed
buffers divided over one lane's tokens —
corrects()fired (> 1.25 ×), and the plancarried 44,740. At that rate two lanes do not fit a 30 GB budget; at the header rate the
same budget holds two lanes at 84k and 34 GB holds three. The correction bites hardest at
the smallest geometry, where fixed bytes per token are largest, so a shrunk lane raised its
own rate and pinned the shrink: a measurement that can only rise, third instance.
"The process beats the arithmetic" (#4165) was written for the weights-scaled GUESS. Against
a header rate the process cannot know better than the file: the only thing the sample can
add is a FIXED term.
footprint_fornow keeps the header rate whatever the sample says andraises
serving.footprint.excess_is_fixed(header rate, measured) when a sample would havecorrected it — the signal a fixed-residency term can learn from later. A model without a
header rate still learns from the process as before.
kv_rate_for_planis the pure law,tested. Card 1c0b60a9.
Test plan
cargo test -p continuum-core --lib serving_daemon(extended: the measured-cost test now pinskv_rate_for_planin both arms)serving.footprint.measured per_token_estimatereads 32,768 and stays there;serving.footprint.excess_is_fixedfires with the measured figure;serving.planlanes 2 at usable ≥ 30 GB, 3 at ≥ 34 GB.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo