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
Megatron-LM
Commits
be842037
Commit
be842037
authored
Aug 06, 2020
by
Boris Fomitchev
Browse files
Removed assert in case of external ddp, exported initialize_megatron()
Signed-off-by:
Boris Fomitchev
<
bfomitchev@nvidia.com
>
parent
323c124d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
megatron/__init__.py
megatron/__init__.py
+2
-2
megatron/initialize.py
megatron/initialize.py
+0
-5
No files found.
megatron/__init__.py
View file @
be842037
...
...
@@ -30,7 +30,7 @@ from .global_vars import get_tokenizer
from
.global_vars
import
get_tensorboard_writer
from
.global_vars
import
get_adlr_autoresume
from
.global_vars
import
get_timers
from
.initialize
import
initialize_megatron
def
print_rank_0
(
message
):
"""If distributed is initialized print only on rank 0."""
...
...
@@ -38,4 +38,4 @@ def print_rank_0(message):
if
torch
.
distributed
.
get_rank
()
==
0
:
print
(
message
,
flush
=
True
)
else
:
print
(
message
,
flush
=
True
)
\ No newline at end of file
print
(
message
,
flush
=
True
)
megatron/initialize.py
View file @
be842037
...
...
@@ -93,11 +93,6 @@ def _initialize_distributed():
'skipping initialization ...'
,
flush
=
True
)
args
.
rank
=
torch
.
distributed
.
get_rank
()
args
.
world_size
=
torch
.
distributed
.
get_world_size
()
if
device_count
>
0
:
device
=
torch
.
cuda
.
current_device
()
local_rank
=
args
.
rank
%
device_count
assert
local_rank
==
device
,
\
'expected local-rank to be the same as rank % device-count.'
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