Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

njhill
Copy link
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.
Copy link
Collaborator

@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
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants