Skip to content

Generalize the PyTorch avg_pool linalg lowering algorithm for the case where count_include_pad = false. #4010

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

Conversation

ivangarcia44
Copy link
Contributor

@ivangarcia44 ivangarcia44 commented Feb 7, 2025

Currently the avg_pool2d PyTorch operation supports the cases where count_include_pad is true and false, but the avg_pool1d and avg_pool3d only the true case is supported (which is simpler).

The count_include_pad = false support for avg_pool2d was added by @AmosLewis in this change (reviewed by @rsuderman and @nirvedhmeshram) : #3235

In this change I generalized the logic added above. I also did some refactoring to the original code to reduce the size of the functions and to avoid redundancy when possible.

@sahas3 @dixinzhou @rafaelubal

@sahas3 sahas3 requested review from rsuderman and AmosLewis February 8, 2025 02:33
Copy link
Member

@sahas3 sahas3 left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes @ivangarcia44. Looks much cleaner now. Some minor comments. I'll leave the approval to other reviewers.

@ivangarcia44
Copy link
Contributor Author

Hi @rsuderman @AmosLewis , would it be ok to merge this change?

@ivangarcia44
Copy link
Contributor Author

Closing merge request. Will create a new one to avoid the merge issue.

@ivangarcia44
Copy link
Contributor Author

@AmosLewis @rsuderman @sahas3 @dixinzhou

Please review the new merge request here: #4035

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.

2 participants