This is an archive of the discontinued LLVM Phabricator instance.

[mlir][AMDGPU] Define wrappers for WMMA matrix ops
ClosedPublic

Authored by giuseros on Jun 8 2023, 8:42 AM.

Details

Summary

Wave Matrix Multiply Accumulate (WMMA) is the instruction to accelerate
matrix multiplication on RDNA3 architectures. LLVM already provides a
set of intrinsics to generate wmma instructions. This change uses those
intrinsics to enable the feature in MLIR.

Diff Detail

Event Timeline

giuseros created this revision.Jun 8 2023, 8:42 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
giuseros requested review of this revision.Jun 8 2023, 8:42 AM

Great to see this is coming in.

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
368

I expect there's less chance the flag is misused compared to the input type is incorrectly set at some point of the lowering path.
I fell slightly better to have unsignedA/B as optional and ignore the elemType when unsignedA/B is given but no big deal.

544

Does it check sourceA.type == sourceB.type ?

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
544

Yeah, we have a AllTypesMatch<["sourceA", "sourceB"]> on the op definition.

krzysz00 accepted this revision.Jul 10 2023, 1:14 PM

Approving since I don't think there's any good reason not to merge this.

This revision is now accepted and ready to land.Jul 10 2023, 1:14 PM
This revision was automatically updated to reflect the committed changes.