-
Notifications
You must be signed in to change notification settings - Fork 24.4k
add channel last support for MaxUnpool2d #49984
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
[ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 1c6a57e (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
ghstack-source-id: aae1116 Pull Request resolved: pytorch#49984
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Benchmarks please (also please do not forget before - after ). |
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Update: add benchmark data
single socket inference (avx512)before:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 0.369 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 0.203 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 44.327 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 27.688 ms
after:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 0.367 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 0.046 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 43.759 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 10.156 ms single core inference (avx512)before:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 5.480 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 1.417 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 696.883 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 258.977 ms
after:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 5.432 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 0.532 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 699.355 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 79.025 ms single socket inference (avx2)before:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 1.420 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 0.437 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 104.059 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 33.598 ms
after:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 1.403 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 0.143 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 115.405 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 13.674 ms single core inference (avx2)before:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 7.880 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 1.480 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 895.136 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 317.684 ms
after:
MaxUnPool2d(contiguous): input_size [1, 64, 112, 112] time: 7.788 ms
MaxUnPool2d(channels_last): input_size [1, 64, 112, 112] time: 0.771 ms
MaxUnPool2d(contiguous): input_size [128, 64, 112, 112] time: 900.540 ms
MaxUnPool2d(channels_last): input_size [128, 64, 112, 112] time: 118.523 ms |
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
Differential Revision: [D26007051](https://our.internmc.facebook.com/intern/diff/D26007051) [ghstack-poisoned]
@@ -6097,6 +6097,37 @@ def test_MaxUnpool2d_output_size(self): | |||
else: | |||
self.assertRaises(ValueError, lambda: mu(output_small, indices_small, (h, w))) | |||
|
|||
def test_max_unpool2d_nhwc_cpu(self): | |||
input = torch.randn(2, 10, 9, 9).float().cpu() | |||
input = input.contiguous(memory_format=torch.channels_last) |
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.
nit: please add tests for randomly permuted inputs
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@VitalyFedyunin merged this pull request in c5ed31e. |
Stack from ghstack:
Differential Revision: D26007051