Skip to content

Commit

Permalink
[GlobalOptimization] Add a pass to do horizontal fusion of contractio…
Browse files Browse the repository at this point in the history
…n operations with a common operand. (iree-org#17059)

This pass does a one-off horizontal fusion of contraction operations
with one common operand. It handles the case where the contraction
might be followed by a truncate operation (when the contraction is
done at higher precision, but final result is in lower precision
typical of quantized models).

The pass is off by default and can be enabled by
`--iree-global-opt-fuse-horizontal-contractions`.

Note this pass might be better off being in Preprocessing.

Co-authored-by: Quinn Dawkins <quinn.dawkins@gmail.com>
Co-authored-by: MaheshRavishankar <mahesh@nod-labs.com>

Co-authored-by: Quinn Dawkins <quinn.dawkins@gmail.com>
  • Loading branch information
pashu123 and qedawkins authored Apr 19, 2024
1 parent a2476ce commit 5ed2fec
Show file tree
Hide file tree
Showing 9 changed files with 621 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/src/iree/compiler/GlobalOptimization/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ iree_compiler_cc_library(
"EraseUnusedLinalgOperands.cpp",
"ExpandTensorShapes.cpp",
"FuseDequantizationMatmul.cpp",
"FuseHorizontalContractions.cpp",
"FuseSiluHorizontalMatmul.cpp",
"GeneralizeLinalgNamedOps.cpp",
"GlobalLoopInvariantCodeMotion.cpp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ iree_cc_library(
"EraseUnusedLinalgOperands.cpp"
"ExpandTensorShapes.cpp"
"FuseDequantizationMatmul.cpp"
"FuseHorizontalContractions.cpp"
"FuseSiluHorizontalMatmul.cpp"
"GeneralizeLinalgNamedOps.cpp"
"GlobalLoopInvariantCodeMotion.cpp"
Expand Down
Loading

0 comments on commit 5ed2fec

Please sign in to comment.