Skip to content

Conversation

CYuxian
Copy link
Contributor

@CYuxian CYuxian commented Jul 30, 2023

For onnx MaxPool with ceil_mode=1, the sliding windows that starts in the right padded region won't be ignored, which causes different output shape with torch.
Therefore, need to add Pad op before and not to set ceil_mode for MaxPool op like what is done in symbolic_opset9 when convertting torch max_pool to onnx MaxPool.

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 30, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/106270

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 4937175:

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Jul 30, 2023
For onnx MaxPool with ceil_mode=1, the sliding windows that starts
in the right padded region won't be ignored, which causes different
output shape with torch.
Therefore, need to add Pad op before and not to set ceil_mode for
MaxPool op like what is done in symbolic_opset9.
@thiagocrepaldi
Copy link
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 31, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / macos-12-py3-arm64 / test (default, 2, 3, macos-m1-12)

Details for Dev Infra team Raised by workflow job

@thiagocrepaldi thiagocrepaldi added the module: onnx Related to torch.onnx label Jul 31, 2023
@thiagocrepaldi
Copy link
Collaborator

@pytorchbot merge -f "Unrelated inductor failure"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@huydhn
Copy link
Contributor

huydhn commented Aug 1, 2023

@pytorchbot drci

@titaiwangms
Copy link
Collaborator

@thiagocrepaldi opset9.get_pool_ceil_padding doesn't support dynamic shapes, so it makes regression on 2.1 (#113155). The real fix should be on ONNX shape type inference: onnx/onnx#5741 (thread: onnx/onnx#5711 (comment)). We might need to revert this PR, or keep the tests, but revert the symbolic opset changes.

titaiwangms added a commit that referenced this pull request Nov 9, 2023
In #106270, the solution managed to solve the [`ceil_model` corner issue](onnx/onnx#5711) with the usage of `get_pool_ceil_padding`. However, padding the ceil in converter side only works when we already know the input shapes, therefore, a regression happens when users want to do dynamic inputs.

This PR provides (1) refactor codes with torchlib implementation, (2) add dynamic shapes test, and (3) disable the corner tests with comments saying re-enable it when the [real fix from ONNX](onnx/onnx#5741) is merged.

[ghstack-poisoned]
titaiwangms added a commit that referenced this pull request Nov 9, 2023
In #106270, the solution managed to solve the [`ceil_model` corner issue](onnx/onnx#5711) with the usage of `get_pool_ceil_padding`. However, padding the ceil in converter side only works when we already know the input shapes, therefore, a regression happens when users want to do dynamic inputs.

This PR provides (1) refactor codes with torchlib implementation, (2) add dynamic shapes test, and (3) disable the corner tests with comments saying re-enable it when the [real fix from ONNX](onnx/onnx#5741) is merged.

[ghstack-poisoned]
titaiwangms added a commit that referenced this pull request Nov 9, 2023
… inputs"


In #106270, the solution managed to solve the [`ceil_model` corner issue](onnx/onnx#5711) with the usage of `get_pool_ceil_padding`. However, padding the ceil in converter side only works when we already know the input shapes, therefore, a regression happens when users want to do dynamic inputs.

This PR provides (1) refactor codes with torchlib implementation, (2) add dynamic shapes test, and (3) disable the corner tests with comments saying re-enable it when the [real fix from ONNX](onnx/onnx#5741) is merged.

[ghstack-poisoned]
titaiwangms added a commit that referenced this pull request Nov 9, 2023
In #106270, the solution managed to solve the [`ceil_model` corner issue](onnx/onnx#5711) with the usage of `get_pool_ceil_padding`. However, padding the ceil in converter side only works when we already know the input shapes, therefore, a regression happens when users want to do dynamic inputs.

This PR provides (1) refactor codes with torchlib implementation, (2) add dynamic shapes test, and (3) disable the corner tests with comments saying re-enable it when the [real fix from ONNX](onnx/onnx#5741) is merged.

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Nov 10, 2023
In #106270, the solution managed to solve the [`ceil_model` corner issue](onnx/onnx#5711) with the usage of `get_pool_ceil_padding`. However, padding the ceil in converter side only works when we already know the input shapes, therefore, a regression happens when users want to do dynamic inputs.

This PR provides (1) refactor codes with torchlib implementation, (2) add dynamic shapes test, and (3) disable the corner tests with comments saying re-enable it when the [real fix from ONNX](onnx/onnx#5741) is merged.
Pull Request resolved: #113318
Approved by: https://github.com/thiagocrepaldi
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
In pytorch#106270, the solution managed to solve the [`ceil_model` corner issue](onnx/onnx#5711) with the usage of `get_pool_ceil_padding`. However, padding the ceil in converter side only works when we already know the input shapes, therefore, a regression happens when users want to do dynamic inputs.

This PR provides (1) refactor codes with torchlib implementation, (2) add dynamic shapes test, and (3) disable the corner tests with comments saying re-enable it when the [real fix from ONNX](onnx/onnx#5741) is merged.
Pull Request resolved: pytorch#113318
Approved by: https://github.com/thiagocrepaldi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants