Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
cb4eecb0
Commit
cb4eecb0
authored
Nov 04, 2021
by
Marta
Browse files
specify cluster_environment for DeepSpeed if running with SLURM
parent
4b1c4488
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
train_openfold.py
train_openfold.py
+9
-1
No files found.
train_openfold.py
View file @
cb4eecb0
...
@@ -14,6 +14,7 @@ import numpy as np
...
@@ -14,6 +14,7 @@ import numpy as np
import
pytorch_lightning
as
pl
import
pytorch_lightning
as
pl
from
pytorch_lightning.callbacks.model_checkpoint
import
ModelCheckpoint
from
pytorch_lightning.callbacks.model_checkpoint
import
ModelCheckpoint
from
pytorch_lightning.plugins.training_type
import
DeepSpeedPlugin
from
pytorch_lightning.plugins.training_type
import
DeepSpeedPlugin
from
pytorch_lightning.plugins.environments
import
SLURMEnvironment
import
torch
import
torch
from
openfold.config
import
model_config
from
openfold.config
import
model_config
...
@@ -158,7 +159,14 @@ def main(args):
...
@@ -158,7 +159,14 @@ def main(args):
callbacks
.
append
(
perf
)
callbacks
.
append
(
perf
)
if
(
args
.
deepspeed_config_path
is
not
None
):
if
(
args
.
deepspeed_config_path
is
not
None
):
strategy
=
DeepSpeedPlugin
(
config
=
args
.
deepspeed_config_path
)
if
"SLURM_JOB_ID"
in
os
.
environ
:
cluster_environment
=
SLURMEnvironment
()
else
:
cluster_environment
=
None
strategy
=
DeepSpeedPlugin
(
config
=
args
.
deepspeed_config_path
,
cluster_environment
=
cluster_environment
,
)
elif
args
.
gpus
>
1
or
args
.
num_nodes
>
1
:
elif
args
.
gpus
>
1
or
args
.
num_nodes
>
1
:
strategy
=
"ddp"
strategy
=
"ddp"
else
:
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment