Skip to content

fix(serving): a device delta at or below the weights is no reading, and an absent per-token rate is not printed as 0 - #4956

Merged
joelteply merged 1 commit into
canaryfrom
b5230492/serving-a-device-delta-at-or-below-the-w
Oct 11, 2026
Merged

joelteply merged 1 commit into
canaryfrom
b5230492/serving-a-device-delta-at-or-below-the-w

Conversation

@joelteply

@joelteply joelteply commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

On the 5090, 2026-10-11 19:40Z, core f595618 (from BigMama's probe lines), serving.footprint.measured printed source=device_delta anon_bytes=0 per_token_measured=0 ratio=0.0 every minute. That was for a lane serving 67,584 tokens of KV, which cannot be zero bytes beyond its weights.

device_delta_beyond_weights (serving_daemon.rs) computes now - baseline - weights and saturates it to 0 when the trough baseline already held the weights (or another engine). The probe then printed measured.unwrap_or(0). The planner's per-lane footprint stayed the estimate, while the log read like a measurement.

What

  • A saturated delta is not a reading. A delta that does not exceed the weights returns None (checked subtraction) and falls through to engine_props, the engine's own /props memory breakdown, which needs no baseline. A serving.footprint.device_delta_unread probe names the baseline, now and weights that refused it.
  • An absent rate is not 0. per_token_measured prints none when there is no rate.
  • Tests: the existing discrete-arm test gains the two saturating cases: a baseline that held the weights, and exactly the weights beyond the baseline.

Measured

This can only be measured after deploy on the 5090. The check: serving.footprint.measured reads either device_delta with a non-zero anon_bytes, or engine_props with a real number, plus a device_delta_unread line naming the inputs. It must never show per_token_measured=0. Owner: Cormac, with BigMama reading the 5090 probes.

Not in this PR

Two more readings from the same probe lines are carded separately:

  • bound_by="host-fit" is a catch-all for "served window under demand", whatever actually bound it;
  • the at_rest plan (31,693) and the reconcile plan (68,394) disagree in the same second.

Not compiled locally (IntelMac builds in CI).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…nd an absent per-token rate is not printed as 0

The 5090, 2026-10-11 19:40Z (core f595618): serving.footprint.measured printed source=device_delta
anon_bytes=0 per_token_measured=0 ratio=0.0 every minute, for a lane serving 67,584 tokens of KV.
device_delta_beyond_weights saturated `now - baseline - weights` to 0 when the trough baseline
already held the weights (or another engine), and the probe printed `measured.unwrap_or(0)`. So the
planner's per-lane footprint stayed the estimate while the log read like a measurement (BigMama:
"absence rendered as a measurement").

- A delta that does not exceed the weights returns None (checked subtraction) and falls through to
  engine_props, the engine's own /props memory_breakdown, which needs no baseline. A
  serving.footprint.device_delta_unread probe names the baseline, now and weights that refused it.
- per_token_measured prints "none" when there is no rate, never 0.
- The existing discrete-arm test gains the two saturating cases (a baseline that held the weights,
  and exactly the weights beyond the baseline).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Review (BigMama): diff only, CI pending (3 pass, 3 pending at 5f5e216).

  • Verified in the diff: device_delta_beyond_weights returns None for a delta at or below the weights (checked_sub, plus filter > 0). The two tests pin the trough-held-the-weights case and the exactly-the-weights case.
  • So the zeros can't recur: absence falls through to engine_props with a named device_delta_unread probe, and anon_bytes=0 / ratio=0.0 can no longer print from that path, since Some(anon) now means a real delta. per_token_measured prints "none", not 0.
  • The fallback has a real source on the 5090: /props on the live engine now reports memory_breakdown CUDA0 model 18,247,720,960, context 3,137,470,464, compute ~889 MB; CUDA_Host compute 361,062,464.

Approving on green. Receipt (BigMama, after the deploy carrying it): serving.footprint.measured on the 5090 with source="engine_props" and a nonzero per_token_measured, or "none" with the unread probe beside it.

@joelteply

Copy link
Copy Markdown
Contributor Author

