"llm/git@developer.sourcefind.cn:orangecat/ollama.git" did not exist on "8a8c7e7f8dcf4b71601e9912e6dbc12064d77a24"
Unverified Commit d309e02f authored by Paul Fultz II's avatar Paul Fultz II Committed by GitHub
Browse files

Only fuse add with layernorm when its used once (#1529)

This prevents multiple adds.
parent 8b651eee
......@@ -100,7 +100,8 @@ struct find_add_layernorm
{
auto matcher() const
{
return match::layernorm()(match::var("x")(match::name("add").bind("add")));
return match::layernorm()(
match::var("x")(match::name("add")(match::used_once()).bind("add")));
}
void apply(module& m, const match::matcher_result& r) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment