This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Support pre-existing tokens in 'gpu-async-region'
ClosedPublic

Authored by csigg on May 31 2021, 4:10 AM.

Details

Summary

Allow gpu ops implementing the async interface to already be async when running the GpuAsyncRegionPass.
That pass threads a 'current token' through a block with ops implementing the gpu async interface.

After this change, existing async ops (returning a !gpu.async.token) set the current token.
Existing synchronous gpu.wait ops reset the current token.

Diff Detail

Event Timeline

csigg created this revision.May 31 2021, 4:10 AM
csigg requested review of this revision.May 31 2021, 4:10 AM
csigg updated this revision to Diff 349212.Jun 2 2021, 3:06 AM

Recursively walk ops in blocks.

csigg updated this revision to Diff 350039.Jun 5 2021, 1:24 AM

Rebase.

herhut accepted this revision.Jun 9 2021, 3:34 AM

Looks good modulo disabling multithreading. I assume that is a left-over from debugging?

mlir/lib/Dialect/GPU/Transforms/AsyncRegionRewriter.cpp
331

Why is this needed? It should be possible to run on multiple functions independently, no?

This revision is now accepted and ready to land.Jun 9 2021, 3:34 AM
csigg added inline comments.Jun 9 2021, 10:47 PM
mlir/lib/Dialect/GPU/Transforms/AsyncRegionRewriter.cpp
331

Removed, this was just debugging leftover. Thanks for catching it.

csigg updated this revision to Diff 351068.Jun 9 2021, 10:50 PM

Remove single-threading.

This revision was automatically updated to reflect the committed changes.