Skip to content

Commit 297f5ca

Browse files
committed
Fix coopmat2 MUL_MAT_ID pipeline selection
1 parent e1d17a2 commit 297f5ca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,6 +3463,17 @@ static void ggml_vk_matmul(
34633463

34643464
static vk_pipeline ggml_vk_guess_matmul_id_pipeline(ggml_backend_vk_context * ctx, vk_matmul_pipeline& mmp, int m, int n, bool aligned) {
34653465
VK_LOG_DEBUG("ggml_vk_guess_matmul_pipeline(" << m << ", " << n << ", " << aligned << ")");
3466+
3467+
if (ctx->device->coopmat2) {
3468+
if ((ctx->device->mul_mat_l && (m % mmp->l->wg_denoms[0]) == 0 && (n % mmp->l->wg_denoms[1]) == 0) || (!ctx->device->mul_mat_m && !ctx->device->mul_mat_s)) {
3469+
return aligned ? mmp->a_l : mmp->l;
3470+
}
3471+
if ((ctx->device->mul_mat_m && (m % mmp->m->wg_denoms[0]) == 0 && (n % mmp->m->wg_denoms[1]) == 0) || !ctx->device->mul_mat_s) {
3472+
return aligned ? mmp->a_m : mmp->m;
3473+
}
3474+
return aligned ? mmp->a_s : mmp->s;
3475+
}
3476+
34663477
if ((ctx->device->mul_mat_id_s && (m <= 32 || n <= 32)) || (!ctx->device->mul_mat_id_m && !ctx->device->mul_mat_id_l)) {
34673478
return aligned ? mmp->a_s : mmp->s;
34683479
}

0 commit comments

Comments
 (0)