Skip to content

Conversation

@bddppq
Copy link
Contributor

@bddppq bddppq commented Apr 27, 2019

@bddppq bddppq requested review from dzhulgakov and gchanan April 27, 2019 01:59
@pytorchbot pytorchbot added module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration module: operators labels Apr 27, 2019
@bddppq bddppq force-pushed the mkldnn_adaptive_avg_pool2d branch 3 times, most recently from 3d5e91a to 8911a99 Compare April 27, 2019 02:21
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.

@bddppq 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.

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

@bddppq bddppq force-pushed the mkldnn_adaptive_avg_pool2d branch from 8911a99 to b6f75bc Compare April 30, 2019 18:11
@bddppq bddppq requested a review from wanchaol April 30, 2019 18:12
Copy link
Collaborator

@wanchaol wanchaol left a comment

Choose a reason for hiding this comment

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

lgtm. minor questions.

- func: mkldnn_adaptive_avg_pool2d(Tensor self, int[2] output_size) -> Tensor
dispatch:
MkldnnCPU: mkldnn_adaptive_avg_pool2d
requires_tensor: True
Copy link
Collaborator

Choose a reason for hiding this comment

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

I might miss some context here. What's the meaning of this option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


self.assertEqual(
adaptive_avg_pool2d(x),
adaptive_avg_pool2d(x.to_mkldnn()).to_dense())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it mean that everytime we call mkldnn ops we are required to call to_dense ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not every op, but every chunk of ops (in this case the unittest is only testing one op so yeah it's calling to_dense after each op to convert the mkldnn tensor to dense tensor so that we can compare with the regular dense kernel's output).
basically one needs to do:

to_mkldnn -> mkldnn_op1 -> mkldnn_op2 ... -> mkldnn_opn -> to_dense

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.

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

@bddppq bddppq deleted the mkldnn_adaptive_avg_pool2d branch April 30, 2019 22:24
zdevito pushed a commit to zdevito/ATen that referenced this pull request Apr 30, 2019
Summary:
AdaptiveAvgPool2d is used in torchvision resnet models https://github.com/pytorch/vision/blob/9a481d0/torchvision/models/resnet.py#L145

Fixes #19797
Pull Request resolved: pytorch/pytorch#19818

Differential Revision: D15112777

Pulled By: bddppq

fbshipit-source-id: 6c9b29c805d28356cda49c10c2cd3ce9d7a8b3f5
@facebook-github-bot
Copy link
Contributor

@bddppq merged this pull request in cb8ff2a.

zhangguanheng66 pushed a commit to zhangguanheng66/pytorch that referenced this pull request May 6, 2019
Summary:
AdaptiveAvgPool2d is used in torchvision resnet models https://github.com/pytorch/vision/blob/9a481d0/torchvision/models/resnet.py#L145

Fixes pytorch#19797
Pull Request resolved: pytorch#19818

Differential Revision: D15112777

Pulled By: bddppq

fbshipit-source-id: 6c9b29c805d28356cda49c10c2cd3ce9d7a8b3f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mkldnn support for adaptive avg pool

4 participants