Skip to content

Commit 1fa34f4

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

File tree

6 files changed

+1398
-0
lines changed

6 files changed

+1398
-0
lines changed

include/gc/Transforms/Passes.td

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,26 @@ 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, not only for elementiwse op,
39+
but also for reduction or packed operation. Moreover, this pass aims to support:
40+
1. Matmul fusion with element-wise/reduce/broadcast ops.
41+
2. Pre-op and post-op fusion.
42+
3. Multi-consumer and multi-producer support.
43+
4. Cost-model to determine whether to fuse or not.
44+
5. TBC
45+
46+
It intends to control the granularity of fusion by `fusion-level`, E.g.
47+
* `0`: disable any fusion.
48+
* `1`:[Default] enable pre-op fusion + post-op fusion covering any tilable operation including tensor.pack/tensor.fill/linalg.reduce etc but excluding branches with multiple outputs.
49+
* `2`: `LEVEL 1` + extend to any topology including branches.
50+
* `3`: `LEVEL 2` + support coarse-grained fusion.
51+
}];
52+
let dependentDialects = ["func::FuncDialect", "linalg::LinalgDialect", "scf::SCFDialect",
53+
"tensor::TensorDialect"];
54+
}
55+
3456
#endif // GC_DIALECT_GC_PASSES

0 commit comments

Comments
 (0)