Skip to content

Conversation

@akyrola
Copy link

@akyrola akyrola commented Jun 3, 2019

Modify MKLDNN pooling operation to support ceil mode by adjusting the right/bottom padding accordingly. This is done similarly as in Caffe (see discussion #19205 (comment)).

To make this possible, I split the padding to left and right (top / bottom). This naming is confusing but actually follows mkldnn's own naming for pooling::compute(). We increase the r paddings so that it matches the ceiling mode expected output size.

Strengthened the test case.

@pytorchbot pytorchbot added module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration module: operators labels Jun 3, 2019
@akyrola akyrola requested a review from bddppq June 3, 2019 22:00
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyrola has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ezyang ezyang added facebook and removed facebook labels Jun 5, 2019
@akyrola akyrola force-pushed the akyrola/mklceil branch from 21d1d96 to 9a64486 Compare June 5, 2019 17:59
@pytorchbot pytorchbot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Jun 5, 2019
@akyrola
Copy link
Author

akyrola commented Jun 5, 2019

Ok, how about this: I think the math is too complex (with strides and dilations), so better not spread it around., so let's follow the Caffe-approach and just keep adjusting pad_r until the output shapes match.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyrola has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyrola has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyrola has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@akyrola akyrola force-pushed the akyrola/mklceil branch from 39bf748 to d510a22 Compare June 6, 2019 17:01
@akyrola akyrola force-pushed the akyrola/mklceil branch from d510a22 to df0427a Compare June 6, 2019 17:05
@bddppq
Copy link
Contributor

bddppq commented Jun 6, 2019

@pytorchbot retest this please

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyrola has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@bddppq bddppq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

zdevito pushed a commit to zdevito/ATen that referenced this pull request Jun 6, 2019
Summary:
Modify MKLDNN pooling operation to support ceil mode by adjusting the right/bottom padding accordingly. This is done similarly as in Caffe (see discussion pytorch/pytorch#19205 (comment)).

To make this possible, I split the padding to left and right (top / bottom). This naming is confusing but actually follows mkldnn's own naming for pooling::compute(). We increase the r paddings so that it matches the ceiling mode expected output size.

Strengthened the test case.
Pull Request resolved: pytorch/pytorch#21310

Reviewed By: bddppq

Differential Revision: D15611664

Pulled By: akyrola

fbshipit-source-id: 46b40015dafef69a8fd5e7b2c261d8dbf448cd20
@facebook-github-bot
Copy link
Contributor

@akyrola merged this pull request in b161832.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration module: onnx Related to torch.onnx module: third_party

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants