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

Fix torchToTosa lowering for avgpool2d to handle unsupported parameters #3822

Merged
merged 5 commits into from
Nov 1, 2024

Conversation

Hanumanth04
Copy link
Contributor

The existing TorchToTosa lowering logic for torch.aten.avg_pool2d doesn't handle some unsupported properties well, leading to a silent wrong answer(SWA) when we go through torch-backend-to-tosa-backend-pipeline. For instance, with the existing TOSA avgpool2d specification, we can not represent count_include_pad and divisor_override, so during TorchToTosa lowering, we silently ignore these properties which leads to SWA in some cases—the fix captured in this change errors for unsupported scenarios.

For details on count_include_pad and divisor_override, please see the below link.

https://pytorch.org/docs/stable/generated/torch.nn.AvgPool2d.html

@Hanumanth04
Copy link
Contributor Author

Hi @vivekkhandelwal1 , I do not have permission to add reviewers; since you contributed some of these changes, I am tagging you here to look into the change. Could you please take a look at this change?

@sahas3, @rafaelubalmw, I am Tagging you here to notify you about the changes.

Copy link
Collaborator

@sjarus sjarus left a comment

Choose a reason for hiding this comment

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

Looks great! Please feel free to tag me and @justin-ngo-arm on TorchToTosa updates. You can also ping us on Discord for timely feedback.

@Hanumanth04
Copy link
Contributor Author

Looks great! Please feel free to tag me and @justin-ngo-arm on TorchToTosa updates. You can also ping us on Discord for timely feedback.

Sounds good, Suraj. Thanks for looking into the change.

Hanumanth Hanumantharayappa added 2 commits October 31, 2024 15:21
@sahas3 sahas3 merged commit 7f9f99c into llvm:main Nov 1, 2024
3 checks passed
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.

3 participants