Approve at 5f5e216 (BigMama), diff and CI: 7/7 green (windows-msvc check, the core lib tests, hygiene ratchets, ts-rs drift and the rest).

@joelteply
joelteply merged commit 6d78909 into canary Oct 11, 2026
7 checks passed
@joelteply
joelteply deleted the b5230492/serving-a-device-delta-at-or-below-the-w branch October 11, 2026 20:05
joelteply added a commit that referenced this pull request Oct 11, 2026
…d the hybrid upper bound is named

BigMama on #4961: unattributed_bytes printed 0 for an unread delta, the absence-as-measurement shape
#4956 removed, so it prints none. On a hybrid model the context buffer holds each slot's fixed
recurrent state, so the rate is an upper bound and a plan for more, shorter slots is short one state
per extra slot. That split needs the engine to report it per sequence: card c8b2e1df, which first
measures its size.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply added a commit that referenced this pull request Oct 12, 2026
…n KV over its tokens; the rest of the device delta is unattributed (#4961)

* fix(serving): on a discrete GPU the per-token cost is the engine's own KV over the tokens it holds, and the rest of the device delta is probed as unattributed

BigMama's 5090 receipt (build 6148, 2026-10-11): the device delta read 85.8 KB/token where the
engine's own context bytes read 46.4 KB. The delta holds every tenant of the GPU (the embedding
lane's 1.75 GiB lease) and the engine's unreported overhead. With a header rate the plan carries the
excess as fixed bytes per lane (fixed_per_lane_from), so each extra lane paid for the other tenants
again. Design per Codex: the lane's context bytes over the tokens it allocated (slots x per-slot
n_ctx, from /props), with the residual probed as unattributed and never saved into the model's record.
The device delta still speaks for an engine without memory_breakdown. The three /props readers
become one fetch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(serving): an unread device delta prints no unattributed bytes, and the hybrid upper bound is named

BigMama on #4961: unattributed_bytes printed 0 for an unread delta, the absence-as-measurement shape
#4956 removed, so it prints none. On a hybrid model the context buffer holds each slot's fixed
recurrent state, so the rate is an upper bound and a plan for more, shorter slots is short one state
per extra slot. That split needs the engine to report it per sequence: card c8b2e1df, which first
measures its size.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(serving): an engine that did not answer /props is no reading, never a device-delta stand-in

Codex on #4961: a 500 ms /props miss and an engine without memory_breakdown both read as None, so a
single miss wrote the tenant-charged device-delta rate back under the same model record and undid the
correction. An unanswered engine now records no sample (serving.footprint.unmeasured
leg=engine_unanswered); only an engine that answered without a context reading falls to the delta.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(serving): only an engine WITHOUT memory_breakdown falls to the device delta; a present but unusable one is no reading

Codex on #4961: EngineContext::from_props returned None both for an engine predating the field and for
a present breakdown or slot geometry that is malformed, zero or overflowing, and both fell to the
tenant-charged delta. EngineContextReading::of tells the three apart (Read, Absent, Invalid). Invalid
records no sample (serving.footprint.unmeasured leg=engine_breakdown_invalid). The parser test now
covers zero slots, an overflowing n_ctx, a malformed breakdown and an absent one.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(serving): an engine's error reply or a non-props body is no reading, never a legacy engine

Codex on #4961 (92ffdb7): engine_props() parsed the body without checking the status, and
EngineContextReading::of called any JSON without memory_breakdown Absent. So a 503 while loading, a
500, or a JSON null read as an engine that predates the field, and fell to the tenant-charged device
delta. engine_props now rejects an unsuccessful status before parsing. And only a well-formed props
document (it carries default_generation_settings) can be Absent; null and an error envelope are
Invalid. The parser test adds both.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(serving): legacy and reading share one slot-geometry parse, so a null geometry is no legacy engine

Codex on #4961 (0d44a51): {default_generation_settings: null} still passed as a well-formed legacy
props document. slot_geometry() is now the one parse of total_slots and per-slot n_ctx (present, in
range, nonzero), and both EngineContextReading::of and EngineContext::from_props use it, so 'a valid
props document' means one thing. The parser test adds the null-geometry case.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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