This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Add basic support to do elementwise ops on mma matrix type
ClosedPublic

Authored by ThomasRaoux on Oct 29 2021, 4:30 PM.

Details

Summary

In order to support fusion with mma matrix type we need to be able to
execute elementwise operations on them. This add an op to be able to
support some basic elementwise operations. This is a is not a full
solution as it only supports a limited scope or operations. Ideally we would
want to be able to fuse with more kind of operations.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Oct 29 2021, 4:30 PM
ThomasRaoux requested review of this revision.Oct 29 2021, 4:30 PM

add missed file

mravishankar accepted this revision.Oct 29 2021, 5:25 PM

Thanks. This looks fine to me.

This revision is now accepted and ready to land.Oct 29 2021, 5:25 PM
antiagainst accepted this revision.Nov 1 2021, 7:27 AM

Also looks good to me generally. Just a few nits.

mlir/include/mlir/Dialect/GPU/GPUOps.td
1124

Is this the full list? What about listing all supported ones?

1126

So we don't differentiate int/float for add/mul but do so for max/min?

1130

elementwise operation ..

1135

Prefer to use fully qualified names like ::mlir::gpu...

1151

This doc needs to be updated; It has parts not related to this op I think? "...takes a scalar input.."

address review comments

ThomasRaoux marked 2 inline comments as done.Nov 1 2021, 11:49 AM
ThomasRaoux added inline comments.
mlir/include/mlir/Dialect/GPU/GPUOps.td
1124

This is not a full list but there are no real finite list of ops that can be supported, technically any elementwise op that does't change the matrix layout can be supported.

1126

Changed to ADDF/MULF

1151

Oops, good catch, not sure what happened there. Updated it.

This revision was landed with ongoing or failed builds.Nov 1 2021, 11:52 AM
This revision was automatically updated to reflect the committed changes.