Skip to content

Commit eb60103

Browse files
committed
fix use_kq_norm
1 parent c540db6 commit eb60103

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/llama-model.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6326,6 +6326,14 @@ struct llm_build_llama : public llm_graph_context {
63266326
cb(Kcur, "Kcur", il);
63276327
cb(Vcur, "Vcur", il);
63286328

6329+
if (hparams.use_kq_norm) {
6330+
// Llama4TextL2Norm
6331+
Qcur = ggml_rms_norm(ctx0, Qcur, hparams.f_norm_rms_eps);
6332+
Kcur = ggml_rms_norm(ctx0, Kcur, hparams.f_norm_rms_eps);
6333+
cb(Qcur, "Qcur_normed", il);
6334+
cb(Kcur, "Kcur_normed", il);
6335+
}
6336+
63296337
cur = build_attn(inp_attn,
63306338
model.layers[il].wo, model.layers[il].bo,
63316339
Qcur, Kcur, Vcur, nullptr, nullptr, nullptr, kq_scale, il);

0 commit comments

Comments
 (0)