Add 2048-token pages to FMHA batch prefill - #3760
Draft
rlrs wants to merge 1 commit into
Draft
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Rasmus Larsen <rasmus.larsen@alexandra.dk>
This was referenced Jul 26, 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.
Proposed changes
Add 2048-token pages to the FMHA batch-prefill generator.
vLLM uses 2048-token cache pages for hybrid models whose recurrent layers have
large state-alignment requirements. The batch-prefill kernel already accepts a
compile-time page size, so this only adds 2048 to the generated set.
On an MI250X with a 128K context, the generated kernel was 1.70x faster than
the existing Triton paged-prefill path. The same comparison at 256K was 1.69x.
This does not change kernels generated for existing page sizes or for non-gfx9
targets.
Validation:
I also checked the generated kernel against the PyTorch attention reference for
the vLLM BF16 MQA shape and ran an end-to-end 128K-context serving benchmark.
Checklist
clang-formaton all changed filesDiscussion
This change was prepared with AI assistance and reviewed and tested by the
submitter.