[Mlir-commits] [mlir] [mlir][vector] Document dimension kinds in `vector.contract` (NFC) (PR #230458)
Federico Bruzzone
llvmlistbot at llvm.org
Sun Oct 11 06:36:28 PDT 2026
https://github.com/FedericoBruzzone updated https://github.com/llvm/llvm-project/pull/230458
>From 71a3e5ccecaaa2900687e5bba7a87443d1b6cfcf Mon Sep 17 00:00:00 2001
From: Federico Bruzzone <federico.bruzzone.i at gmail.com>
Date: Fri, 9 Oct 2026 13:28:03 +0200
Subject: [PATCH 1/2] [mlir][vector] Document dimension kinds in
`vector.contract`
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
---
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
index 3309e8a546a5e..468d04c5891ef 100644
--- a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
+++ b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
@@ -100,6 +100,16 @@ def Vector_ContractionOp :
are unrelated to each other and do not co-iterate, which
should be expressed in their indexing maps.
+ Depending on its iterator type and on the operands it indexes, a dimension
+ is one of the following kinds:
+
+ | Iterator type | In output | In lhs and rhs | Kind |
+ | ------------- | --------- | -------------- | -------------------------- |
+ | "parallel" | yes | both | batch |
+ | "parallel" | yes | one of them | free |
+ | "reduction" | no | both | contracting |
+ | "reduction" | no | one of them | reduction on one operand |
+
An indexing map attribute list must be specified with an entry for lhs, rhs
and acc arguments. An indexing map attribute specifies a mapping from each
iterator in the iterator type list, to each dimension of an N-D vector.
>From 9c671b5807d3a0714d1c4eec961d3488a58db709 Mon Sep 17 00:00:00 2001
From: Federico Bruzzone <federico.bruzzone.i at gmail.com>
Date: Sun, 11 Oct 2026 15:36:07 +0200
Subject: [PATCH 2/2] Minor update
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
---
.../include/mlir/Dialect/Vector/IR/VectorOps.td | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
index 468d04c5891ef..e782c33094d5e 100644
--- a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
+++ b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
@@ -103,12 +103,17 @@ def Vector_ContractionOp :
Depending on its iterator type and on the operands it indexes, a dimension
is one of the following kinds:
- | Iterator type | In output | In lhs and rhs | Kind |
- | ------------- | --------- | -------------- | -------------------------- |
- | "parallel" | yes | both | batch |
- | "parallel" | yes | one of them | free |
- | "reduction" | no | both | contracting |
- | "reduction" | no | one of them | reduction on one operand |
+ | Iterator type | In output | In lhs and rhs | Kind |
+ | ------------- | --------- | -------------- | ------------------------ |
+ | "parallel" | yes | both | batch |
+ | "parallel" | yes | lhs only | free (M-like) |
+ | "parallel" | yes | rhs only | free (N-like) |
+ | "reduction" | no | both | contracting |
+ | "reduction" | no | one of them | reduction on one operand |
+
+ The M-like and N-like terms follow
+ [`linalg.contract`](https://mlir.llvm.org/docs/Dialects/Linalg/#linalgcontract-linalgcontractop)
+ terminology.
An indexing map attribute list must be specified with an entry for lhs, rhs
and acc arguments. An indexing map attribute specifies a mapping from each
More information about the Mlir-commits
mailing list