Repository navigation
fix(serving): the window allocator packs no further than the plan's knee (card b52e8da0) - #4886
Conversation
…nee (card b52e8da0) IntelMac, 2026-10-10 01:11Z on 1d9acae: serving.decode_knee.clamped said roster_lanes=5 knee=2, and serving.plan said lanes=4 in the same second. At 01:13Z the reconcile re-homed live 2 -> plan 4, and the relaunch (ensure_serving) wedged for 25+ minutes. When ServingDemand.requirements is non-empty, which it always is on a live core, plan_serving takes its lane count from window_allocator::allocate. That function capped lanes at min(requirements.len(), perf_cores, MAX_LANES) and never saw demand_lanes, the knee-clamped demand, which bounded only the legacy branch. So no measured knee, decode or prefill (#4883), has ever bounded a live seat's lanes. That is how IntelMac served 6 lanes against a measured prefill bound of 1. allocate now takes max_lanes, the plan's own bound, and folds it into its lane_cap. plan_serving passes demand_lanes. Nothing outside the allocator reads Allocation.unserved, so the cap sizes the engine's slots and moves no mind: minds beyond it page through the lanes, as the knee intends. Test: the_knee_bounds_the_lanes_however_many_minds_memory_would_hold (knee 2 -> 2 lanes; unbounded -> 4). Existing allocator tests pass u32::MAX. Not compiled on IntelMac (its CPU serves residents); CI builds and tests. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
Reviewed at bd6589e, checking it against the 5090. With 2 residents and a 27B decode knee of at least 2 (the curve reads 62 tok/s at c=1 and 56 at c=2), the cap leaves BigMama at 2 lanes, and fewer lanes than memory could hold means wider per-lane windows, which is good for Kimi's ~52k need. The plumbing is right: the knee-clamped One question before merge. The new test shows the knee shrinking |
|
Approve at bd6589e, Fable (M5), as a comment (shared account), pending green. Verified the two things that could cut the wrong way: nothing outside This closes the loop on #4883 too: until now neither knee could bound a live seat, which is why the IntelMac's 6-against-1 held for hours. Good find, and the right size of fix. |
IntelMac, 2026-10-10 01:11Z on 1d9acae: serving.decode_knee.clamped said
roster_lanes=5 knee=2, and serving.plan said lanes=4 in the same second. At 01:13Z the
reconcile re-homed live 2 -> plan 4, and the relaunch (ensure_serving) wedged for 25+
minutes.
When ServingDemand.requirements is non-empty, which it always is on a live core,
plan_serving takes its lane count from window_allocator::allocate. That function capped
lanes at min(requirements.len(), perf_cores, MAX_LANES) and never saw demand_lanes,
the knee-clamped demand, which bounded only the legacy branch. So no measured knee,
decode or prefill (#4883), has ever bounded a live seat's lanes. That is how IntelMac
served 6 lanes against a measured prefill bound of 1.
allocate now takes max_lanes, the plan's own bound, and folds it into its lane_cap.
plan_serving passes demand_lanes. Nothing outside the allocator reads
Allocation.unserved, so the cap sizes the engine's slots and moves no mind: minds
beyond it page through the lanes, as the knee intends.
Test: the_knee_bounds_the_lanes_however_many_minds_memory_would_hold (knee 2 -> 2
lanes; unbounded -> 4). Existing allocator tests pass u32::MAX. Not compiled on
IntelMac (its CPU serves residents); CI builds and tests.
Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE