-
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
ddp fix for trainer.test() + add basic ddp tests #2997
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
52745c9
add ddp script variations
891bb93
add ddp test
030ac29
rename
5d7b95b
shell
fa44749
test
f187352
test
ca6558b
try call
a89bfa9
try without subprocess
3e12896
test
dea0278
display the error
be6ba06
list all variations
awaelchli c440867
try string
awaelchli 31cae82
try copy env
e75a35c
debug
6b45e7d
pythonpath
bf5826a
path
3790099
update test
bb40a2e
change
1cd63aa
simple ddp test
awaelchli febf114
replace
awaelchli 78c0594
remove random port
awaelchli d2efd39
random port
awaelchli b519fee
str
awaelchli e46862a
clean up
awaelchli fed3904
check run spawn
awaelchli a5ae508
clean up
awaelchli fed97a9
docs
awaelchli 1b212d3
docs
awaelchli 9652305
update test
awaelchli d1ed49a
docs
awaelchli 0fbc375
changelog
awaelchli 92a1ea3
changelog
awaelchli fd31414
Merge branch 'master' into bugfix/ddp-test
awaelchli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" | ||
Runs either `.fit()` or `.test()` on a single node across multiple gpus. | ||
""" | ||
from argparse import ArgumentParser | ||
|
||
from pytorch_lightning import Trainer, seed_everything | ||
from tests.base import EvalModelTemplate | ||
|
||
|
||
def variation_fit(trainer, model): | ||
trainer.fit(model) | ||
|
||
|
||
def variation_test(trainer, model): | ||
trainer.test(model) | ||
|
||
|
||
def get_variations(): | ||
variations = [ | ||
"variation_fit", | ||
"variation_test", | ||
] | ||
return variations | ||
|
||
|
||
def main(): | ||
seed_everything(1234) | ||
parser = ArgumentParser(add_help=False) | ||
parser = Trainer.add_argparse_args(parser) | ||
parser.add_argument('--variation', default=variation_fit.__name__) | ||
parser.set_defaults(gpus=2) | ||
parser.set_defaults(distributed_backend="ddp") | ||
args = parser.parse_args() | ||
|
||
model = EvalModelTemplate() | ||
trainer = Trainer.from_argparse_args(args) | ||
|
||
# run the chosen variation | ||
run_variation = globals()[args.variation] | ||
run_variation(trainer, model) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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
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.
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.
why did we remove this?
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.
It looks like it does not belong here. My question would be why is it here in the first place?
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.
@ananyahjha93 ?