-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Enable channels_last_3d on SyncBatchNorm #88401
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/88401
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit 5b2ce61: The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@xwang233 Looks great, thank you so much for adding it! |
|
Hi @ngimel , would you take a look at this PR? All tests are passed. Thanks! |
ngimel
left a comment
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.
Minor testing suggestion, otherwise looks good, thanks for the fix!
| model_gpu, device_ids=[rank] | ||
| ) | ||
|
|
||
| memory_format = torch.channels_last_3d |
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.
looks like preparing inputs is the only difference with channels last 2d, can you refactor everything else into a helper function for these 2 tests?
|
Hi @ngimel , I've merged the test code with channels_last and channels_last_3d into one test. All the CI checks look green now. |
ngimel
left a comment
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.
Great, thanks!
|
@pytorchbot merge -g |
Merge startedYour change will be merged once all checks on your PR pass since you used the green (-g) flag (ETA: 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 additional jobs have failed, first few of them are: trunk ,trunk / cuda11.6-py3.10-gcc7-sm86 / test (default, 3, 4, linux.g5.4xlarge.nvidia.gpu) Details for Dev Infra teamRaised by workflow job |
|
@pytorchmergebot merge -f "failures are irrelevant" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
This PR enabled the use of fast channels_last kernels on SyncBatchNorm with channels_last_3d memory format. With a small benchmark script here pytorch#88021 (comment), on V100, I got master: ``` DDP channels_last=False, run_forward_backward, time: 0.8945400714874268 sec DDP channels_last=True, run_forward_backward, time: 1.4736433029174805 sec ``` This PR: ``` DDP channels_last=False, run_forward_backward, time: 0.8927242755889893 sec DDP channels_last=True, run_forward_backward, time: 0.48697471618652344 sec ``` This PR is a follow-up of pytorch#46906 Close pytorch#88021 Pull Request resolved: pytorch#88401 Approved by: https://github.com/ngimel
This PR enabled the use of fast channels_last kernels on SyncBatchNorm with channels_last_3d memory format.
With a small benchmark script here #88021 (comment), on V100, I got
master:
This PR:
This PR is a follow-up of #46906
Close #88021