[PATCH] D73826: [mlir][Linalg][WIP][RFC] OpGen hooks

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 07:33:16 PST 2020


nicolasvasilache added a comment.

@jpienaar @mehdi_amini !pingplease.

> The above functionality could already be handled with OpInterfaces + the way export generation is handled for TFLite dialect [which doesn't use OpInterfaces as that predated it, but could], one need not change OpDefinitionGen to get this behavior.

This is not actionable for me, I do not see how to declaratively express AffineMaps in a declarative fashion in Tablegen and generating the proper OpInterface methods without the OpDefinitionGen hook.
Concretely, the following is the full declarative definition of the MatvecOp attributes proposed by this revision and replaces a bunch of C++ code scattered in various places:

  def MatvecOp : LinalgNamedStructured_Op<"matvec", [NInputs<2>, NOutputs<1>]> {
    let arguments = (ins AnyStridedMemRefOfRank<2>,
                         AnyStridedMemRefOfRank<1>,
                         AnyStridedMemRefOfRank<1>);
    let hasLibraryImpl = 1;
    let iterators = ["i", "r_j"];
    let iterators_types = ["parallel", "reduction"];
    //   A(i, r_j) * B(r_j) -> C(i)
    let input_indexing_maps = [AffineExpressions<["i", "r_j"]>,
                               AffineExpressions<["r_j"]>];
    let output_indexing_maps = [AffineExpressions<["i"]>];
    let hasFolder = 1;
  }

please provide something concrete and actionable or reconsider a temporary solution to unblock progress.
I am happy to use any mechanism deemed appropriate that works, I do not see one with my current understanding of the stack.

Lastly, this revision raises 6 points that are important to solve in the grander vision of Linalg and Tensor Compute Primitives, we should move the needle so we can start answering those key questions.


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