CUDA: re-use MLA K data for V in MMA FA (#19057)

This commit is contained in:
Johannes Gäßler
2026-01-24 10:09:36 +01:00
committed by GitHub
parent 81ab64f3c8
commit 8f91ca54ec
3 changed files with 72 additions and 70 deletions
+5
View File
@@ -247,6 +247,8 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const
}
}
const bool V_is_K_view = V->op == GGML_OP_VIEW && V->src[0] == K && V->data == K->data;
const int cc = ggml_cuda_info().devices[device].cc;
switch (K->ne[0]) {
@@ -269,6 +271,9 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const
if (!gqa_opt_applies || gqa_ratio % 4 != 0) {
return BEST_FATTN_KERNEL_NONE;
}
if (!V_is_K_view) {
return BEST_FATTN_KERNEL_NONE;
}
break;
default:
return BEST_FATTN_KERNEL_NONE;