[Mlir-commits] [mlir] [mlir][vector] Document dimension kinds in `vector.contract` (NFC) (PR #230458)

Federico Bruzzone llvmlistbot at llvm.org
Sat Oct 10 09:12:30 PDT 2026


================

----------------
FedericoBruzzone wrote:

> Apologies @FedericoBruzzone , I realise that I am creating extra work for you 😅

Thanks for the review, Andrzej. And no worries, you know :D

> In general, I wasn't aware that we use/define those names. It would be great if there was some external reference where those names are used (so that we don't re-invent the wheel).

I wasn't aware of it either, and I struggled to piece together the rationale. I'm looking into the benefits of having this distinction. BTW, I'm working on a PR (i) to study how `vector.contract` is lowered depending on its maps and iterators, and (ii) to solve issue #230155.


> It would be great if there was some external reference where those names are used (so that we don't re-invent the wheel).

_Batch_, _free_ and _contracting_ come from the existing `vector.contract`description and code, this PR only summarizes.


---


Anyway, in this PR:
1. _batch_ and _contracting_ dims already have hooks:
    https://github.com/llvm/llvm-project/blob/71a3e5ccecaaa2900687e5bba7a87443d1b6cfcf/mlir/lib/Dialect/Vector/IR/VectorOps.cpp?plain=1#L1304

    https://github.com/llvm/llvm-project/blob/71a3e5ccecaaa2900687e5bba7a87443d1b6cfcf/mlir/lib/Dialect/Vector/IR/VectorOps.cpp?plain=1#L1310
     
2. Should we link the `linalg.contract` docs? `linalg.contract` seems to use terms like _M-like_ and _N-like_ for "free" dimension - I'll integrate the `linalg` term in the table to have a dircet mapping.

Re helpers for _free_ and _single-operand reduction_ dims, I'd like ot put them in a follow-up PR (in which I aim to solve #230155, as well) to keep this PR NFC. Note that `linalg.contract` does not describe _single-operand_ reductions either, so the table covers a gap there.



https://github.com/llvm/llvm-project/pull/230458


More information about the Mlir-commits mailing list