fix(attention): preserve per-group KV cache formats - #494
Merged
lukealonso merged 1 commit intoAug 28, 2026
Merged
Conversation
Resolve FlashInfer KV-cache dtype from the layers in each attention group and propagate the engine-selected physical layout into every model-owned attention implementation. A speculative draft can therefore keep its own cache dtype while sharing the target engine layout. Target-only serving and groups that share the global cache configuration are unchanged. Validation: 24 targeted attention and DFlash2 tests passed; Ruff check and format validation passed. Assisted-by: OpenAI Codex <codex@openai.com> Signed-off-by: Martin Vit <martin@voipmonitor.org>
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 28, 2026
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.
Resulting behavior
Status: implemented.
Each attention group resolves its KV-cache dtype from the layers assigned to that group. Model-owned attention implementations receive the engine-selected physical cache layout without replacing their group-specific logical dtype.
A speculative draft can therefore use a cache format supported by its attention backend while the target uses a different format. Target-only serving and attention groups whose layers share one global cache format retain their established behavior.
Source contract
local-inference-lab/vllm:dev/jovian-judgementatc79f35ca00e8e93e0943a0d79b85b22b18aac939.eca8a6bca19f210a30fbb0bb6942556f8243cb14.Validation
tests/v1/attention/test_group_head_counts.pyandtests/v1/worker/test_attn_utils.py: 23 passed.git diff --check: passed.Duplicate-work check
Related open pull requests implement different contracts:
vllm-project/vllm#53979enables non-causal FlashAttention 2 reads from NVFP4 pages; it does not resolve cache dtype per attention group.vllm-project/vllm#48392replicates dense draft KV heads for decode-context parallelism; it does not preserve independent target and draft cache formats under decode-context parallel size 1.local-inference-lab/vllm#488implements GLM CKV gathering and retention under decode-context parallelism; it does not provide this per-group dtype and physical-layout propagation.Review disclosure
OpenAI Codex assisted with implementation, tests, runtime qualification, and pull-request preparation. Human review of every changed line and the attention-group cache contract is required before merge.