This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NVGPU] Add support for structured sparsity MMA variants
ClosedPublic

Authored by christopherbate on Nov 1 2022, 3:14 PM.

Details

Summary

This change adds a new NVGPU operation that targets the PTX mma.sp.sync
instruction variants. A lowering to NVVM is provided using inline
assembly.

Diff Detail

Event Timeline

christopherbate created this revision.Nov 1 2022, 3:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2022, 3:14 PM
christopherbate requested review of this revision.Nov 1 2022, 3:14 PM

Fix missing change of nvgpu metadata type to vector<2xi16>

ThomasRaoux accepted this revision.Nov 3 2022, 9:53 AM

Awesome :)

This revision is now accepted and ready to land.Nov 3 2022, 9:53 AM

Looks good. Adding some comment[s].

Do plan to use mma.sync.sp or adding it just for completion?

Would be interested to know the users of nvgpu dialect who are actively working on using mma.sync.sp instruction.

mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
448

Is it ok to move all inline asm (emit* functions including emitCpAsyncOpZfillAsm) into a its own file NVGPUToNVASM.[h/cpp]? Let me know how you feel about it.

I think we will need a few more inline asm, that I can think of, before it becomes available in nvvm backend. We can just edit NVGPUToNVASM.* file as we add more asm and prune it when it becomes available through NVVM.

ThomasRaoux added inline comments.Nov 3 2022, 10:53 AM
mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
448

I would prefer not create a file just to have inline assembly. It doesn't sound like a very natural separation of the code to me.

manishucsd accepted this revision.Nov 3 2022, 12:08 PM
christopherbate marked 2 inline comments as done.Nov 7 2022, 8:42 AM