Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 41e8c56

Browse files
committed
Revert "[mlir][linalg] Introduce transpose semantic to 'linalg.matmul' ops. (#104783)"
This reverts commit 8d08ebb and 99c8557, which is a fix-up on top of the former. I'm reverting because this commit broke two tests: mlir/test/python/integration/dialects/linalg/opsrun.py mlir/test/python/integration/dialects/transform.py See https://lab.llvm.org/buildbot/#/builders/138/builds/4872 I'm not familiar with the tests, so I'm leaving it to the original author to either remove or adapt the broken tests, as discussed here: llvm/llvm-project#104783 (comment)
1 parent 8d08ebb commit 41e8c56

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,23 @@ def select(
383383
O[None] = TernaryFn.select(cond[None], lhs[None], rhs[None])
384384

385385

386+
@linalg_structured_op
387+
def matmul(
388+
A=TensorDef(T1, S.M, S.K),
389+
B=TensorDef(T2, S.K, S.N),
390+
C=TensorDef(U, S.M, S.N, output=True),
391+
cast=TypeFnAttrDef(default=TypeFn.cast_signed),
392+
):
393+
"""Performs a matrix multiplication of two 2D inputs.
394+
395+
Numeric casting is performed on the operands to the inner multiply, promoting
396+
them to the same data type as the accumulator/output.
397+
"""
398+
domain(D.m, D.n, D.k)
399+
implements(ContractionOpInterface)
400+
C[D.m, D.n] += cast(U, A[D.m, D.k]) * cast(U, B[D.k, D.n])
401+
402+
386403
@linalg_structured_op
387404
def quantized_matmul(
388405
A=TensorDef(T1, S.M, S.K),

0 commit comments

Comments
 (0)