[Attention] Make split_decodes_and_prefills(..., require_uniform=True) support padding#29644
Merged
LucasWilkinson merged 5 commits intovllm-project:mainfrom Dec 9, 2025
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request aims to add support for padded requests in split_decodes_and_prefills when require_uniform=True, which is important for cudagraph compatibility. The changes involve updating the splitting logic and adding a corresponding test case. While the intention is correct, I've found a critical issue in the implementation for detecting padded uniform batches. The current logic can fail if the first request is a padding request, leading to incorrect batch splitting. I've provided a detailed comment with a suggested fix to make the logic more robust. The rest of the changes look good.
benchislett
reviewed
Dec 1, 2025
Co-authored-by: Benjamin Chislett <chislett.ben@gmail.com> Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
dsuhinin
pushed a commit
to dsuhinin/vllm
that referenced
this pull request
Jan 21, 2026
…e)` support padding (vllm-project#29644) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com> Co-authored-by: Benjamin Chislett <chislett.ben@gmail.com> Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
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.
with #28579 we pad attention metadata before building; in the case of a uniform decode request we want to make sure that num_decodes matches the cudagraph size so that attention schedulers receive the same batch size as the graph was captured with. Currently we have work around this in all the existing attention backends (e.g. vllm-project/FlashMLA#3) since we used to pad for attention after building attention metadata so this was always the case. But this is needed #27532 since the FlashMLA FP8 Sparse Kernels do not have this workaround yet.
The
| (query_lens == 0)is removed from:as a small cleanup since this is not actually required (since this is actually not needed given we do actually want to treat them as decades in the case of full-decode batches and if there is a prefill it will come computed as the first prefill so these entries will be ignored anyways.
Test Plan:
CI