You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: Reclaim paged blocks during decode when the pool budget is exhausted #1982
Found while reviewing PR #1978. With the paged backend and the default --kv-cache-budget (Auto), prefill admission reclaims blocks: admit_paged_prefill (src/server/batch/scheduler/admission.rs:723) calls reclaim_paged_blocks (admission.rs:696), which evicts prompt-cache entries via store.evict_one_lru() and then preempts running sequences. Decode has no equivalent. When a decoding sequence crosses a block boundary, acquire_block (src/lib/mlxcel-core/src/cache/paged.rs:2445) returns "PagedBlockPool: block budget exhausted" and the request errors.
Prompt-cache paged entries pin pool blocks and count against the budget (free_block_budget = budget - live_block_count, paged.rs:814). #1978 raised the default prompt-cache store capacity (model-aware), so decode growth is now more likely to hit the limit while cached entries hold blocks.
Fix
Before each decode step, the scheduler computes the blocks the step will mint (sequences crossing a block boundary) and calls the existing reclaim_paged_blocks(need), so reclaim order is prompt-cache LRU first, then the existing preemption policy. Reuse that function; do not add a second eviction loop. A request errors only if both fail. Integrate this in the real scheduler decode path.
Acceptance Criteria
Unit test: fill the pool with cached prompt entries, then decode a sequence past a block boundary; it succeeds and an LRU entry is evicted (fails on current code).
Unit test: with no evictable entries, the decode falls back to preemption instead of returning the budget error.
With free budget, no eviction or preemption occurs (existing tests unchanged).
Activity
docs: correct failure-mode count in the #1982 technical report
fix: reclaim paged KV blocks during decode under budget pressure (lab…
feat: add a per-step token budget mixing decode and chunked prefill (#…