[2/N][Attention] Enable masked MHA for sparse MLA prefills - #48770
Merged
vllm-bot merged 28 commits intoJul 31, 2026
Conversation
Build on the dense-MHA shortcut from vllm-project#47327 and route eligible pure prefills through FA4 masked attention. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
5 tasks
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
4 tasks
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
MatthewBonanni
marked this pull request as ready for review
July 17, 2026 16:30
MatthewBonanni
requested review from
Harry-Chen,
LucasWilkinson and
tlrmchlsmth
as code owners
July 17, 2026 16:30
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
LucasWilkinson
approved these changes
Jul 28, 2026
LucasWilkinson
left a comment
Collaborator
There was a problem hiding this comment.
Overall looks pretty good to me; left some comments for cleanup/simplification
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Member
Author
|
Marking as [Do Not Merge] because we still need to land FA once CI is green |
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
MatthewBonanni
enabled auto-merge (squash)
July 30, 2026 13:57
mgoin
approved these changes
Jul 31, 2026
21 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.
Depends on vllm-project/flash-attention#155
Purpose
For pure prefills, there is a threshold of sequence length below which a masked MHA pathway is faster than sparse MQA. The DeepSeek V3.2 paper mentions this:
#47327 implemented a dense MHA shortcut for when
seq_len < topk. This PR extends that optimization by implementing the masked MHA pathway.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.