This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Expose pattern to collapse generic op dimensions
ClosedPublic

Authored by ThomasRaoux on Oct 7 2022, 5:09 PM.

Details

Summary

Add a pattern to be able to collapse dimensions in a linalg generic op.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Oct 7 2022, 5:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 5:09 PM
ThomasRaoux requested review of this revision.Oct 7 2022, 5:09 PM
mravishankar requested changes to this revision.Oct 10 2022, 9:09 AM

Just a nit about callback, otherwise looks good.

mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
82

Nit: The name is confusing to me. Could you rename it to GetCollapsableDimensionsFn. Also callback seems like an overkill to me. Just pass in a SmallVector<ReassociationIndices>?

This revision now requires changes to proceed.Oct 10 2022, 9:09 AM
mravishankar accepted this revision.Oct 10 2022, 9:12 AM

Actually was explained offline that this allows op level control. Looks good!

This revision is now accepted and ready to land.Oct 10 2022, 9:12 AM

rename lambda type name and rebase

This revision was landed with ongoing or failed builds.Oct 10 2022, 9:44 AM
This revision was automatically updated to reflect the committed changes.