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

Skip to content

optimize channels last for BatchNorm2d on CPU #48919

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 29 commits into from

Conversation

mingfeima
Copy link
Collaborator

@mingfeima mingfeima commented Dec 7, 2020

Stack from ghstack:

move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: D25399468

move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

[ghstack-poisoned]
@mingfeima
Copy link
Collaborator Author

mingfeima commented Dec 7, 2020

use this one to replace #46234, NHWC performance provided.

  • BatchNorm training forward path is paralleled but inference path is not paralleled at the moment. This explains why inference path is slower than training forward on multiple cores in batchnorm_M1_N256_K3136_cpu_bwdall .
  • Moving channels last impl to /cpu doesn't bring any performance improvement (gcc should be able to vectorize simple a * x + b pattern pretty well) but i still did so since the overall code structure will be cleaner. For example, you can keep just one version of batch_norm_cpu_inference_collect_linear_and_constant_terms.
  • I noticed the original impl has a special treatment for image_size=1, it is vectorized in this patch, so for K1 cases there are some improvement.
  • Since the vectorization pattern is separately treated for image_size=1, I add new tests to cover these scenarios.
  • [NEW] All backward related kernels are properly optimized, so the training performance has significant improvement.

internal operator benchmark

Update performance with pytorch internal operator benchmark, machine Xeon(R) Gold 6248 CPU, 20 cores per socket, 2.5GHz. 1C refers to single core run, 20C refers to single socket run. jemalloc and numactrl are applied to reduce test result fluctuation.
Unit: us per iteration.

Name Tag before (1C) before (20C) after (1C) after (20C)
batchnorm_M1_N256_K3136_cpu Short 248.093 252.302 251.495 22.786
batchnorm_M1_N256_K3136_cpu_bwdall Short 3605.876 404.381 1321.963 134.620
batchnorm_M1_N256_K3136_cpu_bwd1 Short 3600.249 403.502 1325.088 134.584
batchnorm_M1_N8192_K1_cpu Long 26.128 25.874 23.520 23.495
batchnorm_M1_N2048_K1_cpu Long 10.377 10.455 9.987 10.080
batchnorm_M128_N8192_K1_cpu Long 665.283 670.573 369.707 53.901
batchnorm_M128_N2048_K1_cpu Long 177.345 184.846 96.405 22.188
batchnorm_M1_N8192_K1_cpu_bwdall Long 16337.803 5278.381 84.187 136.834
batchnorm_M1_N8192_K1_cpu_bwd1 Long 16343.511 5712.935 84.999 139.300
batchnorm_M1_N2048_K1_cpu_bwdall Long 4098.062 1397.278 43.828 80.294
batchnorm_M1_N2048_K1_cpu_bwd1 Long 4088.836 1297.217 43.936 80.556
batchnorm_M128_N8192_K1_cpu_bwdall Long 36745.255 5309.559 1953.939 300.480
batchnorm_M128_N8192_K1_cpu_bwd1 Long 36715.947 5316.020 1959.126 300.013
batchnorm_M128_N2048_K1_cpu_bwdall Long 7132.537 1307.126 523.393 170.343
batchnorm_M128_N2048_K1_cpu_bwd1 Long 7065.365 1361.857 524.974 170.881

RN50 BatchNorm2d performance

since the internal operator benchmark covers only NCHW memory format, I abstracted BatchNorm2d shapes from resnet50, tested both NCHW and NHWC memory format on 3 scenarios:

a. single core inference - the perf is pretty much identical to before.
b. single socket inference (BS=1) - unit: ms per iteration

input sizes before (nchw) before (nhwc) after (nchw) after (nhwc)
[1,64,112,112] 0.272 0.508 0.042 0.041
[1,64,56,56] 0.088 0.146 0.033 0.031
[1,256,56,56] 0.272 0.463 0.040 0.042
[1,128,56,56] 0.150 0.254 0.036 0.034
[1,128,28,28] 0.041 0.080 0.032 0.029
[1,512,28,28] 0.151 0.245 0.037 0.037
[1,256,28,28] 0.089 0.138 0.033 0.032
[1,256,14,14] 0.028 0.045 0.029 0.029
[1,1024,14,14] 0.096 0.148 0.034 0.034
[1,256,14,14] 0.028 0.045 0.029 0.029
[1,512,14,14] 0.048 0.079 0.032 0.031
[1,512,7,7] 0.026 0.032 0.029 0.029
[1,2048,7,7] 0.060 0.082 0.034 0.034

