model : metal : workaround fusion for LFM3 (#32296)
* lfm3 : put the normed tensor first in residual adds to enable norm fusion Assisted-by: Claude Opus 5.5 * tests : update Metal fusion baseline for lfm3 Assisted-by: Claude Opus 5.5
This commit is contained in:
1 parent
5c008e0008
commit
e574a17b06
2 files changed
+4
-3
No files matched your search
+2
-2
@@ -179,7 +179,7 @@ llama_model_lfm3::graph<decision>::graph(const llm_graph_params & params) :
|
||||
prev_cur = ggml_get_rows(ctx0, prev_cur, inp_out_ids);
|
||||
}
|
||||
|
||||
cur = ggml_add(ctx0, prev_cur, cur);
|
||||
cur = ggml_add(ctx0, cur, prev_cur);
|
||||
|
||||
auto * ffn_norm_out = build_norm(cur, model.layers[il].ffn_norm, NULL, LLM_NORM_RMS, il);
|
||||
cb(ffn_norm_out, "model.layers.{}.ffn_norm", il);
|
||||
@@ -191,7 +191,7 @@ llama_model_lfm3::graph<decision>::graph(const llm_graph_params & params) :
|
||||
cb(ffn_out, "model.layers.{}.post_ffn_norm", il);
|
||||
}
|
||||
|
||||
cur = ggml_add(ctx0, cur, ffn_out);
|
||||
cur = ggml_add(ctx0, ffn_out, cur);
|
||||
|
||||
cur = build_cvec(cur, il);
|
||||
cb(cur, "l_out", il);
|
||||
|
||||
@@ -194,7 +194,8 @@ lfm2 ,0 ,any ,RMS_NORM+MUL , 7
|
||||
lfm2moe ,1 ,any ,MUL+ADD , 2
|
||||
lfm2moe ,1 ,any ,RMS_NORM+MUL , 7
|
||||
lfm2moe ,1 ,any ,UNARY+ADD+ARGSORT+GET_ROWS+SUM_ROWS+CLAMP+DIV, 1
|
||||
lfm3 ,0 ,any ,RMS_NORM+MUL , 17
|
||||
lfm3 ,0 ,any ,RMS_NORM+MUL , 12
|
||||
lfm3 ,0 ,any ,RMS_NORM+MUL+ADD , 5
|
||||
llada ,0 ,any ,RMS_NORM+MUL , 5
|
||||
llada-moe ,1 ,any ,MUL+ADD , 4
|
||||
llada-moe ,1 ,any ,RMS_NORM+MUL , 9
|
||||
|
||||
|
Reference in new issue
Block a user