Skip to content

[Attention] Integrate FlashAttention 4 SM100 headdim 256 support - #42669

Merged
MatthewBonanni merged 7 commits into
vllm-project:mainfrom
MatthewBonanni:fa4_256
Jul 27, 2026
Merged

[Attention] Integrate FlashAttention 4 SM100 headdim 256 support#42669
MatthewBonanni merged 7 commits into
vllm-project:mainfrom
MatthewBonanni:fa4_256

Conversation

@MatthewBonanni

@MatthewBonanni MatthewBonanni commented May 14, 2026

Copy link
Copy Markdown
Member

Purpose

FA4 added support for headdim 256 in Dao-AILab/flash-attention#2412 (and optimized it in Dao-AILab/flash-attention#2487 and Dao-AILab/flash-attention#2488). This support was integrated into vLLM with #41052. This PR is a follow-up to activate the headdim 256 support.

Note

This kernel is currently slower than TRTLLM_RAGGED. Regardless, right now on main, FA is selected and then downgrades to FA2, so this PR additionally updates the routing to TRTLLM_RAGGED for these dimensions.

Note

This kernel only supports block_size = tile_n = 128 at this head size, which precludes its use for mamba models like Gemma 3.

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@mergify mergify Bot added the v1 label May 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Flash Attention 4 (FA4) compatibility logic for Blackwell GPUs to reflect current TMEM capacity limits, specifically allowing head sizes of 256 and the asymmetric MLA configuration (192/128). Feedback was provided to improve the readability of the conditional logic by grouping the supported head size exceptions into a single clause.

Comment thread vllm/v1/attention/backends/fa_utils.py Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@MatthewBonanni MatthewBonanni changed the title [Attention] Integrate FlashAttention 4 headdim 256 support [Attention] Integrate FlashAttention 4 SM100 headdim 256 support Jun 16, 2026
@munkim

munkim commented Jul 7, 2026

Copy link
Copy Markdown

Any updates / plans for integrations?

@MatthewBonanni
MatthewBonanni marked this pull request as ready for review July 22, 2026 16:25

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@mergify

mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--42669.org.readthedocs.build/en/42669/

@mergify mergify Bot added documentation Improvements or additions to documentation performance Performance-related issues labels Jul 23, 2026
@MatthewBonanni MatthewBonanni added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 24, 2026
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@mergify

mergify Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @MatthewBonanni.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Jul 25, 2026
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@mergify mergify Bot removed the needs-rebase label Jul 27, 2026
@MatthewBonanni
MatthewBonanni enabled auto-merge (squash) July 27, 2026 16:54
@MatthewBonanni
MatthewBonanni merged commit bf2b45b into vllm-project:main Jul 27, 2026
101 checks passed
@MatthewBonanni
MatthewBonanni deleted the fa4_256 branch July 27, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants