[Bugfix][KV Connector] Safely fill circular buffers in DecodeBench - #54879
Merged
ivanium merged 1 commit intoSep 3, 2026
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Jeff Ma <jeffjma@umich.edu>
majunze2001
marked this pull request as ready for review
September 2, 2026 15:03
majunze2001
requested review from
ApostaC,
NickLucche,
ivanium,
orozery and
xuechendi
as code owners
September 2, 2026 15:03
ivanium
approved these changes
Sep 2, 2026
ivanium
left a comment
Collaborator
There was a problem hiding this comment.
LGMT thanks for the fix!
Collaborator
|
/ci run |
ivanium
enabled auto-merge (squash)
September 2, 2026 21:00
|
✅ Triggered Buildkite CI #86944 for commit |
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
DecodeBench fills allocated cache blocks with synthetic values to emulate an external prefill. Qwen QSA circular buffers can pack exact
int64MRoPE positions alongside BF16 key state. Applying the configured nonzero BF16 fillto the entire circular-buffer row corrupts those positions, which can make the QSA pre-indexer access its cosine/sine table out of bounds and trigger a CUDA IMA.
This change identifies KV-cache groups containing
CircularBufferSpeclayers and explicitly zero-fills their selected blocks. Other cache groups continue to use the configured DecodeBench mean and standard deviation. The regression test also verifies that only the selected circular-buffer row is modified.Duplicate-work check
No issue is linked to this change. Searches of open vLLM PRs and issues for
DecodeBench CircularBuffer,DecodeBench Qwen3.8, andQSA illegal memory DecodeBenchfound no existing fix.Test Plan
CircularBufferSpeccache initialized with nonzerovalues and verify that DecodeBench zeros the selected row while leaving every
other row unchanged.
configuration.
Commands run locally:
../vllm/.venv/bin/python -c 'import runpy,sys,types; sys.modules["readline"]=types.ModuleType("readline"); sys.argv=["pytest","tests/v1/kv_connector/unit/test_decode_bench_connector.py","-q"]; runpy.run_module("pytest",run_name="__main__")' ../vllm/.venv/bin/pre-commit run --files vllm/distributed/kv_transfer/kv_connector/v1/decode_bench_connector.py tests/v1/kv_connector/unit/test_decode_bench_connector.py git diff --checkEquivalent model-server invocations used for the E2E runs:
Test Result
tests/v1/kv_connector/unit/test_decode_bench_connector.py: 12 passed.repository-specific validation hooks.
git diff --check: passed.returned HTTP 200 with the requested output lengths. This included the prior
3,002-token prompt plus 512-token generation regression shape, a 1,024-token
generation, replayed prefixes, and concurrent requests. The server remained
healthy, with no CUDA illegal memory access, engine failure, or CUDA core
dump.
including replayed-prefix, long-generation, and concurrent workloads. The
normal attention group retained the configured default
fill_mean=0.015,and the run observed a 29.6% local prefix-cache hit rate.
Model accuracy evaluation is not applicable because DecodeBench deliberately uses synthetic KV values and does not produce meaningful accuracy results. The model-serving E2E tests above cover the affected circular-buffer path and a non-circular control.
AI assistance disclosure: OpenAI Codex was used for this PR.