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

[onnx] Fix pool lowering for non-symmetric padding #2837

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

rsuderman
Copy link
Contributor

torch requires that padding be symmetric for pooling operations. To
support non-symmetric pad we need to separately materialize out the
padding operation.

`torch` requires that padding be symmetric for pooling operations. To
support non-symmetric pad we need to separately materialize out the
padding operation.
@rsuderman rsuderman requested a review from renxida January 31, 2024 01:20
Copy link
Collaborator

@newling newling left a comment

Choose a reason for hiding this comment

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

Nice code. The lit test is rather long, but they all are in these onnx->torch tests. The quick numerical tests would be good for this, if/when possible. Especially good for testing complex combinations of padding, dilation and striding (does pooling start top-left of padded image?) in the future

@renxida might want to take a look.

lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp Outdated Show resolved Hide resolved
@rsuderman rsuderman merged commit 29baa81 into llvm:main Feb 1, 2024
3 checks passed
@rsuderman rsuderman deleted the pool_pad branch February 28, 2024 20:41
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