This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add Linalg support for integer (generalized) matmuls
ClosedPublic

Authored by GMNGeoffrey on Feb 18 2021, 3:41 PM.

Details

Summary

This patch adds Linalg named ops for various types of integer matmuls.
Due to limitations in the tc spec/linalg-ods-gen ops cannot be type
polymorphic, so this instead creates new ops (improvements to the
methods for defining Linalg named ops are underway with a prototype at
https://github.com/stellaraccident/mlir-linalgpy).

To avoid the necessity of directly referencing these many new ops, this
adds additional methods to ContractionOpInterface to allow classifying
types of operations based on their indexing maps.

Diff Detail

Event Timeline

GMNGeoffrey created this revision.Feb 18 2021, 3:41 PM
GMNGeoffrey requested review of this revision.Feb 18 2021, 3:41 PM
mravishankar accepted this revision.Feb 22 2021, 10:20 AM

Looks fine to me, but would suggest waiting for @nicolasvasilache

This revision is now accepted and ready to land.Feb 22 2021, 10:20 AM
bondhugula added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
40

Typo: the -> that

51

Likewise and everywhere below.

GMNGeoffrey added inline comments.Feb 22 2021, 11:38 AM
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
40

No "the" is correct here: "the given op"

bondhugula added inline comments.Feb 22 2021, 1:00 PM
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
40

There are two "the"s in the sentence - I was referring to the second one.

the correspond -> that correspond

GMNGeoffrey marked an inline comment as done.Feb 22 2021, 1:11 PM
GMNGeoffrey added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
40

Ah, quite right, thank you :-) https://reviews.llvm.org/D97220 is the fix