-
Notifications
You must be signed in to change notification settings - Fork 280
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 option to launch distributed runs locally with >1 GPU #733
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
|
misko
approved these changes
Jun 21, 2024
This is awesome! exactly what we need 🤩 LGTM! |
levineds
pushed a commit
that referenced
this pull request
Jul 11, 2024
* use torch elastic api to launch multiple gpu local mode * fix distutils.py * add test * lint * lint * basic test no distributed * update test --------- Co-authored-by: Luis Barroso-Luque <lbluque@users.noreply.github.com>
misko
pushed a commit
that referenced
this pull request
Jan 17, 2025
* use torch elastic api to launch multiple gpu local mode * fix distutils.py * add test * lint * lint * basic test no distributed * update test --------- Co-authored-by: Luis Barroso-Luque <lbluque@users.noreply.github.com> Former-commit-id: 0f1ddd48a4bc90a22c43922a4150ee74cfd4fb95
beomseok-kang
pushed a commit
to beomseok-kang/fairchem
that referenced
this pull request
Jan 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add option to launch distributed runs locally with >1 GPU. Useful for testing parallel algorithms locally. This uses torch elastic API which just spawns python multiprocesses under the hood.
This is equivalent to calling our application with torchrun ie:
torchrun fairchem ...
, but makes the interface cleaner so we dont need to work with 2 launchersNote: torchrun just calls the elastic launch API under the hood
There's a bug where LMBDs cannot be pickled (needed for multiprocessing), this is resolvable by setting num_workers to 0 which is ok for local mode testing.
examples:
To run locally on 2 GPUs with distributed:
fairchem --debug --mode train --identifier gp_test --config-yml src/fairchem/experimental/rgao/configs/equiformer_v2_N\@8_L\@4_M\@2_31M.yml --amp --distributed --num-gpus=2
To run locally without distributed:
fairchem --debug --mode train --identifier gp_test --config-yml src/fairchem/experimental/rgao/configs/equiformer_v2_N\@8_L\@4_M\@2_31M.yml --amp
Testing:
Add simple test for test_cli.py for now which mocks the runner, should add tests later for actual simple runs