We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbedf6c commit 97c7982Copy full SHA for 97c7982
src/llama-model.cpp
@@ -4803,8 +4803,21 @@ struct llm_build_llama_iswa : public llm_graph_context {
4803
ggml_tensor * ffn_inp = ggml_add(ctx0, cur, inpSA);
4804
cb(ffn_inp, "ffn_inp", il);
4805
4806
- {
4807
- // llama4 MoE
+ // feed-forward network (non-MoE)
+ if (model.layers[il].ffn_gate_inp == nullptr) {
4808
+ cur = build_norm(ffn_inp,
4809
+ model.layers[il].ffn_norm, NULL,
4810
+ LLM_NORM_RMS, il);
4811
+ cb(cur, "ffn_norm", il);
4812
+
4813
+ cur = build_ffn(cur,
4814
+ model.layers[il].ffn_up, model.layers[il].ffn_up_b, NULL,
4815
+ model.layers[il].ffn_gate, model.layers[il].ffn_gate_b, NULL,
4816
+ model.layers[il].ffn_down, model.layers[il].ffn_down_b, NULL,
4817
+ NULL,
4818
+ LLM_FFN_SILU, LLM_FFN_PAR, il);
4819
+ cb(cur, "ffn_out", il);
4820
+ } else {
4821
ggml_tensor * ffn_inp_normed = build_norm(ffn_inp,
4822
model.layers[il].ffn_norm, NULL,
4823
LLM_NORM_RMS, il);
0 commit comments