fix(serving): proactive decode-headroom preemption to trigger KV swap - #188
Open
drunkcoding wants to merge 1 commit into
Open
fix(serving): proactive decode-headroom preemption to trigger KV swap#188drunkcoding wants to merge 1 commit into
drunkcoding wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Productization fix for async-hierarchical-kv (see docs/superpowers/reports/2026-08-30-productization-verdicts.md).
Decode-time block exhaustion previously raised
BlockAllocator exhaustedinstead of swapping, so the async hierarchical KV swap never fired. AddsKVCache.can_append/num_tokensandSchedulerdecode-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.