[PATCH] D73826: [mlir][Linalg] Provide a Tablegen backend to specify named Linalg ops declaratively
Nicolas Vasilache via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 13 07:30:21 PST 2020
nicolasvasilache added a comment.
@flaub so actually, one of the (multiple) reasons I am pushing for this is to have the ability to add a generic contraction op and a generic pointwise op as special cases :)
We already have vector.contract <https://github.com/llvm/llvm-project/blob/master/mlir/include/mlir/Dialect/VectorOps/VectorOps.td#L40> added by andydavis@ with similar semantics and it would make the rewrite to vector form <https://github.com/llvm/llvm-project/blob/master/mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp#L191> trivial.
So linalg.contract and linalg.pointwise are simple extensions of this and have the nice properties you mention.
I am unclear atm if we want autodiff to happen here (in Linalg) or at a higher level, we should discuss this in a live meeting since you have the most experience.
Still, linalg also wants to be future-proof and has additional expressiveness to represent e.g. Cholesky on triangular matrices, stencils, stacked RNNs and non-dense data types + gather/scatter in the future (but the road is still quite long until all that is available)
Lastly, this will also allow generating matchers and easily map the generic form to a library (in simple contract and pointwise cases but I conjecture also on much more complex cases, TBD :) ).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73826/new/
https://reviews.llvm.org/D73826
More information about the llvm-commits
mailing list