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 max_pool2d with ceil_mode bug #46558
Fix max_pool2d with ceil_mode bug #46558
Conversation
[ghstack-poisoned]
ghstack-source-id: b2eb789f8760cf997efc065535abd0eeac30de87 Pull Request resolved: #46558
💊 CI failures summary and remediationsAs of commit ff7053d (more details on the Dr. CI page):
Extra GitHub checks: 1 failed
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 3 times. |
💊 CI failures summary and remediationsAs of commit a4f0899 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 39 times. |
This PR fixes a bug with how pooling output shape was computed. Previously, it did not consider the right padding as "part of the image" but the docs do. Now, in ceil mode it allows a kernel window to go off bounds as long as it starts within the image including both paddings. The boolean condition was also wrong, it should be ceil_mode. fixes #45357 [ghstack-poisoned]
ghstack-source-id: 32f9000630b256797535a5dae77bd2dc135eedc2 Pull Request resolved: #46558
This PR fixes a bug with how pooling output shape was computed. Previously, it did not consider the right padding as "part of the image" but the docs do. Now, in ceil mode it allows a kernel window to go off bounds as long as it starts within the image including both paddings. The boolean condition was also wrong, it should be ceil_mode. fixes #45357 TODO - [ ] Ensure existing tests are checking for the correct output size [ghstack-poisoned]
ghstack-source-id: 61d608ceac4abd4cd329fb92dc61ea4c2757cd00 Pull Request resolved: #46558
This PR fixes a bug with how pooling output shape was computed. ## BC Breaking Notes Previously, the pooling code allowed a kernel window to be entirely outside the input and it did not consider right padding as part of the input in the computations. Now, in ceil mode it allows a kernel window to go off bounds as long as it starts within the input including both paddings. If ceil_mode=False, then all kernel windows have to start inside the input, again including both paddings. fixes #45357 TODO - [ ] Ensure existing tests are checking for the correct output size [ghstack-poisoned]
ghstack-source-id: 154dd1690c0001cd0808cc166495914ede0b891d Pull Request resolved: #46558
aten/src/ATen/native/quantized/cpu/kernels/QuantizedOpKernels.cpp
Outdated
Show resolved
Hide resolved
This PR fixes a bug with how pooling output shape was computed. ## BC Breaking Notes Previously, the pooling code allowed a kernel window to be entirely outside the input and it did not consider right padding as part of the input in the computations. Now, in ceil mode it allows a kernel window to go off bounds as long as it starts within the input including both paddings. If ceil_mode=False, then all kernel windows have to start inside the input, again including both paddings. fixes #45357 TODO - [x] Ensure existing tests are checking for the correct output size [ghstack-poisoned]
ghstack-source-id: aa499843a0cd91df9b92a4470d2aaf22b6e2b75b Pull Request resolved: #46558
This PR fixes a bug with how pooling output shape was computed. ## BC Breaking Notes Previously, the pooling code allowed a kernel window to be entirely outside the input and it did not consider right padding as part of the input in the computations. Now, in ceil mode it allows a kernel window to go off bounds as long as it starts within the input including both paddings. If ceil_mode=False, then all kernel windows have to start inside the input, again including both paddings. fixes #45357 TODO - [x] Ensure existing tests are checking for the correct output size [ghstack-poisoned]
ghstack-source-id: 5d42f05c70b85d499daf8fd9f7e3c7cb4ac323d5 Pull Request resolved: #46558
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small fixes (doc strings + exact test case from issue). Cool fix!
This PR fixes a bug with how pooling output shape was computed. ## BC Breaking Notes Previously, a bug in the pooling code allowed a sliding window to be entirely off bounds. Now, sliding windows must start inside the input or left padding (not right padding, see #46929) and may only go off-bounds if ceil_mode=True. fixes #45357 TODO - [x] Ensure existing tests are checking for the correct output size [ghstack-poisoned]
ghstack-source-id: 4f9c04b7291b44e20cc5600ebb224994f5411de1 Pull Request resolved: #46558
This PR fixes a bug with how pooling output shape was computed. ## BC Breaking Notes Previously, a bug in the pooling code allowed a sliding window to be entirely off bounds. Now, sliding windows must start inside the input or left padding (not right padding, see #46929) and may only go off-bounds if ceil_mode=True. fixes #45357 TODO - [x] Ensure existing tests are checking for the correct output size [ghstack-poisoned]
ghstack-source-id: a08a0c29403cd88328bad8927c26fbed8e5348dd Pull Request resolved: #46558
@heitorschueroff merged this pull request in 2643800. |
Stack from ghstack:
This PR fixes a bug with how pooling output shape was computed.
BC Breaking Notes
Previously, a bug in the pooling code allowed a sliding window to be entirely off bounds. Now, sliding windows must start inside the input or left padding (not right padding, see #46929) and may only go off-bounds if ceil_mode=True.
Note
Updating the code to allow the sliding window to start within the right padded region would break many internal assumptions. We may address this in a future PR.
fixes #45357
TODO
Differential Revision: D24633372