diff --git a/src/models/deepseek41.cpp b/src/models/deepseek41.cpp index 4f15216544..6a9003d42b 100644 --- a/src/models/deepseek41.cpp +++ b/src/models/deepseek41.cpp @@ -577,9 +577,6 @@ ggml_tensor * llama_model_deepseek41::graph::build_attention41( ggml_tensor * iqc = ggml_view_4d(ctx0, iq, iq->ne[0], iq->ne[1], nc, n_stream, iq->nb[1], iq->nb[2], iq->nb[3], t0*iq->nb[2]); ggml_tensor * kq = ggml_mul_mat(ctx0, ik_p, ggml_permute(ctx0, iqc, 0, 2, 1, 3)); - if (!ggml_is_quantized(ik->type)) { - ggml_prec_set_src(kq, GGML_PREC_F32, 1); - } kq = ggml_cont(ctx0, ggml_permute(ctx0, kq, 2, 1, 0, 3)); score = ggml_sum_rows(ctx0, ggml_mul(ctx0, ggml_relu(ctx0, kq), rows(iw))); ggml_tensor * mask = rows(ci.kq_mask); @@ -880,12 +877,9 @@ llama_model_deepseek41::graph::graph(const llama_model & model_base, const llm_g cur = build_norm(cur, layer.ffn_norm, nullptr, LLM_NORM_RMS, il); cb(cur, "ffn_norm", il); - // F32 router inputs: expert selection is near-tie sensitive + // F32 router accumulation: expert selection is near-tie sensitive ggml_tensor * logits = build_lora_mm(layer.ffn_gate_inp, cur); ggml_prec_set_acc(logits, GGML_PREC_F32); - if (!ggml_is_quantized(layer.ffn_gate_inp->type)) { - ggml_prec_set_src(logits, GGML_PREC_F32, 1); - } cb(logits, "ffn_moe_logits", il); // image (embedding) tokens use the vision router bias, as DeepSeek-V4