[all-commits] [llvm/llvm-project] a3655d: [mlir][OpDSL] Add support for basic rank polymorph...

Tobias Gysi via All-commits all-commits at lists.llvm.org
Fri Feb 11 00:28:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a3655de2c81fc959590c109d81a010fc8e09c48e
      https://github.com/llvm/llvm-project/commit/a3655de2c81fc959590c109d81a010fc8e09c48e
  Author: gysit <gysit at google.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M mlir/docs/Dialects/Linalg/OpDSL.md
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
    M mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
    M mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
    M mlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
    M mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
    A mlir/test/python/dialects/linalg/opdsl/emit_fill.py
    M mlir/test/python/dialects/linalg/ops.py
    M mlir/test/python/integration/dialects/linalg/opsrun.py
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

  Log Message:
  -----------
  [mlir][OpDSL] Add support for basic rank polymorphism.

Previously, OpDSL did not support rank polymorphism, which required a separate implementation of linalg.fill. This revision extends OpDSL to support rank polymorphism for a limited class of operations that access only scalars and tensors of rank zero. At operation instantiation time, it scales these scalar computations to multi-dimensional pointwise computations by replacing the empty indexing maps with identity index maps. The revision does not change the DSL itself, instead it adapts the Python emitter and the YAML generator to generate different indexing maps and and iterators depending on the rank of the first output.

Additionally, the revision introduces a `linalg.fill_tensor` operation that in a future revision shall replace the current handwritten `linalg.fill` operation. `linalg.fill_tensor` is thus only temporarily available and will be renamed to `linalg.fill`.

Reviewed By: nicolasvasilache, stellaraccident

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




More information about the All-commits mailing list