This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NVGPU][transform] Add `create_async_groups` transform op
ClosedPublic

Authored by springerm on Jul 18 2023, 2:25 AM.

Details

Summary

This transform looks for suitable vector transfers from global memory to shared memory and converts them to async device copies.

Diff Detail

Event Timeline

springerm created this revision.Jul 18 2023, 2:25 AM
Herald added a project: Restricted Project. · View Herald Transcript
springerm requested review of this revision.Jul 18 2023, 2:25 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
ftynse accepted this revision.Jul 18 2023, 2:47 AM
ftynse added a subscriber: ftynse.
ftynse added inline comments.
mlir/include/mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.td
32

at the what?

34–35

Why not call it bypass_l1 then?

39

It feels like a footgun: the target may not itself be erased, but nested ops definitely are and we are not invalidating handle to those. I'd rather make this consume the target and produce a new handle for chaining.

mlir/lib/Dialect/NVGPU/Transforms/CreateAsyncGroups.cpp
25–29

Nit: can this be extracted into a template and made common with the similar code below?

52

Nit: could this elaborate what happens with 2d masks right now?

59

Nit: "legal" is a bit too generic here. I'd rather say something like "currently supported by async copy".

95

Nit: I believe walk can take a lambda returning void so we don't need to have WalkResult::advance() everywhere.

97

Nit: no need to prefix with llvm::, here and below.

190

For future: this should be really using the data layout mechanism, which would also fix the todo related to alignment above.

191–192

I'd consider returning a (silenceable) failure if useMMASync is set and cannot be achieved. Or at least documenting this attribute as a hint rather than a guarantee.

This revision is now accepted and ready to land.Jul 18 2023, 2:47 AM
springerm marked 9 inline comments as done.Jul 18 2023, 5:37 AM
This revision was landed with ongoing or failed builds.Jul 18 2023, 5:37 AM
This revision was automatically updated to reflect the committed changes.