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
deepspeed
Commits
68e138b6
Unverified
Commit
68e138b6
authored
Feb 17, 2021
by
Jeff Rasley
Committed by
GitHub
Feb 17, 2021
Browse files
[dist] set args.local_rank to LOCAL_RANK (#764)
parent
8067efa4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
deepspeed/runtime/engine.py
deepspeed/runtime/engine.py
+6
-4
No files found.
deepspeed/runtime/engine.py
View file @
68e138b6
...
@@ -458,10 +458,12 @@ class DeepSpeedEngine(Module):
...
@@ -458,10 +458,12 @@ class DeepSpeedEngine(Module):
# Configure based on command line arguments
# Configure based on command line arguments
def
_configure_with_arguments
(
self
,
args
,
mpu
):
def
_configure_with_arguments
(
self
,
args
,
mpu
):
if
hasattr
(
args
,
'local_rank'
)
and
args
.
local_rank
>=
0
:
# After the distributed backend is initialized we are guaranteed the LOCAL_RANK
# environment variable is set. We must align args.local_rank to this value for
# backwards compatability with scripts relying on [args|self].local_rank containing
# the correct local rank info.
args
.
local_rank
=
int
(
os
.
environ
[
'LOCAL_RANK'
])
self
.
local_rank
=
args
.
local_rank
self
.
local_rank
=
args
.
local_rank
else
:
self
.
local_rank
=
int
(
os
.
environ
.
get
(
"LOCAL_RANK"
,
-
1
))
config_file
=
args
.
deepspeed_config
if
hasattr
(
args
,
config_file
=
args
.
deepspeed_config
if
hasattr
(
args
,
'deepspeed_config'
)
else
None
'deepspeed_config'
)
else
None
...
...
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