-
Notifications
You must be signed in to change notification settings - Fork 25.1k
[onnx] Fix output shape mismatch issue of max_pool #106270
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
🔗 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 FailureAs of commit 4937175: NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 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 teamRaised by workflow job |
@pytorchbot merge -f "Unrelated inductor failure" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
@pytorchbot drci |
@thiagocrepaldi |
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]
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]
… 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]
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]
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
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
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.