This is an archive of the discontinued LLVM Phabricator instance.

[mlir][nvgpu] Implement `nvgpu.device_async_copy` by NVVMToLLVM Pass
ClosedPublic

Authored by guraypp on Jul 3 2023, 6:53 AM.

Details

Summary

nvgpu.device_async_copy is lowered into cp.async PTX instruction. However, NVPTX backend does not support its all mode especially when zero padding is needed. Therefore, current MLIR implementation genereates inline assembly for that.

This work simplifies PTX generation for nvgpu.device_async_copy, and implements it by NVVMToLLVM Pass.

Depends on D154060

Diff Detail

Event Timeline

guraypp created this revision.Jul 3 2023, 6:53 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
guraypp requested review of this revision.Jul 3 2023, 6:53 AM
manishucsd added inline comments.
mlir/test/Conversion/NVGPUToNVVM/typed-pointers.mlir
31

Removing bypass_l1 from the nvvm.cp. async and matching it with ptx spec more closely looks great! Thanks for working on it.

Should we also work towards removing bypass_l1 from nvgpu.device_async_copy in future?

manishucsd accepted this revision.Jul 4 2023, 11:37 PM
This revision is now accepted and ready to land.Jul 4 2023, 11:37 PM
guraypp updated this revision to Diff 537366.Jul 5 2023, 8:30 AM

Implement it with the interface

guraypp added inline comments.Jul 5 2023, 8:33 AM
mlir/test/Conversion/NVGPUToNVVM/typed-pointers.mlir
31

Good point, I think we should delete bypass_l1 and use the PTXs cache modifiers there.

nicolasvasilache accepted this revision.Jul 11 2023, 1:52 AM
nicolasvasilache added inline comments.
mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp
371

it is great that we can rationalize this more cleanly, thanks for this!

mlir/test/Dialect/NVGPU/invalid.mlir
197

nit: nl

guraypp updated this revision to Diff 538989.Jul 11 2023, 2:51 AM

rebase and address the comments

This revision was landed with ongoing or failed builds.Jul 11 2023, 3:18 AM
This revision was automatically updated to reflect the committed changes.