Skip to content

fix(serving): the plan's budget follows the placement — a CPU-placed lane budgets on the Ram row (card 7c72c0f0, re-opened from #4174) - #4184

Merged
joelteply merged 1 commit into
canaryfrom
fix/the-plans-budget-follows-the-placement
Sep 18, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/the-plans-budget-follows-the-placement

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The plan's budget follows the placement (card 7c72c0f0)

Re-opened on canary after #4167 merged (the stacked PR #4174 auto-closed with its base branch).

#4169 (Cormac) made the physical bound follow main_lane_placement(). The plan did not follow: host_budget() still read the board's Vram row × drive mode, and every serving site keyed by a resource kind said Vram — the governed ceiling, budget_for_replacing, the credited-once check, the consumer's footprint and reclaim.

Cormac's chain, measured on the Intel Mac (CPU-placed lane, 34.4 GB RAM, 3.89 GB VRAM with 0 MB in use):

plan budget cited 5.7 GB  →  4B weights leave ~3 GB of KV  →  23,445 tokens total
→ per_slot_floor 16,384 admits ONE slot  →  9 residents, 1 warm, 8 without
→ gridOverflowLanes 8  →  remote lane, 600 s timeouts, a turn burned each

The change

ONE decision, serving_pool_kind() = f(main_lane_placement()): Cpu → Ram, Gpu → Vram. Every site reads through it:

site before after
governed_vram_ceiling (the plan's ceiling) Vram row pool row
budget_for_replacing (replace-myself credit) Vram pool kind
ledger_credited (credit exactly once, #4167) Vram attribution pool attribution
ServingConsumer::footprint / reclaim Vram pool kind, handed in at construction
footprint sampler device delta on Discrete process read for a CPU-placed lane on every host class
cold-boot device prior VRAM total VRAM only — the Ram row's ceiling is read once at construction and is never cold

The consumer takes the kind at construction rather than resolving it: it must report and yield on the same row the plan budgets from, or the replace-myself credit lands on a row nobody reads and the plan flees its own residency. The GPU arm is byte-identical.

Projection for the Intel box (Cormac's arithmetic, not yet measured): 30 GB Ram ceiling × 0.80 = ~24 GB; 9 slots × 16,384 × 32,768 B = 4.8 GB KV + 2.7 GB weights ≈ 7.5 GB. Every citizen gets a warm local lane. Cormac is the test tier: 1 lane → 9, or it did not work.

Tests

  • a_cpu_placed_lane_budgets_against_the_ram_row_not_the_card — a 4 GB Vram row beside a 30 GB Ram row; CPU placement plans against 30 GB, GPU against 4 GB.
  • serving_daemon::tests 70, serving_consumer 14, cognition::serving_plan 38, resources:: 190 (3 system_resources::fd_* failures are pre-existing on the base, Windows-only).

Not in this PR: the liveness term in is_remote_bound (card ad96f5d1, Fable).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

…lane budgets, credits and attributes on the Ram row

#4169 made the PHYSICAL bound follow the lane placement; the PLAN did not follow.
host_budget() still read the board's Vram row × drive mode, and every serving site
keyed by a resource kind — the governed ceiling, budget_for_replacing, the
credited-once check, the consumer's own footprint and reclaim — said Vram. On a
`--n-gpu-layers 0` host (Intel Mac, card 7c72c0f0, 2026-09-17) that sized nine
citizens against a 5.7 GB Vram row on a box with 34.4 GB of RAM and 0 MB of VRAM
in use: one warm slot, eight exiled to a remote lane that timed out at 600 s.

ONE decision: `serving_pool_kind()` = f(main_lane_placement()) — Cpu → Ram, Gpu →
Vram — and every one of those sites reads through it. The consumer is handed the
kind at construction so it reports and yields on the SAME row the plan budgets
from (or the replace-myself credit lands on a row nobody reads and the plan flees
its own residency). The footprint sampler takes the process read for a CPU-placed
lane on every host class — the device delta reads zero for a lane holding nothing
on the device. The VRAM cold-boot prior stays a VRAM fact; the Ram row's ceiling
is read once at construction and is never cold. The GPU arm is byte-identical.

Test: a_cpu_placed_lane_budgets_against_the_ram_row_not_the_card — a 4 GB Vram row
beside a 30 GB Ram row; the CPU placement plans against 30 GB, the GPU placement
against 4 GB.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply
joelteply merged commit c2344d7 into canary Sep 18, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-plans-budget-follows-the-placement branch September 18, 2026 00:15
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