Repository navigation
fix(serving): the board's serving attribution includes the prompt cache the daemon granted — 8.7 GB of our own --cache-ram read as external and cost the M5 its second lane - #4247
Conversation
…he the daemon granted the engine — 8.7 GB of our own --cache-ram read as external and cost the M5 its second lane The M5 on fd1960e, 02:4xZ 9/20, the first bounded boot (4 of 15 minds drawn, core RSS 3.4 GB): the lane came up at 2 × 64,403 and the plan still read usable 18 GB → 1 lane at 2,048 tokens, and re-homed to it. `resources/board`: serving attributed 22.8 GB ("weights+KV resident (1 lane(s) × 64512 ctx)") while the lane's process held 27.5 GB RSS. `serving.footprint.measured`: anon_bytes 8.27 GB, host_cache_bytes 8.75 GB — the `--cache-ram` this daemon derived and handed the engine, filling over the serve's life. The attribution is the plan's arithmetic (weights + KV + compute), so the granted cache was filed as EXTERNAL, another holder's bytes, and `budget_for_replacing` (available + our measured bytes) lost it. Under the 12 GiB Eco reserve that is exactly the second lane. The same shape as the KV term (#79) and the compute reserve (G5): a cost we own, charged to someone else. Fix: `serving_footprint_fn` takes the daemon's granted cache (`served_prompt_cache_mib`, now shared behind an Arc, written at every serve) and `attribute_serving(peak, lanes, grant_mib)` — pure — adds it to the plan's peak resident bytes; nothing resident, or no lanes, charges no cache. One footprint authority, now the whole of it. Test `the_serving_attribution_includes_the_prompt_cache_it_granted`; the existing catalog resolver test passes a zero grant. Receipt: `resources/board` serving attribution ≈ the lane's RSS; `serving.plan usable_gb` up by the grant × the fill fraction; the M5 plans 2 lanes again with 4 residents. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
APPROVE — reviewed at exact head 14062d0 (checks running at read time; merge on green). The class is the one you name (#79, G5): a cost we own filed as another holder's, and budget_for_replacing losing exactly the second lane under the Eco reserve follows from the numbers (8.27 GB anon against the 8.7 GB grant). Two things I checked before saying so: (1) lanes are --parallel slots in ONE llama-server process and derived_prompt_cache_mib already sizes the single --cache-ram grant for all lanes, so charging the grant once per serve — not lanes × grant — is the right sum; (2) the stash is written at plan time (serving_daemon.rs:2901), before the new lane is up, so during a re-home the board reads the NEXT plan's grant against the OLD lane's peak until the new one is ready — transient, bounded by the settle, and it errs toward attributing more to ourselves, never less; not a condition, just what the receipt will show for one tick. Pure sum, nothing-resident charges nothing, one test pinning the M5 numbers. |
The first bounded boot (M5 on fd1960e, 02:4xZ)
The draw bound worked: 4 of 15 minds seated, core RSS 3.4 GB, lane up at 2 × 64,403. The plan still read usable 18 GB → 1 lane at 2,048 and re-homed to it.
serving.footprint.measuredThe 8.75 GB is the
--cache-ramthis daemon derived and handed the engine. The attribution is the plan's arithmetic, so the granted cache was filed as external (another holder's bytes) andbudget_for_replacing= available + our measured bytes lost it. Under the 12 GiB Eco reserve that is exactly the second lane. Same shape as the KV term (#79) and the compute reserve (G5): a cost we own, charged to someone else.Fix
serving_footprint_fn(catalog, granted_cache_mib)— the daemon'sserved_prompt_cache_mib(nowArc<Mutex<u32>>, written at every serve) — and a pureattribute_serving(peak, lanes, grant_mib)that adds the grant to the plan's peak resident bytes. Nothing resident, or no lanes, charges no cache. One footprint authority, now the whole of it.Test
the_serving_attribution_includes_the_prompt_cache_it_granted; the existing resolver test passes a zero grant.Receipt
resources/boardserving attribution ≈ the lane's RSS;serving.plan usable_gbup by the grant × fill; the M5 plans two lanes with 4 residents.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo