[Mlir-commits] [mlir] [mlir][vector] Add patterns to simplify chained reductions (PR #73048)
Jakub Kuderski
llvmlistbot at llvm.org
Wed Nov 29 17:45:49 PST 2023
kuhar wrote:
> Thanks for adding this. I think it's very useful! Have you looked at what split reduction does? I haven't found a case where these chains happens when split reduction is used. We only generate one reduction at the very end.
Can you point me to some relevant example? In my instance these chained reductions happen as a result of vector unrolling.
> Also wondering if we should enable this only for more aggressive fp modes (I think we have a "fp reassociation" flag in IREE) as the transformation is changing the order in which elements are reduced. I use to fall back to this trivial chain of reductions when debugging numerical issues because they preserve the scalar execution order to some extent.
That's why I didn't want to enable it by default or add to some common set of vector patterns. I added a note about this in the documentation comment. In the GPU codegen in IREE we already did an equivalent reassociation in the vector reduction to gpu pass, so I don't expect any regressions there.
https://github.com/llvm/llvm-project/pull/73048
More information about the Mlir-commits
mailing list