[Mlir-commits] [mlir] [mlir][scf] Extend fuse producer to multi-level candidates case (PR #97803)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jul 8 19:12:00 PDT 2024


Yun-Fly wrote:

> Thanks! Please give me some time to review. Broadly my concern is how do you control which loop nest you want to fuse into when you are doing multiple tiling levels... I can see it is being controlled by API knobs, but those seem fragile. I need to look more in detail though.

Good question! In plan, this PR just focuses on the functionality extension. In another word, user is responsible for deciding which loop nest to fuse by feeding specific candidate into `tileAndFuseProducerOfSlice` which can accept candidates at any tiling level.

BTW, as introduced in this early [RFC](https://discourse.llvm.org/t/rfc-introduce-new-pass-transform-fusion-by-diffusion/79603), we intend to design a higher-level utility or API to control which loop nest to fuse based on semantic check(_validity_) and cost model(_performance_), both of which is expected to be designed as an call-back option with default behavior.

I can give you more example for details:

```
%0 = tensor.pack ins() out() : tensor<128x256xf32> -> tensor<16x8 x 8x32 xf32>
%1 = scf.for()
   %2 = extract_slice
   %3 = scf.for() 
   %4 = extract_slice
```

Looking forward to hear your advice!


https://github.com/llvm/llvm-project/pull/97803


More information about the Mlir-commits mailing list