This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Clean up and generalize lowering of warp_execute to scf
ClosedPublic

Authored by ThomasRaoux on Sep 13 2022, 7:14 PM.

Details

Summary

Simplify the lowering of warp_execute_on_lane0 of scf.if by making the
logic more generic. Also remove the assumption that the most inner
dimension is the dimension distributed.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Sep 13 2022, 7:14 PM
Herald added a project: Restricted Project. · View Herald Transcript
ThomasRaoux requested review of this revision.Sep 13 2022, 7:14 PM
Herald added a project: Restricted Project. · View Herald Transcript
nicolasvasilache accepted this revision.Sep 14 2022, 8:34 AM

Nice!

Please check no regressions in IREE and add new tests if something flares up.

Thanks!

mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
36

perm.reserve(...)

37

There is no yield value here, just use seq and dist types plz.

46

Shouldn't there be some sanity checks here and described in the doc?

I.e. things that divide modulo warp size, size(perm) == rank || size(perm) == rank - 1 etc ?

This revision is now accepted and ready to land.Sep 14 2022, 8:34 AM
mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
58

nit: inferred

Address review comments

ThomasRaoux marked 3 inline comments as done.Sep 14 2022, 10:20 AM
ThomasRaoux added inline comments.
mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
46

The checks are already there in the verifier so duplicating it wouldn't make a lot of sense. I added an assert checking that only one dim is distributed since this code wouldn't work otherwise.

This revision was landed with ongoing or failed builds.Sep 14 2022, 10:36 AM
This revision was automatically updated to reflect the committed changes.