Skip to content

Commit 3dfda05

Browse files
committed
llama : de-duplicate deepseek2 norm
1 parent bda62d7 commit 3dfda05

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/llama.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12873,12 +12873,12 @@ struct llm_build_context {
1287312873
struct ggml_tensor * ffn_inp = ggml_add(ctx0, cur, inpSA);
1287412874
cb(ffn_inp, "ffn_inp", il);
1287512875

12876-
if ((uint32_t) il < hparams.n_layer_dense_lead) {
12877-
cur = llm_build_norm(ctx0, ffn_inp, hparams,
12878-
model.layers[il].ffn_norm, NULL,
12879-
LLM_NORM_RMS, cb, il);
12880-
cb(cur, "ffn_norm", il);
12876+
cur = llm_build_norm(ctx0, ffn_inp, hparams,
12877+
model.layers[il].ffn_norm, NULL,
12878+
LLM_NORM_RMS, cb, il);
12879+
cb(cur, "ffn_norm", il);
1288112880

12881+
if ((uint32_t) il < hparams.n_layer_dense_lead) {
1288212882
cur = llm_build_ffn(ctx0, cur,
1288312883
model.layers[il].ffn_up, NULL, NULL,
1288412884
model.layers[il].ffn_gate, NULL, NULL,
@@ -12888,11 +12888,6 @@ struct llm_build_context {
1288812888
cb(cur, "ffn_out", il);
1288912889
} else {
1289012890
// MoE branch
12891-
cur = llm_build_norm(ctx0, ffn_inp, hparams,
12892-
model.layers[il].ffn_norm, NULL,
12893-
LLM_NORM_RMS, cb, il);
12894-
cb(cur, "ffn_norm", il);
12895-
1289612891
ggml_tensor * moe_out =
1289712892
llm_build_moe_ffn(ctx0, cur,
1289812893
model.layers[il].ffn_gate_inp,

0 commit comments

Comments
 (0)