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

[Relax] Integrate cuDNN attention #17157

Merged
merged 9 commits into from
Jul 22, 2024
Merged

[Relax] Integrate cuDNN attention #17157

merged 9 commits into from
Jul 22, 2024

Conversation

vinx13
Copy link
Member

@vinx13 vinx13 commented Jul 15, 2024

This integrates cuDNN attention kernels to BYOC.
A dependency of cudnn_frontend is added.
The cuDNN attention kernel supports fused qkv in BS3NH and SBN3H layouts.

cc @sunggg @masahi @yongwww @tqchen

Copy link
Contributor

@sunggg sunggg left a comment

Choose a reason for hiding this comment

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

Thank you @vinx13 for the new addition!
Overall, looks good to me.
Would you describe high-level strategy for attention somewhere? (e.g., when to offload cudnn, cutlass, TIR, etc.)
If this is about landing machinery rather than such offloading decision, would appreciate if you can provide some recommendations.

python/tvm/contrib/cutlass/gen_tensor_op.py Show resolved Hide resolved
@vinx13
Copy link
Member Author

vinx13 commented Jul 15, 2024

The new attention can be applied via cudnn BYOC. The decision of which BYOC backend (cudnn, cutlass) to use is left to the users. cudnn is likely to perform better on H100 as it has specific optimizations

Copy link
Member

@masahi masahi left a comment

Choose a reason for hiding this comment

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

I remember cuDNN attention supports fp8, would be interesting to support that too.

@vinx13 vinx13 merged commit 5d5edd2 into apache:main Jul 22, 2024
18 checks passed
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.

None yet

4 participants