[PATCH] D79838: [mlir][Linalg] Add producer-consumer fusion when producer is a ConstantOp and Consumer is a GenericOp.

Mahesh Ravishankar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 20 09:48:55 PDT 2020


mravishankar added a comment.

> The point is that one would translate ConstantOp to Linalg generic beforehand and not introduce op-dependent special-casing in fusion.
>  Special casing in transformations is what we want to avoid at all costs.

I agree. I am moving this pattern from IREE into here. In IREE I was lowering a ConstantOp to a GenericOp and using the fusion between two generic Ops. But that resulted in a generic op with 0 input arguments and 1 output argument. In an offline conversation I gathered that this was unexpected and future verifier semantics might make that illegal. I also seemed to be having some really nasty segfaults which I wasnt able to root cause. This gets around that. I am happy to drop it in favor of lowering a constant op to generic op transformation and fusion. On balance I prefer this way cause both of these live in core and avoids additional hops. Totally agree that we should avoid special casing, but at the level of tensors through the special casing is very localized. So its code overhead and more patterns, but doesnt propogate past the pattern (still need to be cognizant that we shouldnt have a lot of such pairwise combinations)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79838/new/

https://reviews.llvm.org/D79838





More information about the llvm-commits mailing list