-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add SyncBatchNormPlugin
#11754
Add SyncBatchNormPlugin
#11754
Conversation
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.
Back when I filed the issue, my reasoning to make this a plugin was to support both pytorch native & Apex: https://nvidia.github.io/apex/_modules/apex/parallel.html#convert_syncbn_model
Almost all instances I've seen have moved to the native version. But i'm sure there are a handful of users who still might use the apex version. Making this an abstract interface will make it easier to support apex later. That could be a good first issue
Ah interesting! Then we should probably aim for an abstract interface and a concrete default torch implementation. I'll explore it, thanks! |
for more information, see https://pre-commit.ci
…nto feature/sync-batchnorm-plugin
for more information, see https://pre-commit.ci
…nto feature/sync-batchnorm-plugin
Co-authored-by: Carlos Mocholí <[email protected]>
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.
Awesome!
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.
LGTM, 2 very minor questions :)
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.
LGTM !
6265800
to
7947e21
Compare
Summary: ### New commit log messages - [d4d197070 Add `SyncBatchNormPlugin` (#11754)](Lightning-AI/pytorch-lightning#11754) Reviewed By: edward-io Differential Revision: D34608350 fbshipit-source-id: eae33c6cd276fd02666cf7fb9136b4a7d471bd85
What does this PR do?
Fixes #4349
This decouples the baked-in support for sync batchnorm in ddp- and ddp spawn strategies. This would for example enable adding a plugin for Apex-specific sync batch norm in the future.
TODO:
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
I made sure I had fun coding 🙃
cc @Borda @akihironitta