This is an archive of the discontinued LLVM Phabricator instance.

[mlir][AMDGPU] Define amdgpu.mfma operator
ClosedPublic

Authored by krzysz00 on Aug 30 2022, 10:20 AM.

Details

Summary

The amdgpu.mfma operator is a wrapper around the Matrix Fused Multiply
Add (MFMA) instructions on some AMD GPUs (the CDNA-based MI-* cards).

This interface allows for selecting the operation to be performed by
specifying the dimensions of the multiplication to be performed and
any additional attributes (such as whether to use reduced-precision
floating-point math) that are needed to select the relevant mfma
instruction and set its parameters.

Diff Detail

Event Timeline

krzysz00 created this revision.Aug 30 2022, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 10:20 AM
krzysz00 requested review of this revision.Aug 30 2022, 10:20 AM
nirvedhmeshram added inline comments.
mlir/include/mlir/Dialect/AMDGPU/AMDGPU.td
190

nit: alignment is a bit off

269

can this just go in the attr-dict part?

krzysz00 updated this revision to Diff 457038.Aug 31 2022, 11:35 AM

Fix alignment

krzysz00 marked an inline comment as done.Aug 31 2022, 11:36 AM
krzysz00 added inline comments.
mlir/include/mlir/Dialect/AMDGPU/AMDGPU.td
269

Not if we want the value to have a name instead of an inscruitable integer

nirvedhmeshram accepted this revision.Aug 31 2022, 11:40 AM
This revision is now accepted and ready to land.Aug 31 2022, 11:40 AM

Looks good to me. I think we need some test for the verifier.

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
291

nit: could be vectorType.getElementType().isInteger(8)

mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp
69

could you add some tests for the verifier?

krzysz00 updated this revision to Diff 457056.Aug 31 2022, 12:16 PM

Fix rebase issues

krzysz00 updated this revision to Diff 457068.Aug 31 2022, 1:11 PM

Add verifier tests

ThomasRaoux accepted this revision.Aug 31 2022, 1:16 PM
krzysz00 marked an inline comment as done.Aug 31 2022, 1:29 PM
This revision was automatically updated to reflect the committed changes.

Looks like this change introduced a failing in the windows mlir bot: https://lab.llvm.org/buildbot/#/builders/13/builds/25246/steps/6/logs/stdio. There was already another failure, so you might not have gotten an email.