Repository navigation
[Bugfix][Step5] Size the KV block to the CSA tail ring - #65153
Merged
AndreasKaratzas merged 2 commits intoNov 3, 2026
Merged
Conversation
akii96
force-pushed
the
step5-fp8-tail-ring-block-size
branch
2 times, most recently
from
November 2, 2026 12:51
330bca5 to
6b49a32
Compare
akii96
marked this pull request as ready for review
November 2, 2026 13:51
akii96
requested review from
AndreasKaratzas,
DarkLight1337 and
ywang96
as code owners
November 2, 2026 13:51
simondanielsson
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix!
Minor suggestion: can we check if this works also with >1 KV heads per rank? I.e. TP2
dllehr-amd
self-requested a review
November 2, 2026 17:08
akii96
force-pushed
the
step5-fp8-tail-ring-block-size
branch
from
November 2, 2026 17:20
6b49a32 to
c5eb678
Compare
Contributor
Author
|
Thanks for the careful review @simondanielsson 🙏 Yes, it works at TP2. With dummy weights, FP8 KV and no |
FP8 KV at the default block size of 16 cannot hold the tail ring, so serving required a manual --block-size. Report that minimum through the existing backend negotiation instead of changing the global default. Signed-off-by: akii96 <aakif.nawaz@amd.com>
akii96
force-pushed
the
step5-fp8-tail-ring-block-size
branch
from
November 2, 2026 20:29
c5eb678 to
905d4c6
Compare
|
✅ @akii96, CI is now available for this PR.
|
Contributor
|
/ci run |
|
✅ Triggered Buildkite CI #99342 for commit |
This was referenced Nov 3, 2026
6 tasks done
Merged
2 tasks
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.
Overview
Step-5 with FP8 KV cache crashes at startup if
--block-sizeis not passed. The default block size of 16 is too small for the CSA tail ring. #61837 worked around this by telling users to pass--block-size 32. This PR makes vLLM pick a large enough block size on its own.Claims
--kv-cache-dtype fp8works without--block-size.Validation
Before this change, this command crashed on 8x MI300X after the weights loaded:
VLLM_ROCM_USE_AITER=1 vllm serve stepfun-ai/Step-5-Preview \ --tensor-parallel-size 8 \ --max-model-len 262144 \ --kv-cache-dtype fp8 \ --gpu-memory-utilization 0.90 \ --moe-backend triton \ --mm-encoder-attn-backend ROCM_AITER_FA \ --mm-encoder-tp-mode data \ --mm-processor-cache-type shm \ --limit-mm-per-prompt '{"image":1,"video":0}' \ --reasoning-parser step5 \ --tool-call-parser step5 \ --enable-auto-tool-choice \ --safetensors-load-strategy prefetchWith this branch, I ran the same command on 8x MI325X with
--attention-backend ROCM_AITER_UNIFIED_ATTNadded. All 8 workers picked block size 32 and the server started:I then ran GSM8K against that server with the same setup as #61837: all 1319 questions, 5-shot. It scored 97.27% strict and 97.50% flexible.
To check more than one KV head per GPU, I started the small Step-5 test model from the test registry with dummy weights, FP8 KV and no
--block-size:All three started and generated text.
The new unit test goes through the same startup code and then builds the tail ring's KV spec, which is the call that fails on main. It covers FP8 at TP8, TP2 and TP1, BF16, a larger speculative ring (moves to 64), and a padded page.
Details
The tail ring has to fit in one KV page. It needs 7 rows of 1024 bytes, plus one more row per speculative token. Step-5 has 4 KV heads, so at TP8 each GPU holds one. With FP8, a 16-token page is then 6144 bytes, which is only 6 rows. At TP2 each GPU holds two heads, so the page is already 12 rows and nothing changes.
vLLM already lets each attention backend say which block sizes it supports, and it picks a size that works for all of them at startup. The tail ring backend now takes part in that. It asks for 32, 64 or 128, whichever is the smallest that fits. If 16 already fits, it accepts any size. The math uses the page size without padding, so padding never counts as room for the ring.
The code is in
common/csa_tail_ring.py, which the AMD and NVIDIA Step-5 models both use. If a user passes a--block-sizethat is too small, they still get the same error as before.AI assistance was used to write this change. I reviewed the diff, ran the unit test, and ran the serve, GSM8K and TP checks above.
Pull Request Checklist
/pr-checklistskill. (Mandatory for agents, optional for humans).