Skip to content

Commit 6fe90de

Browse files
authored
models : Attach Mistral3 NVFP4 weight scales (ggml-org#23629)
1 parent 581d020 commit 6fe90de

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/models/mistral3.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ llama_model_mistral3::graph::graph(const llama_model & model, const llm_graph_pa
177177
cb(cur, "ffn_norm", il);
178178

179179
cur = build_ffn(cur,
180-
model.layers[il].ffn_up, model.layers[il].ffn_up_b, NULL,
181-
model.layers[il].ffn_gate, model.layers[il].ffn_gate_b, NULL,
182-
model.layers[il].ffn_down, model.layers[il].ffn_down_b, NULL,
180+
model.layers[il].ffn_up, model.layers[il].ffn_up_b, model.layers[il].ffn_up_s,
181+
model.layers[il].ffn_gate, model.layers[il].ffn_gate_b, model.layers[il].ffn_gate_s,
182+
model.layers[il].ffn_down, model.layers[il].ffn_down_b, model.layers[il].ffn_down_s,
183183
NULL,
184184
LLM_FFN_SILU, LLM_FFN_PAR, il);
185185
cb(cur, "ffn_out", il);
@@ -200,7 +200,11 @@ llama_model_mistral3::graph::graph(const llama_model & model, const llm_graph_pa
200200
LLM_FFN_SILU, true,
201201
hparams.expert_weights_scale,
202202
LLAMA_EXPERT_GATING_FUNC_TYPE_SOFTMAX,
203-
il);
203+
il,
204+
nullptr, nullptr,
205+
model.layers[il].ffn_up_exps_s,
206+
model.layers[il].ffn_gate_exps_s,
207+
model.layers[il].ffn_down_exps_s);
204208
cb(cur, "ffn_moe_out", il);
205209
}
206210
cur = ggml_add(ctx0, cur, ffn_inp);

0 commit comments

Comments
 (0)