Skip to content

Add a pattern to convert tensor<->tensor static information casts to … - #6407

Merged
silvasean merged 1 commit into
iree-org:mainfrom
cathyzhyi:tensor-cast
Jul 9, 2021
Merged

silvasean merged 1 commit into
iree-org:mainfrom
cathyzhyi:tensor-cast

Conversation

@cathyzhyi

Copy link
Copy Markdown
Contributor

…flow.tensor.reshape.

  • Adds a common input conversion pipeline for this sort of thing (previously, the default was to do no input legalization, and I suspect there will be other odds and ends to be done).
  • Fixes tensor.cast not working #6368 (verified on both the loopback and full MLP pastes).

@cathyzhyi

Copy link
Copy Markdown
Contributor Author

This is the same change as #6390 with a few updates according to the comments left by Stella.

@cathyzhyi

Copy link
Copy Markdown
Contributor Author

@MaheshRavishankar Hey Mahesh, could you help to review this change again? Thanks!

@MaheshRavishankar MaheshRavishankar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamping this based on agreement on Discord, but please take a look at the comment below.

@stellaraccident

Copy link
Copy Markdown
Collaborator

Agreed: flow.tensor.reshape has a few such "fallback uses" for cases when a more specific op should probably have been used -- and each is likely a pessimization as we lose knowledge that could be used for more aggressive folding. I think this one might end up being spelled something like flow.tensor.shape_specialize. It doesn't actually do anything other than add or remove associations to SSA values for unknown dimensions.

An issue would be good. We should audit all places that we are punting to flow.tensor.reshape.

…flow.tensor.reshape.

* Adds a common input conversion pipeline for this sort of thing (previously, the default was to do no input legalization, and I suspect there will be other odds and ends to be done).
* Fixes iree-org#6368 (verified on both the loopback and full MLP pastes).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tensor.cast not working

4 participants