Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/Dialect/Torch/IR/TorchOps.cpp: Canonicalize rank changing broadcast_to into reshape + broadcast_to #40

Merged
merged 2 commits into from
May 30, 2023

Conversation

mgehre-amd
Copy link
Collaborator

@mgehre-amd mgehre-amd commented May 25, 2023

The aten.broadcast_to op both does broadcasting but can also increase the rank by adding dimensions with size 1.
The torch->tosa lowering only handles broadcast_to that are not increasing the rank. To also help other backends, I added a canonicalizer for broadcast_to that splits into into a reshape and a non-rank changing broadcast_to.

@mgehre-amd mgehre-amd marked this pull request as ready for review May 25, 2023 16:23
@mgehre-amd mgehre-amd enabled auto-merge (squash) May 25, 2023 16:44
Copy link

@ttjost ttjost left a comment

Choose a reason for hiding this comment

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

LGTM. Just one small question.

@mgehre-amd mgehre-amd merged commit 262e3b7 into feature/misc_fixes May 30, 2023
@mgehre-amd mgehre-amd deleted the matthias.broad_cast_rank branch May 30, 2023 11:06
@mgehre-amd mgehre-amd mentioned this pull request Jun 5, 2023
51 tasks
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.

4 participants