From: 0cc4m Date: Tue, 20 May 2025 08:11:56 +0000 (+0200) Subject: Set GLM4 blk.*.attn_output.weight, kqv_out-* matmul to GGML_PREC_F32 to fix infinity... X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=c9c64dee572c5eedf073a6c6eb5d92d8283f7639;p=pkg%2Fggml%2Fsources%2Fllama.cpp Set GLM4 blk.*.attn_output.weight, kqv_out-* matmul to GGML_PREC_F32 to fix infinity values in output (#13639) --- diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp index 410d2608..e745b41e 100644 --- a/src/llama-graph.cpp +++ b/src/llama-graph.cpp @@ -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) {