cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST] Where is FlashAttention-2 CUTLASS kernel

Open yoon5862 opened this issue 1 year ago • 4 comments

Hello, I'am study fused_multi_head_attention example in CUTLASS. In CUTLASS 3.5.1 README.md, it said flash attention 2 kernel is in CUTLASS. But in fused_multi_head attention, it is based on Meta/xFormer. I can not find flash attention2 CUTLASS kernels. Is fused_multi_head attention and flash attention is same?

yoon5862 avatar Sep 25 '24 07:09 yoon5862

xFormers is different from FA2 and FA3. FA2 and FA3 are downstream of CUTLASS in @tridao 's FA repo itself : https://github.com/Dao-AILab/flash-attention. Both FA2 and FA3 are written using CUTLASS.

thakkarV avatar Sep 25 '24 12:09 thakkarV

Thank you for reply. flash attention concentrate at A100, and H100 kernels. I'm curious flash attention kernel is efficient with Jetson AGX or RTX series. If it is not efficient, it need to be tuned for inference efficiently?

Thank you.

yoon5862 avatar Sep 26 '24 03:09 yoon5862

FA2 should work quite well on all Sm8x GPUs which includes RTX 3000 and RTX 4000 series GPUs. I suspect it works well on Jetson Orin too since that is Sm8x as well. YMMW so you should benchmark to confirm. If it is not near peak util, it should be quite easy to tune. Although for inference I suspect you want flash decode instead?

thakkarV avatar Sep 26 '24 14:09 thakkarV

Thank you for reply. I will do it in Sm8x series GPUs.

yoon5862 avatar Sep 27 '24 11:09 yoon5862

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Oct 27 '24 12:10 github-actions[bot]

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

github-actions[bot] avatar Jan 25 '25 13:01 github-actions[bot]