[all-commits] [llvm/llvm-project] 24357f: [mlir][OpDSL] Add arithmetic function attributes.

Tobias Gysi via All-commits all-commits at lists.llvm.org
Mon Feb 28 23:46:23 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 24357fec8d706b1ef3b0a34432f7e10a8e6b2151
      https://github.com/llvm/llvm-project/commit/24357fec8d706b1ef3b0a34432f7e10a8e6b2151
  Author: gysit <gysit at google.com>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M mlir/docs/Dialects/Linalg/OpDSL.md
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
    M mlir/python/mlir/dialects/linalg/opdsl/lang/config.py
    M mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py
    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
    M mlir/test/python/dialects/linalg/opdsl/arguments.py
    M mlir/test/python/dialects/linalg/opdsl/assignments.py
    M mlir/test/python/dialects/linalg/opdsl/emit_pooling.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 arithmetic function attributes.

The revision extends OpDSL with unary and binary function attributes. A function attribute, makes the operations used in the body of a structured operation configurable. For example, a pooling operation may take an aggregation function attribute that specifies if the op shall implement a min or a max pooling. The goal of this revision is to define less and more flexible operations.

We may thus for example define an element wise op:
```
linalg.elem(lhs, rhs, outs=[out], op=BinaryFn.mul)
```
If the op argument is not set the default operation is used.

Depends On D120109

Reviewed By: nicolasvasilache, aartbik

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




More information about the All-commits mailing list