-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix maxpool3d / avgpool3d crashs #5052
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
|
you're doing a double-free of a THCTensor somewhere. See contbuild. |
ssnl
left a comment
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.
Thanks! Looks great. Could you also remove the now obsolete downcastOuter and downcastInner?
aten/src/THC/generic/THCTensor.c
Outdated
| return self; | ||
| } | ||
|
|
||
| // Collapses the first two dimensions of a tensor |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@ssnl I looked at the code for |
ssnl
left a comment
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.
LGTM. Merge-able when CI passes.
* Replace downcastOuter with newFoldBatchDim * Fix double free * Address comments
Fixes #4835. This PR picks up from #4848
There's a bug in
THCDeviceTensor::downcastOuterwhere it sometimes doesn't recognize a contiguous tensor as being contiguous. This leads to crashes inmaxpool3d,avgpool3d.This PR removes usages of
THCDeviceTensor::downcastOuterand replaces it with a call tonewFoldBatchDim, which performs the same behavior of collapsing the batch and feature dims but usesnewViewinternally.cc @ssnl
Test Plan
New unit tests for maxpool3d and avgpool3d crashes. Run
test_nnto make sure maxpool3d, avgpool3d, and maxunpool3d still work.