c. single socket training (BS=128) - unit: ms per iteration

input sizes before (nchw) before (nhwc) after (nchw) after (nhwc)
[128,64,112,112] 85.081 431.061 57.147 39.251
[128,64,56,56] 21.279 114.859 14.535 10.368
[128,256,56,56] 80.615 383.638 58.409 32.715
[128,128,56,56] 40.969 166.508 28.946 17.632
[128,128,28,28] 10.062 40.375 6.731 4.671
[128,512,28,28] 42.828 197.343 29.662 14.609
[128,256,28,28] 20.250 91.205 14.234 8.688
[128,256,14,14] 5.112 14.013 3.064 2.323
[128,1024,14,14] 23.254 101.761 14.100 7.146
[128,256,14,14] 5.089 13.930 3.172 2.326
[128,512,14,14] 10.760 46.684 6.564 3.929
[128,512,7,7] 2.944 5.712 2.119 1.305
[128,2048,7,7] 13.583 52.279 9.271 3.502

@dr-ci
Copy link

dr-ci bot commented Dec 7, 2020

💊 CI failures summary and remediations

As of commit 70d8038 (more details on the Dr. CI page):


  • 5/5 failures introduced in this PR

5 failures not recognized by patterns:

Job Step Action
CircleCI Build Error Config Processing Error (Don't rerun) 🔁 rerun
GitHub Actions render_test_results Download PyTorch Test Reports 🔁 rerun
GitHub Actions clang-format Fetch PyTorch 🔁 rerun
GitHub Actions build Unknown 🔁 rerun
GitHub Actions quick-checks Run ShellCheck 🔁 rerun

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.

move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

[ghstack-poisoned]
VitalyFedyunin
VitalyFedyunin previously approved these changes Dec 8, 2020
@VitalyFedyunin VitalyFedyunin dismissed their stale review December 8, 2020 17:34

Unused map4

move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
leslie-fang-intel pushed a commit to leslie-fang-intel/pytorch that referenced this pull request Apr 12, 2021
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

ghstack-source-id: 152c476
Pull Request resolved: pytorch#48919
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
mingfeima added a commit to mingfeima/pytorch that referenced this pull request Apr 28, 2021
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

ghstack-source-id: 53e630c
Pull Request resolved: pytorch#48919
mingfeima added 2 commits May 11, 2021 12:57
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Differential Revision: [D25399468](https://our.internmc.facebook.com/intern/diff/D25399468)

[ghstack-poisoned]
@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 0be334a.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 0caec73.

@facebook-github-bot facebook-github-bot deleted the gh/mingfeima/5/head branch May 18, 2021 14:17
krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
Summary:
Pull Request resolved: pytorch#48919

move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Test Plan: Imported from OSS

Reviewed By: glaringlee

Differential Revision: D25399468

Pulled By: VitalyFedyunin

fbshipit-source-id: a4cd7a09cd4e1a8f5cdd79c7c32c696d0db386bd
mingfeima added a commit to mingfeima/pytorch that referenced this pull request Jun 11, 2021
Summary:
Pull Request resolved: pytorch#48919

move data indexing utils

parallel inference contiguous path

parallel inference channels last path

add dim apply

optimize update stats

add channels last support for backward

Revert "add channels last support for backward"

This reverts commit cc5e29dce44395250f8e2abf9772f0b99f4bcf3a.

Revert "optimize update stats"

This reverts commit 7cc6540701448b9cfd5833e36c745b5015ae7643.

Revert "add dim apply"

This reverts commit b043786d8ef72dee5cf85b5818fcb25028896ecd.

bug fix

add batchnorm nhwc test for cpu, including C=1 and HW=1

Test Plan: Imported from OSS

Reviewed By: glaringlee

Differential Revision: D25399468

Pulled By: VitalyFedyunin

fbshipit-source-id: a4cd7a09cd4e1a8f5cdd79c7c32c696d0db386bd
facebook-github-bot pushed a commit that referenced this pull request Jun 11, 2021
Summary:
replacement of #48919
optimize channels last performance for BatchNorm2 on CPU.

Pull Request resolved: #59286

Reviewed By: bdhirsh

Differential Revision: D29008198

Pulled By: VitalyFedyunin

fbshipit-source-id: 8a7d020bd6a42ab5c21ffe788b79a22f4ec82ac0
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