Commit d0764c5ee for llama.cpp
commit d0764c5ee23a889680147c9342d2b9002cb87b82
Author: Aman Gupta <amangupta052@gmail.com>
Date: Sun Nov 15 02:02:15 2026 +0800
qwen2vl : apply FFN weight scales (#32241)
The qwen2vl graph passed NULL for the ffn_up/gate/down scales, so the
per-tensor NVFP4 scales loaded by the generic pass were never applied
and the model produced garbage (PPL ~1e6 on CUDA, NaN on CPU).
Pass the scales to build_ffn like qwen2 does.
Fixes #32101
diff --git a/src/models/qwen2vl.cpp b/src/models/qwen2vl.cpp
index 5831fc435..ba72876c2 100644
--- a/src/models/qwen2vl.cpp
+++ b/src/models/qwen2vl.cpp
@@ -97,9 +97,9 @@ llama_model_qwen2vl::graph::graph(const llm_graph_params & params) : llm_graph_c
cb(cur, "ffn_norm", il);
cur = build_ffn(cur,
- model.layers[il].ffn_up, NULL, NULL,
- model.layers[il].ffn_gate, NULL, NULL,
- model.layers[il].ffn_down, NULL, NULL,
+ model.layers[il].ffn_up, NULL, model.layers[il].ffn_up_s,
+ model.layers[il].ffn_gate, NULL, model.layers[il].ffn_gate_s,
+ model.layers[il].ffn_down, NULL, model.layers[il].ffn_down_s,
NULL,
LLM_FFN_SILU, LLM_FFN_PAR, il);
cb(cur, "ffn_out", il);