Skip to content

fix(serving): proactive decode-headroom preemption to trigger KV swap - #188

Open
drunkcoding wants to merge 1 commit into
plan/async-hierarchical-kvfrom
fix/async-kv-decode-preemption
Open

fix(serving): proactive decode-headroom preemption to trigger KV swap#188
drunkcoding wants to merge 1 commit into
plan/async-hierarchical-kvfrom
fix/async-kv-decode-preemption

Conversation

@drunkcoding

Copy link
Copy Markdown
Contributor

Productization fix for async-hierarchical-kv (see docs/superpowers/reports/2026-08-30-productization-verdicts.md).

Decode-time block exhaustion previously raised BlockAllocator exhausted instead of swapping, so the async hierarchical KV swap never fired. Adds KVCache.can_append/num_tokens and Scheduler decode-headroom guards (_decode_block_demand/_ensure_decode_headroom) plus benchmark knobs (--max-batch-size/--max-tokens-per-step) to induce pressure.

Validated: swaps fire (async swap_out ~57.8ms / swap_in ~37.0ms); async and sync arms both PASS at 25,344 tokens; 27 serving tests pass.

Decode-time block exhaustion previously raised BlockAllocator exhausted instead
of swapping. Add KVCache.can_append/num_tokens and Scheduler decode-headroom
guards so async hierarchical KV swap actually fires under pressure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant