[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
Thu May 14 23:22:36 PDT 2020


mravishankar added a comment.

In D79838#2037821 <https://reviews.llvm.org/D79838#2037821>, @nicolasvasilache wrote:

> How much of this special casing is impacted by the lack of existence (today) of the tied input/output tensor.
>  It seems to me once we have that, the constant op would (roughly) look like:
>
>   %1 = linalg.generic {args_in = 1 : i64, args_out = 1 : i64, indexing_maps = [#map0], iterator_types = ["parallel"}] %0 {
>     ^bb0(%arg1: f32, %arg2: f32):
>        %cst = constant 42.0: f32
>        linalg.yield %cst : f32
>   }: tensor<5xf32> -> tensor<5xf32>
>
>
> And we would use a generic form of fusion.
>  I think it is fine for now to unblock progress but, if you agree, we should mark this as TBD.


I dont think this is related to tied input/output tensors. I might be missing something here, but the tied input/output tensor is for initialization sorts of things (a symptom of such a thing is when one of the iterator types is "reduction"). There are cases I have seen in IREE where some operands to pointwise-add are splat constants (I dont know why that is the case though in the input though, havent dug into it)


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