[all-commits] [llvm/llvm-project] 6c9541: Implement simple type polymorphism for linalg name...

Stella Laurenzo via All-commits all-commits at lists.llvm.org
Sun Feb 21 14:33:56 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c9541d4ddfdab0dcb11436485b466a759c3126c
      https://github.com/llvm/llvm-project/commit/6c9541d4ddfdab0dcb11436485b466a759c3126c
  Author: Stella Laurenzo <stellaraccident at gmail.com>
  Date:   2021-02-21 (Sun, 21 Feb 2021)

  Changed paths:
    M mlir/docs/Dialects/Linalg.md
    M mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
    A mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
    M mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    A mlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
    M mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
    A mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

  Log Message:
  -----------
  Implement simple type polymorphism for linalg named ops.

* It was decided that this was the end of the line for the existing custom tc parser/generator, and this is the first step to replacing it with a declarative format that maps well to mathy source languages.
* One such source language is implemented here: https://github.com/stellaraccident/mlir-linalgpy/blob/main/samples/mm.py
  * In fact, this is the exact source of the declarative `polymorphic_matmul` in this change.
  * I am working separately to clean this python implementation up and add it to MLIR (probably as `mlir.tools.linalg_opgen` or equiv). The scope of the python side is greater than just generating named ops: the ops are callable and directly emit `linalg.generic` ops fully dynamically, and this is intended to be a feature for frontends like npcomp to define custom linear algebra ops at runtime.
* There is more work required to handle full type polymorphism, especially with respect to integer formulations, since they require more specificity wrt types.
* Followups to this change will bring the new generator to feature parity with the current one and delete the current. Roughly, this involves adding support for interface declarations and attribute symbol bindings.

Differential Revision: https://reviews.llvm.org/D97135




More information about the All-commits mailing list