[Mlir-commits] [mlir] [mlir] Allow blacklist ops for reduction linalg elementwise fusion (PR #144176)
Evan Liu
llvmlistbot at llvm.org
Mon Jun 16 10:41:55 PDT 2025
Evanyl wrote:
> As @rengolin suggests, it is worth considering making this configurable as a function of the IR. In particular, I can see it being useful to be able to annotate a parent scope with a `#dlti.map<"reduction-fusion-blacklist" = "linalg.elementwise<mul>"` attribute and this fusion pass respecting this attribute _for this scope_. This could be achieved by doing a `dlti::query(op, ["reduction-fusion-blacklist"])` at any `op` which is being considered for fusion. (A step further would be to have DLTI attribute that acts like an actual cost model, taking into account, e.g. tensor dim sizes and hardware info available through other DLTI attributes.)
>
> That also highlights that I am not sure the current approach works with the abstracted `linalg.elementwise<`_operator_`>` op. Does it?
This is a good idea, thank you! I'll switch over to using the `dlti.map` instead. Also might be a noob question but doesn't this pass only operate `linalg.generic`? Where is `linalg.elementwise`, i don't see it in any of the tests either.
https://github.com/llvm/llvm-project/pull/144176
More information about the Mlir-commits
mailing list