Skip to content

Commit

Permalink
Only fuse pointwise with layernorm on the first argument (#3679)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 authored and apwojcik committed Dec 12, 2024
1 parent 7eef2b3 commit b72708a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/targets/gpu/fuse_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ struct find_layernorm_pointwise
{
auto matcher() const
{
return precompile_name("pointwise")(match::any_of[match::inputs()](
return precompile_name("pointwise")(match::arg(0)(
precompile_name("gpu::prelayernorm", "gpu::preadd_layernorm").bind("layernorm")));
}

Expand Down
3 changes: 1 addition & 2 deletions test/gpu/fuse_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ TEST_CASE(layernorm_pointwise)
{
migraphx::program p1 = create_program(false);
run_pass(p1);
migraphx::program p2 = create_fused_program();
EXPECT(p1 == p2);
EXPECT(p1 == create_program(false));
}
}

Expand Down

0 comments on commit b72708a

Please sign in to comment.