This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Replace monomorphic contration ops with polymorphic variants.
ClosedPublic

Authored by stellaraccident on Mar 1 2021, 12:08 PM.

Details

Summary
  • Moves batch_matmul, matmul, matvec, vectmat, dot to the new mechanism.
  • This is not just an NFC change, in addition to using a new code generation mechanism, it also activates symbolic casting, allowing mixed precision operands and results.
  • These definitions were generated from DSL by the tool: https://github.com/stellaraccident/mlir-linalgpy/blob/main/mlir_linalg/oplib/core.py (will be upstreamed in a subsequent set of changes).

Diff Detail

Event Timeline

stellaraccident requested review of this revision.Mar 1 2021, 12:08 PM
ThomasRaoux accepted this revision.Mar 1 2021, 12:17 PM
This revision is now accepted and ready to land.Mar 1 2021, 12:17 PM
nicolasvasilache accepted this revision.Mar 1 2021, 12:23 PM
nicolasvasilache added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc
47

I imagine a followup CL will then retire all these guys that are now a particular case of polymorphic matmul?

stellaraccident added inline comments.Mar 1 2021, 9:22 PM
mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc
47

Yes - these have made there way to a couple of downstreams, and since they don't hurt being here for a bit longer, I decided to stage it to give them time to adapt.