]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Set GLM4 blk.*.attn_output.weight, kqv_out-* matmul to GGML_PREC_F32 to fix infinity...
author0cc4m <redacted>
Tue, 20 May 2025 08:11:56 +0000 (10:11 +0200)
committerGitHub <redacted>
Tue, 20 May 2025 08:11:56 +0000 (10:11 +0200)
src/llama-graph.cpp

index 410d2608798b84f6c5756f1aaf7aa5ae397041e4..e745b41e33077315d6156cbc7b484520f9102513 100644 (file)
@@ -1368,6 +1368,10 @@ ggml_tensor * llm_graph_context::build_attn(
 
     if (wo) {
         cur = build_lora_mm(wo, cur);
+        if (arch == LLM_ARCH_GLM4) {
+            // GLM4 seems to have numerical issues with half-precision accumulators
+            ggml_mul_mat_set_prec(cur, GGML_PREC_F32);
+        }
     }
 
     if (wo_b) {