This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Move async copy ops to NVGPU and add caching hints
ClosedPublic

Authored by ThomasRaoux on May 9 2022, 10:34 AM.

Details

Summary

Move async copy operations to NVGPU as they only exist on NV target and are designed to match ptx semantic. This allows us to also add more fine grain caching hint attribute to the op.
Add hint to bypass L1 and hook it up to NVVM op.

Diff Detail

Event Timeline

ThomasRaoux created this revision.May 9 2022, 10:34 AM
ThomasRaoux requested review of this revision.May 9 2022, 10:34 AM

A couple of minor things, otherwise LGTM.

mlir/include/mlir/Dialect/NVGPU/NVGPU.td
172

This would change the diff from being pure code movement, but can't this have NoSideEffects?

mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
190

Is there a source of truth for this in NVVM dialect?

This (renamed) would be useful to have in the dialect header.

rebase and address review comment

ThomasRaoux added inline comments.May 9 2022, 1:08 PM
mlir/include/mlir/Dialect/NVGPU/NVGPU.td
172

The problem is that at this point we don't want re-ordering of those operations with unrelated commit op as we don't have code to reorder correctly when we lower those ops so we have to rely on operations order. This is something we should improve but I don't have a good solution at this point.

mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
190

good point, moved it there

mravishankar resigned from this revision.May 10 2022, 9:02 AM
christopherbate accepted this revision.May 10 2022, 2:18 PM

LGTM, thanks!

This revision is now accepted and ready to land.May 10 2022, 2:18 PM