This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Implement tileReductionUsingScf for multiple reductions
ClosedPublic

Authored by Groverkss on Aug 15 2023, 10:59 AM.

Details

Summary

This patch improves the reduction tiling for linalg to support multiple
reduction dimensions.

Diff Detail

Event Timeline

Groverkss created this revision.Aug 15 2023, 10:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 10:59 AM
Groverkss requested review of this revision.Aug 15 2023, 10:59 AM

LGTM; just a few nits. It would be nice to get @mravishankar to take a look!

mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
263

assert(llvm::all_of(reductionDims, ...)?

mlir/test/Dialect/Linalg/transform-tile-reduction.mlir
383

Can we also check scf.yield so that we can be clear about the positioning of these two linalg.generic ops?

mravishankar accepted this revision.Aug 16 2023, 9:09 AM

The PartialReductionTilingInterface needs a rewrite... but this is better than what was there before. Thanks!

mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
263

THis check is OK for now, but you can drop the restriction by just extending the sizes to contain 0's upto dim.

Also please add { } around body that spans multiple lines.

This revision is now accepted and ready to land.Aug 16 2023, 9:09 AM
Groverkss updated this revision to Diff 550867.Aug 16 2023, 1:33 PM
Groverkss marked 3 inline comments as done.
  • Extend if tile size vector is not of right size.
  • Update test
This revision was landed with ongoing or failed builds.Aug 16 2023, 1:47 PM
This revision was automatically updated to reflect the committed changes.