vector.mma
← vector dialect
Compute a matrix multiply-accumulate over target-shaped vector fragments. The op consumes only the physical lhs, rhs, and init vectors; logical M/N/K shape, fragment role, packed storage schema, scales, codebooks, sparse metadata, and other interpretation data are carried by vector.fragment facts on those operands. Lowering queries those facts to select native matrix instructions or a reference decomposition without baking target-specific witnesses into the MMA syntax. The optional saturate flag clamps an integer accumulation result to its destination range.
Operation contract
| Property |
Value |
| Semantic phase |
executable |
| Traits |
Pure |
| Target contracts |
vector.contraction |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
lhs |
vector |
required |
Physical lhs fragment vector. |
| Operand |
rhs |
vector |
required |
Physical rhs fragment vector. |
| Operand |
init |
vector |
required |
Physical accumulator/addend fragment vector. |
| Result |
result |
vector |
required |
Updated accumulator/result fragment vector. |
| Attribute |
flags |
flags MmaFlags |
optional |
— |
Verification constraints
Examples
%r = vector.mma %lhs, %rhs, %init : vector<8xf16>, vector<8xf16>, vector<8xf32>
%r = vector.mma<saturate> %lhs, %rhs, %init : vector<32xi8>, vector<32xi8>, vector<8xi32>
%r = vector.mma %lhs, %rhs, %init : vector<6xi32>, vector<6xi32>, vector<8xf32>