Commit 05389780 for whisper.cpp
commit 0538978040072fea7a4c871b28b027f70c623e1b
Author: Yonghye Kwon <developer.0hye@gmail.com>
Date: Wed Oct 28 17:13:01 2026 +0900
cuda : add top-k MoE fusion for 384 experts (llama/31288)
Assisted-by: Codex
diff --git a/ggml/src/ggml-cuda/topk-moe.cu b/ggml/src/ggml-cuda/topk-moe.cu
index 158b736f..a93d3a97 100644
--- a/ggml/src/ggml-cuda/topk-moe.cu
+++ b/ggml/src/ggml-cuda/topk-moe.cu
@@ -402,6 +402,10 @@ static void launch_topk_moe_cuda(ggml_backend_cuda_context & ctx,
ggml_cuda_kernel_launch(topk_moe_cuda<288, has_bias>, launch_params,
logits, weights, ids, bias, n_rows, n_expert_used, clamp_val, scale_val, config);
break;
+ case 384: // DeepSeek V4.1
+ ggml_cuda_kernel_launch(topk_moe_cuda<384, has_bias>, launch_params,
+ logits, weights, ids, bias, n_rows, n_expert_used, clamp_val, scale_val, config);
+ break;
case 512:
ggml_cuda_kernel_launch(topk_moe_cuda<512, has_bias>, launch_params,
logits, weights, ids, bias, n_rows, n_expert_used, clamp_val, scale_val, config);
@@ -472,7 +476,7 @@ bool ggml_cuda_should_use_topk_moe(const ggml_tensor * gating_op,
// must match an instantiation of launch_topk_moe_cuda: a power of 2 up to 512,
// or one of the non-power-of-2 expert counts of supported models
const int n_expert = ids->nb[1] / ids->nb[0];
- if (((n_expert & (n_expert - 1)) != 0 || n_expert > 512) && n_expert != 288 && n_expert != 576) {
+ if (((n_expert & (n_expert - 1)) != 0 || n_expert > 512) && n_expert != 288 && n_expert != 384 && n_expert != 576) {
return false;
}