@@ -2211,15 +2211,15 @@ static void ggml_cuda_mul_mat(ggml_backend_cuda_context & ctx, const ggml_tensor
22112211
22122212 const int cc = ggml_cuda_info ().devices [id].cc ;
22132213 const int warp_size = ggml_cuda_info ().devices [id].warp_size ;
2214- use_mul_mat_q = use_mul_mat_q && ggml_cuda_should_use_mmq (src0->type , cc, src1->ne [1 ]);
2214+ use_mul_mat_q = use_mul_mat_q && ggml_cuda_should_use_mmq (src0->type , cc, src1->ne [1 ], /* n_experts= */ 0 );
22152215 use_mul_mat_f = use_mul_mat_f && ggml_cuda_should_use_mmf (src0->type , cc, warp_size, src0->ne , src0->nb , src1->ne [1 ], /* mul_mat_id=*/ false );
22162216 use_mul_mat_vec_f = use_mul_mat_vec_f && ggml_cuda_should_use_mmvf (src0->type , cc, src0->ne , src0->nb , src1->ne [1 ]);
22172217 any_gpus_with_slow_fp16 = any_gpus_with_slow_fp16 || !fast_fp16_hardware_available (cc);
22182218 }
22192219 } else {
22202220 const int cc = ggml_cuda_info ().devices [ctx.device ].cc ;
22212221 const int warp_size = ggml_cuda_info ().devices [ctx.device ].warp_size ;
2222- use_mul_mat_q = use_mul_mat_q && ggml_cuda_should_use_mmq (src0->type , cc, src1->ne [1 ]);
2222+ use_mul_mat_q = use_mul_mat_q && ggml_cuda_should_use_mmq (src0->type , cc, src1->ne [1 ], /* n_experts= */ 0 );
22232223 use_mul_mat_f = use_mul_mat_f && ggml_cuda_should_use_mmf (src0->type , cc, warp_size, src0->ne , src0->nb , src1->ne [1 ], /* mul_mat_id=*/ false );
22242224 use_mul_mat_vec_f = use_mul_mat_vec_f && ggml_cuda_should_use_mmvf (src0->type , cc, src0->ne , src0->nb , src1->ne [1 ]);
22252225 any_gpus_with_slow_fp16 = any_gpus_with_slow_fp16 || !fast_fp16_hardware_available (cc);
@@ -2287,7 +2287,7 @@ static void ggml_cuda_mul_mat_id(ggml_backend_cuda_context & ctx, ggml_tensor *
22872287 return ;
22882288 }
22892289
2290- if (ggml_cuda_should_use_mmq (src0->type , cc, ne12)) {
2290+ if (ggml_cuda_should_use_mmq (src0->type , cc, ne12, /* n_experts= */ ne02 )) {
22912291 ggml_cuda_mul_mat_q (ctx, src0, src1, ids, dst);
22922292 return ;
22932293 }
0 commit comments