Skip to content

[Core] Support all head sizes up to 256 with FlashAttention backend#8910

Closed
njhill wants to merge 2 commits intovllm-project:mainfrom
njhill:flash-heads
Closed

[Core] Support all head sizes up to 256 with FlashAttention backend#8910
njhill wants to merge 2 commits intovllm-project:mainfrom
njhill:flash-heads

Conversation

@njhill
Copy link
Copy Markdown
Member

@njhill njhill commented Sep 27, 2024

We were previously restricting to specific sizes, but the native FA kernels pad and support arbitrary sizes up to 256.

We were previously restricting to specific sizes, but the native FA kernels pad and support arbitrary sizes up to 256.
@njhill njhill requested a review from WoosukKwon September 27, 2024 17:37
Copy link
Copy Markdown
Member

@tlrmchlsmth tlrmchlsmth left a comment

Choose a reason for hiding this comment

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

Could you add some unit tests? Looks like we may be able to just extend this list here🤞

# FlashAttention forward only supports head dimension at most 128
# https://github.com/ROCmSoftwarePlatform/flash-attention/blob/3d2b6f5d037782cc2c906909a46fb7e2e1b48b25/csrc/flash_attn_rocm/flash_api.cpp#L62
HEAD_SIZES = [64, 80, 96, 112, 120, 128, 192, 256]

@vllm-project vllm-project deleted a comment from github-actions bot Sep 27, 2024
@njhill
Copy link
Copy Markdown
Member Author

njhill commented Sep 27, 2024

Looks like we need to build flash without the FLASHATTENTION_DISABLE_UNEVEN_K flag, have opened vllm-project/flash-attention#21 ... @WoosukKwon wdyt?

@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you!

@github-actions github-actions bot added the stale Over 90 days of inactivity label Feb 25, 2025
@mergify
Copy link
Copy Markdown

mergify bot commented Feb 25, 2025

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

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 Feb 25, 2025
@github-actions github-actions bot added unstale Recieved activity after being labelled stale and removed stale Over 90 days of inactivity labels Feb 26, 2025
@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you!

@github-actions github-actions bot added stale Over 90 days of inactivity and removed unstale Recieved activity after being labelled stale labels May 27, 2025
@lgeiger
Copy link
Copy Markdown
Contributor

lgeiger commented May 27, 2025

@njhill Has there been any progress on this? This would be very useful so we could bring back support for FA in ViTs and multi modal models #12445

@github-actions github-actions bot added unstale Recieved activity after being labelled stale and removed stale Over 90 days of inactivity labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase unstale Recieved activity after being labelled stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants