Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
wants to merge 40 commits into from

Conversation

mingfeima
Copy link
Collaborator

@mingfeima mingfeima commented Dec 31, 2020

Stack from ghstack:

Differential Revision: D26007051

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Dec 31, 2020

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 1c6a57e (more details on the Dr. CI page):


  • 2/2 failures possibly* introduced in this PR
    • 1/2 non-scanned failure(s)

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See GitHub Actions build linux-bionic-py3.8-gcc9-coverage / test (default, 2, 2, linux.2xlarge) (1/1)

Step: "Test PyTorch" (full log | diagnosis details | 🔁 rerun)

2021-08-18T06:25:21.2942381Z Build left local git repository checkout dirty
2021-08-18T06:25:13.0581532Z real	72m14.287s
2021-08-18T06:25:13.0582003Z user	152m58.467s
2021-08-18T06:25:13.0582282Z sys	20m2.715s
2021-08-18T06:25:13.0582573Z + assert_git_not_dirty
2021-08-18T06:25:13.0583826Z + [[ linux-bionic-py3.8-gcc9-coverage-default != *rocm* ]]
2021-08-18T06:25:13.0584839Z + [[ linux-bionic-py3.8-gcc9-coverage-default != *xla* ]]
2021-08-18T06:25:13.0585570Z ++ git status --porcelain
2021-08-18T06:25:21.2940684Z + git_status='?? third_party/pocketfft/'
2021-08-18T06:25:21.2941233Z + [[ -n ?? third_party/pocketfft/ ]]
2021-08-18T06:25:21.2941867Z + echo 'Build left local git repository checkout dirty'
2021-08-18T06:25:21.2942381Z Build left local git repository checkout dirty
2021-08-18T06:25:21.2942918Z + echo 'git status --porcelain:'
2021-08-18T06:25:21.2943368Z git status --porcelain:
2021-08-18T06:25:21.2943840Z + echo '?? third_party/pocketfft/'
2021-08-18T06:25:21.2944238Z ?? third_party/pocketfft/
2021-08-18T06:25:21.2944548Z + exit 1
2021-08-18T06:25:21.2944826Z + cleanup
2021-08-18T06:25:21.2945103Z + retcode=1
2021-08-18T06:25:21.2945576Z + set +x
2021-08-18T06:25:21.2945916Z =================== sccache compilation log ===================
2021-08-18T06:25:21.3111240Z =========== If your build fails, please take a look at the log above for possible reasons ===========

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

mingfeima added a commit that referenced this pull request Dec 31, 2020
ghstack-source-id: a0b6af2
Pull Request resolved: #49984
mingfeima added a commit that referenced this pull request Jan 1, 2021
ghstack-source-id: 982a8e5
Pull Request resolved: #49984
mingfeima added a commit that referenced this pull request Jan 5, 2021
ghstack-source-id: 3ec9b03
Pull Request resolved: #49984
dgl-intel pushed a commit to dgl-intel/pytorch that referenced this pull request May 15, 2021
ghstack-source-id: aae1116
Pull Request resolved: pytorch#49984
@VitalyFedyunin
Copy link
Contributor

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

@VitalyFedyunin
Copy link
Contributor

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

@VitalyFedyunin
Copy link
Contributor

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

@VitalyFedyunin
Copy link
Contributor

Benchmarks please (also please do not forget before - after ).

@mingfeima
Copy link
Collaborator Author

Update: add benchmark data

  • avx512 CPU: Intel(R) Xeon(R) Gold 6248, dual sockets, 20 cores per socket, 2.50GHz
  • avx2 CPU: Intel(R) Xeon(R) E5-2680 v3, dual sockets, 12 cores per socket, 2.50GHz

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

@seemethere seemethere removed the ci/all label Aug 2, 2021
@@ -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)
Copy link
Contributor

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
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@VitalyFedyunin merged this pull request in c5ed31e.

@facebook-github-bot facebook-github-bot deleted the gh/mingfeima/9/head branch September 2, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants