Skip to content

Commit 5cc9bca

Browse files
committed
init diffusion
1 parent 5de3506 commit 5cc9bca

File tree

6 files changed

+1395
-0
lines changed

6 files changed

+1395
-0
lines changed

include/gc/Transforms/Passes.td

+21
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,25 @@ def ConvertOneDNNGraphToLinalg : Pass<"convert-onednn-graph-to-linalg"> {
3131
];
3232
}
3333

34+
def AnyTilableFusion : Pass<"any-tilable-fusion",
35+
"func::FuncOp"> {
36+
let summary = "Fusion for any tilable operation";
37+
let description = [{
38+
The pass tries to fuse any MLIR operation which can be tiled. Moreover, this pass aims to support:
39+
1. Matmul fusion with element-wise/reduce/broadcast ops.
40+
2. Pre-op and post-op fusion.
41+
3. Multi-consumer and multi-producer support.
42+
4. Cost-model to determine whether to fuse or not.
43+
5. TBC
44+
45+
It intends to control the granularity of fusion by `fusion-level`, E.g.
46+
* `0`: disable any fusion.
47+
* `1`:[Default] enable pre-op fusion + post-op fusion covering any tilable operation including tensor.pack/tensor.fill/linalg.reduce etc but excluding branches forked by multiple uses.
48+
* `2`: `LEVEL 1` + extend to any topology including branches.
49+
* `3`: `LEVEL 2` + support coarse-grained fusion.
50+
}];
51+
let dependentDialects = ["func::FuncDialect", "linalg::LinalgDialect", "scf::SCFDialect",
52+
"tensor::TensorDialect"];
53+
}
54+
3455
#endif // GC_DIALECT_GC_PASSES

0 commit comments

Comments
 (0)