[Mlir-commits] [mlir] [mlir][linalg] Convert linalg.named to linalg.elementwise op. (PR #148424)
Javed Absar
llvmlistbot at llvm.org
Mon Jul 14 03:17:17 PDT 2025
javedabsar1 wrote:
> If we had a name for each abstraction level, there could be a single pass that converts all matching ops to that representation. For everything to `generic`, there's `generalize`. For going to named ops, it's `specialize`.
>
> > named --> linalg.element_wise , linalg.contraction : This PR mlir-opt -linalg-named-to-elementwise. We can rename it to cover contraction-op etc and extend the implementation etc. (-linalg-named-to-category-ops?)
>
> This seems reasonable with a `linalg-categorize-ops` for conversion: generic -> eltwise/contract etc. <- named.
Thanks @rengolin / @adam-smnk -- we seem to be converging to something good!
An umbrella name for all this could be (borrowing a term from mathematics -- morphism).
1. `--linalg-morph-ops`
2. ` --linalg-morph-ops=generalize-named-ops` converts all named ops to generic
3. --linalg-morph-ops=generalize-all -ops` converts all named/contraction/elementwise ops to generic
4. --linalg-morph-ops=categorize-all-ops` converts named and generic ops and tries to convert to elementwise/contraction....
I may not be having the best names or option names so please suggest better ones.
https://github.com/llvm/llvm-project/pull/148424
More information about the Mlir-commits
mailing list