This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Support dropping unit dimensions for init tensors
ClosedPublic

Authored by antiagainst on Mar 22 2021, 2:48 PM.

Details

Summary

init tensor operands also has indexing map and generally follow
the same constraints we expect for non-init-tensor operands.

Depends On D99114

Diff Detail

Event Timeline

antiagainst created this revision.Mar 22 2021, 2:48 PM
antiagainst requested review of this revision.Mar 22 2021, 2:48 PM
mravishankar accepted this revision.Mar 22 2021, 10:41 PM

LGTM after minor nit is addressed

mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
297

Could you leave the TODO for reductions? AFAIK, this is something you are going to look into as well?

This revision is now accepted and ready to land.Mar 22 2021, 10:41 PM
antiagainst marked an inline comment as done.

Add TODO

This revision was landed with ongoing or failed builds.Mar 24 2021, 3:19 PM
This revision was automatically updated to reflect the committed changes.

this is related to another CL I saw pass by, I think in general dropping 1 dimensions can/should be done with rank-reducing subtensor / subview as they have clear inplace semantics, including in the dynamic case.
reshape is unfortunately much trickier and if we can avoid using it when alternatives exist that would be preferred.

I do not know the deeper implications of systematically dropping the reshapes on IREE though.