Skip to content
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

Don't init dist when world_size is 1 #311

Merged
merged 10 commits into from
Jan 31, 2022

Conversation

jbloxham
Copy link
Contributor

@jbloxham jbloxham commented Jan 31, 2022

The distributed process group doesn't necessarily need to be initialized when we're doing single-process training, and this can help avoid crashes in certain environments. Note that the DDP initialization code already is a no-op when the distributed process group is not initialized.

Tested by running models with various world sizes (and no explicit world size), and using a print statement to verify whether the model was the original model class or a DDP wrapper.

@jbloxham jbloxham linked an issue Jan 31, 2022 that may be closed by this pull request
Copy link
Contributor

@ravi-mosaicml ravi-mosaicml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

composer/utils/dist.py Show resolved Hide resolved
composer/utils/dist.py Outdated Show resolved Hide resolved
@jbloxham jbloxham marked this pull request as ready for review January 31, 2022 22:31
@jbloxham jbloxham merged commit 00fbf95 into mosaicml:dev Jan 31, 2022
A-Jacobson pushed a commit that referenced this pull request Feb 10, 2022
* cleanup dist init

* specify node rank

* rewrite _get_distributed_config_var for better error handling

* change a warning to an error

* woops

* dummy commit to trigger jenkins

* Update composer/utils/dist.py

Co-authored-by: ravi-mosaicml <ravi@mosaicml.com>

* woops

* remove print statement

Co-authored-by: ravi-mosaicml <ravi@mosaicml.com>
coryMosaicML pushed a commit to coryMosaicML/composer that referenced this pull request Feb 23, 2022
* cleanup dist init

* specify node rank

* rewrite _get_distributed_config_var for better error handling

* change a warning to an error

* woops

* dummy commit to trigger jenkins

* Update composer/utils/dist.py

Co-authored-by: ravi-mosaicml <ravi@mosaicml.com>

* woops

* remove print statement

Co-authored-by: ravi-mosaicml <ravi@mosaicml.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not run DDP for users that are running on a single GPU`
2 participants