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
f2bf5a56
Commit
f2bf5a56
authored
Dec 17, 2021
by
Vijay Korthikanti
Browse files
minor fixes
parent
17843605
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
megatron/model/transformer.py
megatron/model/transformer.py
+2
-1
megatron/mpu/initialize.py
megatron/mpu/initialize.py
+2
-2
No files found.
megatron/model/transformer.py
View file @
f2bf5a56
...
...
@@ -597,7 +597,8 @@ class ParallelTransformer(MegatronModule):
(
mpu
.
get_pipeline_model_parallel_rank
()
*
self
.
num_layers
)
else
:
# Each stage gets a contiguous set of layers.
if
args
.
model_type
==
ModelType
.
encoder_and_decoder
:
if
args
.
model_type
==
ModelType
.
encoder_and_decoder
and
\
mpu
.
get_pipeline_model_parallel_world_size
()
>
1
:
pipeline_rank
=
mpu
.
get_pipeline_model_parallel_rank
()
if
layer_type
==
LayerType
.
encoder
:
offset
=
pipeline_rank
*
self
.
num_layers
...
...
megatron/mpu/initialize.py
View file @
f2bf5a56
...
...
@@ -30,7 +30,7 @@ _MODEL_PARALLEL_GROUP = None
# Embedding group.
_EMBEDDING_GROUP
=
None
# Position embedding group.
_POSITION
EMBEDDING_GROUP
=
None
_POSITION
_
EMBEDDING_GROUP
=
None
# Data parallel group that the current rank belongs to.
_DATA_PARALLEL_GROUP
=
None
...
...
@@ -208,7 +208,7 @@ def initialize_model_parallel(tensor_model_parallel_size_=1,
if
rank
in
position_embedding_ranks
:
_POSITION_EMBEDDING_GROUP
=
group
if
rank
in
ranks
:
_POSITION_EMBEDDING_GLOBAL_RANKS
=
embedding_ranks
_POSITION_EMBEDDING_GLOBAL_RANKS
=
position_
embedding_ranks
def
model_parallel_is_initialized
():
...
...
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