-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Add GGML_HIP_ROCWMMA_FATTN to enable rocWMMA for FlashAttention #12032
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
Changes from 7 commits
206d22b
02369da
547115d
419f1ea
828577a
9d27c38
19272bf
29debe1
5d4ab04
5516909
fea171f
a90f4cb
a135b4c
373d48e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,8 +252,15 @@ void ggml_cuda_flash_attn_ext(ggml_backend_cuda_context & ctx, ggml_tensor * dst | |
| const int cc = ggml_cuda_info().devices[ggml_cuda_get_device()].cc; | ||
| const enum ggml_prec prec = ggml_flash_attn_ext_get_prec(KQV); | ||
|
|
||
| // On AMD the tile kernels perform poorly, use the vec kernel instead: | ||
| if (cc >= GGML_CUDA_CC_OFFSET_AMD) { | ||
| #if defined(GGML_HIP_ROCWMMA_FATTN) | ||
| if (fp16_mma_available(cc) && dst->src[0]->ne[1] > 8) { | ||
| ggml_cuda_flash_attn_ext_wmma_f16(ctx, dst); | ||
| return; | ||
| } | ||
| #endif // defined(GGML_HIP_ROCWMMA_FATTN) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The check was indeed not needed, it seems to be an early hack in my private branches to get rid of the cols_per_block = 8 cases. I've removed them. |
||
|
|
||
| // On AMD the tile kernels perform poorly, use the vec kernel instead: | ||
| if (prec == GGML_PREC_DEFAULT && fast_fp16_available(cc)) { | ||
| ggml_cuda_flash_attn_ext_vec_f16(ctx, dst); | ||
| } else { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.