This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][transform] Support dynamic tile sizes in TileToForeachThreadOp
ClosedPublic

Authored by springerm on Aug 16 2022, 1:52 AM.

Details

Summary

TileToForeachThreadOp now accepts mixed SSA value operands / index attributes for tile_sizes and num_threads. (Reusing OperandsOrIntegersSizesList.) In case of an operand, a PDL_Operation must be specified that is mapped to a payload op that returns the tile size or number of threads.

Diff Detail

Event Timeline

springerm created this revision.Aug 16 2022, 1:52 AM
springerm requested review of this revision.Aug 16 2022, 1:52 AM

Generally LGTM once comments are addressed.

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
1028

Some comment for this plz?

1048

nit: add the index for better debugging: "num_threads #" << index << "..."

1056

nit: add the index for better debugging: "num_threads #" << index << "..."

1067

Seems like an opportunity to factor out all this duplicated code

1140

Hmm this is frustrating .. I think I saw @Mogball touch something related to these lists of index or attr recently ?

1217

There should already be code available to avoid duplicating all this, see dispatchIndexOpFoldResults
If that does not fit the bill, could you evolve into a better refactoring?.

1231

ditto

springerm updated this revision to Diff 454438.Aug 22 2022, 3:15 AM
springerm marked 5 inline comments as done.

address comments

springerm marked 2 inline comments as done.Aug 22 2022, 3:15 AM
springerm added inline comments.
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
1140

oilist did the trick!

springerm edited the summary of this revision. (Show Details)Aug 22 2022, 3:15 AM
nicolasvasilache accepted this revision.Aug 22 2022, 7:22 AM
nicolasvasilache added inline comments.
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
1140

great!

This revision is now accepted and ready to land.Aug 22 2022, 7:22 AM