Skip to content

Commit f8a0deb

Browse files
committed
init diffusion
1 parent 1079d5e commit f8a0deb

File tree

6 files changed

+1395
-0
lines changed

6 files changed

+1395
-0
lines changed

include/gc/Transforms/Passes.td

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,25 @@ def GCCPUPipeline: Pass<"gc-cpu-pipeline"> {
4646
"vector::VectorDialect"];
4747
}
4848

49+
def AnyTilableFusion : Pass<"any-tilable-fusion",
50+
"func::FuncOp"> {
51+
let summary = "Fusion for any tilable operation";
52+
let description = [{
53+
The pass tries to fuse any MLIR operation which can be tiled. Moreover, this pass aims to support:
54+
1. Matmul fusion with element-wise/reduce/broadcast ops.
55+
2. Pre-op and post-op fusion.
56+
3. Multi-consumer and multi-producer support.
57+
4. Cost-model to determine whether to fuse or not.
58+
5. TBC
59+
60+
It intends to control the granularity of fusion by `fusion-level`, E.g.
61+
* `0`: disable any fusion.
62+
* `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.
63+
* `2`: `LEVEL 1` + extend to any topology including branches.
64+
* `3`: `LEVEL 2` + support coarse-grained fusion.
65+
}];
66+
let dependentDialects = ["func::FuncDialect", "linalg::LinalgDialect", "scf::SCFDialect",
67+
"tensor::TensorDialect"];
68+
}
69+
4970
#endif // GC_DIALECT_GC_PASSES

0 commit comments

Comments
 (0)