Page MenuHomePhabricator

[mlir][gpu][NFC] Simplify conversion of MMA type to NVVM
ClosedPublic

Authored by ThomasRaoux on Jun 7 2021, 10:29 PM.

Details

Summary

Consolidate the type conversion in a single function to make it simpler to use. This allow to re-use the type conversion for up-coming ops.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Jun 7 2021, 10:29 PM
ThomasRaoux requested review of this revision.Jun 7 2021, 10:29 PM
herhut accepted this revision.Jun 9 2021, 8:39 AM

Nice cleanup and fixes. Thanks!

mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
243

Can you use an SubgroupMmaStoreMatrixOp::Adapter here instead of operands[0]?

There are other instances in this pattern that read operands from the original op instead of using the passed in operands via an adapter. Those likely should also be fixed.

This revision is now accepted and ready to land.Jun 9 2021, 8:39 AM

Address review comments

mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
243

Good point, I fixed those.

This revision was landed with ongoing or failed builds.Jun 9 2021, 9:34 AM
This revision was automatically updated to reflect the committed changes.
gl041188 changed the edit policy from "All Users" to "gl041188 (guanlong huang)".Jul 3 2021, 5:25 PM
ThomasRaoux changed the edit policy from "gl041188 (guanlong huang)" to "All Users".Jul 3 2021, 8:26 PM

Nice cleanup!

mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp
54

As another step, we should perhaps have "AOp" and "BOp" defined as constant strings somewhere in MMAMatrixType or in GPUDialect instead of hardcoding at several places.