This is an archive of the discontinued LLVM Phabricator instance.

Add linalg.batch_mmt4d named op
ClosedPublic

Authored by pzread on Aug 2 2023, 9:44 AM.

Details

Summary

This op is the batched version of linalg.mmt4d. It performs matrix-matrix-transpose multiplication of batched 4-d (5d) inputs as the following:

C[b, m1, n1, m0, n0] = sum_{b, k1, k0}(A[b, m1, k1, m0, k0] * B[b, n1, k1, n0, k0])

The current use is to provide linalg.batch_matmul a lowering path similar to linalg.matmul -> linalg.mmt4d.

Diff Detail

Event Timeline

pzread created this revision.Aug 2 2023, 9:44 AM
Herald added a project: Restricted Project. · View Herald Transcript
pzread edited the summary of this revision. (Show Details)Aug 2 2023, 9:50 AM
pzread added a reviewer: hanchung.
pzread edited the summary of this revision. (Show Details)Aug 2 2023, 9:52 AM
pzread added a reviewer: Benoit.
pzread published this revision for review.Aug 2 2023, 9:54 AM

thanks, could you add a roundtrip test to mlir/test/Dialect/Linalg/named-ops.mlir?

Benoit accepted this revision.Aug 2 2023, 10:51 AM
This revision is now accepted and ready to land.Aug 2 2023, 10:51 AM
pzread updated this revision to Diff 546579.Aug 2 2023, 12:42 PM
pzread edited the summary of this revision. (Show Details)

Add test

thanks, could you add a roundtrip test to mlir/test/Dialect/Linalg/named-ops.mlir?

Done.

hanchung accepted this revision.Aug 2 2023, 2:29 PM
This revision was automatically updated to reflect the committed changes.