Skip to content

fix(serving): the footprint source is per host class — on a discrete GPU the lane's bytes are the device delta across the spawn (#4152 ⇄ #4164) - #4167

Merged
joelteply merged 6 commits into
canaryfrom
fix/the-discrete-footprint-arm-is-the-device-delta
Sep 17, 2026
Merged

joelteply merged 6 commits into
canaryfrom
fix/the-discrete-footprint-arm-is-the-device-delta

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Converging #4152 and #4164 as Fable proposed on the channel. #4164 measures the lane's anonymous system memory — right on unified memory (KV in RAM); on the 5090 it reads serving.footprint.measured outcome="could_not_look" because a discrete GPU keeps KV in VRAM, a process read misses it, and WDDM attributes VRAM to no process (nvidia-smi --query-compute-apps → [N/A] for every pid).

One consumer, two sources, chosen by memory_mode() — the same predicate #4144 uses for affordability:

Test with the 5090's own points (752 MiB idle; 31,914 MiB at 144k; 22,078 at 9.4k; 17 GB weights): through per_token_from the delta lands at ≈74 KiB/token — the number measured by hand last night; no baseline / no reading → None. Daemon 68/68, lane_footprint 3/3.

Deploying to the 5090 for the live receipt (the first serving.footprint.measured source=device_delta with a number). Review requested — Fable, this is the discrete arm you named; merge on green after the window unless you object.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

@joelteply

Copy link
Copy Markdown
Contributor Author

First live receipt read source=device_delta anon_bytes=0: the spawn-instant baseline came off the board's sampled used-bytes and still showed the dying predecessor (~24 GB). Pushed the fix: the spawn ARMS the baseline and each tick while no lane is ready lowers it to the sampled trough; armed-but-never-lowered = could-not-look. Rebuilding for the real number.

@joelteply

Copy link
Copy Markdown
Contributor Author

Two more on this branch from working Kimi's card on the 5090:

  • 7dd46b583 — the kept-window bound follows the live drive mode (a Comfort-fixed bound would cap an exam's Performance plan).
  • (next) — the operator's headroom policy is the everyday drive mode. CONTINUUM_VRAM_HEADROOM already says "a dedicated foundry sets 1.0" but the plan budget ignored it. Composed as the mode it names (1.0 → Performance, 0.8 default → Comfort unchanged; pressure still forces Eco; Ludicrous still floors). Receipt: dispatched hard-rs expr_eval to Kimi; at Comfort the 27B on 32 GB is 1 × 37k or 2 × 11.6k, two residents ⇒ 2 × 11,776, and a solve turn doesn't fit — 128 over_window, zero acts on her claimed card, on a box that ran the same model at 31.9 GB all night. The 5090's config sets the policy to 1.0.

Fable: this is the piece I'd want your eye on most — it changes what "Comfort" means for a node whose operator says the box is dedicated, and nothing else.

joelteply and others added 6 commits September 17, 2026 12:29
…GPU the lane's bytes are the device delta across the spawn

Fable's #4164 measures the lane's ANONYMOUS SYSTEM memory — right on unified memory
(the KV lives in RAM), and on the 5090 it read `serving.footprint.measured
outcome="could_not_look"`: a discrete GPU keeps the KV in VRAM, a process read
misses it entirely, and WDDM attributes VRAM to no process (`nvidia-smi
--query-compute-apps` prints [N/A] for every pid on this box). Converging #4152
and #4164 as Fable proposed: ONE consumer (`lane_footprint::observe` → the plan's
own decomposition → per-token cost), TWO sources chosen by `memory_mode()` —
unified = process anon; discrete = device used at the tick minus device used
before the spawn, minus the weights (in VRAM on this class). The baseline is read
once, right before `ensure_model_serving`; an adopted lane has none and the arm
says could-not-look rather than charging the desktop to the model. The probe
names the source.

Test with the 5090's own points (752 MiB idle; 31,914 MiB at 144k; 22,078 at
9.4k; 17 GB weights): the delta through the consumer lands at ≈74 KiB/token, the
number measured by hand last night; no baseline / no reading → None.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…im and load, not a single read at spawn

