-
Notifications
You must be signed in to change notification settings - Fork 26.3k
implement double backwards for MaxPool3d #5328
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
|
Could you run some benchmarks to see if the memory usage increase from changing MaxUnpool3d to not pack indices is significant? I think someone (@apaszke?) mentioned Resnet as a network that uses MaxUnpool3d; it would be nice to see if the memory usage increases significantly or not under resnet. edit: Ignore this comment, the memory usage is the same |
|
Oh, resnets use the 2d version, and I thought we’re modifying that. Will this make 3d consistent with the other pooling layers? |
|
Yeah this makes it more consistent. Also, I don't see any reason for this to use more memory than the old implementation. The way indices are being stored is changed, but we're still using the same number of bits in the tensor. |
zou3519
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.
The math looks good to me. I had some minor comments.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
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.
More nits about the naming that existed previously in the code (before your changes). Feel free to ignore
| /* loop over output */ | ||
| int64_t i, j, ti; | ||
| real *ip = input_p + k * itime * iwidth * iheight; | ||
| for (ti = 0; ti < otime; ti++) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| for (y = start_h; y < end_h; y += dilationH) | ||
| { | ||
| for (x = 0; x < kernel_w; x++) | ||
| for (x = start_w; x < end_w; x += dilationW) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| for (i = 0; i < oheight; i++) | ||
| { | ||
| for (j = 0; j < owidth; j++) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| for (i = 0; i < iH; i++) | ||
| { | ||
| for (j = 0; j < iW; j++) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| for (i = 0; i < iH; i++) | ||
| { | ||
| for (j = 0; j < iW; j++) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
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!
fixes #4497.
test plan: added double backwards check for maxpool3d tests