Fix MMQ check when quant does not support MMQ (#2356)

This commit is contained in:
Kawrakow 2026-08-25 13:44:32 +02:00 committed by GitHub
parent d206417cb3
commit c49f7db34a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -2577,7 +2577,8 @@ static int ggml_cuda_mul_mat_q(ggml_backend_cuda_context & ctx, const ggml_tenso
|| dst->op == GGML_OP_PERMUTE || dst->op == GGML_OP_NONE) {
++node_n; continue;
}
if (dst->op != GGML_OP_MUL_MAT || dst->src[1] != src1 || !ggml_is_quantized(dst->src[0]->type)) break;
if (dst->op != GGML_OP_MUL_MAT || dst->src[1] != src1 || !ggml_is_quantized(dst->src[0]->type) ||
!ggml_cuda_should_use_mmq(dst->src[0]->type, ggml_cuda_info().devices[ctx.device].cc, src1->ne[1])) break;
if (!is_gemv && mmq_get_q8_1_ds_layout(src0->type) != mmq_get_q8_1_ds_layout(dst->src[0]->type)) break;
if (is_gemv) {
if (fusion && node_n + 2 < cgraph->n_nodes &&