This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tensor] Fold rank-reducing extract_slice with inverse expand_shape
ClosedPublic

Authored by springerm on Dec 1 2022, 4:59 AM.

Diff Detail

Event Timeline

springerm created this revision.Dec 1 2022, 4:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 4:59 AM
springerm requested review of this revision.Dec 1 2022, 4:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 4:59 AM
nicolasvasilache accepted this revision.Dec 1 2022, 6:05 AM

Thanks!

I think replacing expand_shape by extract_slice where possible is a great canonicalization.
I think unit-dim-like patterns that create expand_shape however need to be updated too.

This revision is now accepted and ready to land.Dec 1 2022, 6:05 AM
mravishankar requested changes to this revision.Dec 1 2022, 11:26 AM

My thumb rule is if an op is not a simple op -> op change it doesnt pay for itself as a canonicalization. I am happy to discuss if indeed it is a canonicalization, but forcing everything to be rank-reducing when canonicalization is invoked is a very opinionated solution. It should be opt-in (ftr, I am in favor of using rank-reduce slices everywhere, but not in favor of forcing that view on everyone)

This revision now requires changes to proceed.Dec 1 2022, 11:26 AM
springerm updated this revision to Diff 479554.Dec 2 2022, 1:40 AM
springerm edited the summary of this revision. (Show Details)

address comments

Patterns are now no longer canonicalizations and must be added via a populate... function.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 2 2022, 1:49 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.

Echoing my comment from the other patch

This is yet another instance of a patch being submitted when it has still changes requested marked. Whats the hurry, and AFAIK is not in keeping with developer practices. When patches land this way it drops off the dashboard and I dont see the resolution of the issue. That aside, specifically here, https://reviews.llvm.org/D139118 was tagged as something that conflicted with this. Does it or does it not. I am interested to know whats happening here (and hence I requested changes). Please do not land patches with request changes unless its been a while from the reviewer.