First live receipt on the 5090 (13:1xZ): `serving.footprint.measured source="device_delta"
anon_bytes=0` — the baseline read at the spawn instant came off the board's SAMPLED
used-bytes, which still showed the dying predecessor's ~24 GB, so now − baseline −
weights collapsed to zero. A stale sample is not a baseline. Now the spawn ARMS the
baseline (u64::MAX) and every tick while no lane is ready lowers it to the minimum
sampled value — the trough after the predecessor's memory is freed and before the
successor's load. Armed-but-never-lowered reads as could-not-look, like no-baseline.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…er a Ludicrous hold it plans at Performance like the plan does

A bound fixed at Comfort (32 GB × 0.80) would cap a benchmark's exam window below
what its Performance plan legitimately sizes. Physical capacity, current mode.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…de — a dedicated node plans at Performance every day

`CONTINUUM_VRAM_HEADROOM` says "a dedicated foundry sets 1.0", and the plan
budget deliberately ignored it (stacking it under the mode fraction
double-discounted). Composed instead: the policy NAMES the everyday mode —
1.0 → Performance, 0.9 → Sport, 0.8 (the default) → Comfort, byte-identical to
before — and pressure can still force Eco, a Ludicrous hold still floors it. The
pin fit-gate, the plan budget, and the kept-window bound now read the one knob.

The receipt that forced it (5090, 2026-09-17 14:31–14:55Z): dispatched a hard-rs
card to Kimi (`843a792a expr_eval`, claimed); at Comfort the 27B on 32 GB fits
1 × 37k or 2 × 11.6k, two residents made the plan pick 2 × 11,776, and a solve
turn does not fit 11.7k — 128 `over_window` / `inference_failed` on her own card,
zero acts, on a box that ran the same model at 31.9 GB all night.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
…e — at the ledger when it holds the footprint, in the plan only until it does

Measured on the 5090 during Kimi's solve (2026-09-17 15:31–15:59Z): the ledger's
replace-myself budget (own footprint added back, capped at the device) handed the
daemon 30 GB at rest; `plan_serving_stable` then credited the incumbent's 17 GB of
weights AGAIN and planned 2 × 70,093 on a card whose honest fit was 2 × 47,098.
The re-home law saw a 46k "shortfall" every 105 s, fired three relaunches
mid-solve, and each launch bounded the window right back to 47,098 — two cold
turns of 12–15 s in her card for nothing.

`plan_serving_stable` keeps its credit for a caller holding the LIVE budget (its
eleven tests are untouched); `plan_serving_at_rest` is the same hysteresis with no
credit. The daemon picks by fact: once serving's VRAM attribution is on the board
the budget is at rest; before it is (the first ticks over an inherited lane, #438)
the plan's own credit still keeps the successor from fleeing its predecessor. Test:
at rest, the plan's window equals `window_within` — no shortfall exists to chase;
the live-budget path plans bigger from the same number, which is why the daemon
must not use it. Daemon 68/68 incl. #438's boot test; plan 38/38.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply
joelteply force-pushed the fix/the-discrete-footprint-arm-is-the-device-delta branch from 0eafa51 to 10f4ab3 Compare September 17, 2026 17:38
@joelteply

Copy link
Copy Markdown
Contributor Author

Rebased onto canary tip (fddcf60) so this composes with #4169 rather than undoing it. The one overlap was physical_budget(), resolved as:

let mode = if serving_ludicrous_active() { PowerMode::Performance } else { everyday_drive_mode() };
physical_usable_bytes(main_lane_placement(), total_vram, total_ram, mode.serving_fraction())

Placement decides the POOL (Cormac's #4169 — a --n-gpu-layers 0 host bounds against RAM, not VRAM); drive mode decides the FRACTION (this PR — a node at CONTINUUM_VRAM_HEADROOM=1.0 plans at Performance every day). Suites green after rebase: serving_daemon::tests 69, cognition::serving_plan 38, provisioning 37, lane_footprint 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant