[Bugfix][KV Offload] Keep Mamba block span unscaled under DCP - #49964
Merged
orozery merged 3 commits intoJul 28, 2026
Merged
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Jonguk Cheong <jdal3031@snu.ac.kr>
jongukc
requested review from
ApostaC,
NickLucche,
ivanium,
orozery and
xuechendi
as code owners
July 27, 2026 10:05
orozery
approved these changes
Jul 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.
Purpose
Native KV offloading currently multiplies every cache group's token span by the decode context parallelism world size. This is correct for attention KV, which is sharded across DCP ranks, but Mamba state is replicated and keeps its original block size.
With 16 token attention and Mamba blocks under DCP=2, the current configuration derives 32 tokens per block for both groups. The correct spans are 32 tokens for attention and 16 tokens for Mamba. For a 64 token prefix, the incorrect geometry associates offload keys with the wrong Mamba state blocks, so a later cache hit can restore recurrent state from an earlier boundary.
This change scales
tokens_per_blockby DCP only forAttentionSpec. Mamba and other non-attention groups retain their declared block size.Duplicate-work check
I searched open and closed issues and PRs for native offloading,
OffloadingConnector, DCP, Mamba, hybrid KV cache, and block size mismatches.I found no matching report or fix.
Test plan
Test results
tests/v1/kv_connector/unit/offloading_connector/test_config.py:39 passed.AI Assistance
OpenAI Codex was used to assist with investigation, implementation, testing, and PR preparation. The human submitter must review every changed line and be prepared to explain and defend the change end-to-end.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.