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
c4c68dce
Commit
c4c68dce
authored
Jan 25, 2021
by
Jared Casper
Browse files
Use set_tensor_model_parallel_attributes in bert_model as well.
parent
bdd47d64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
megatron/model/bert_model.py
megatron/model/bert_model.py
+1
-3
megatron/mpu/__init__.py
megatron/mpu/__init__.py
+2
-1
No files found.
megatron/model/bert_model.py
View file @
c4c68dce
...
...
@@ -78,9 +78,7 @@ class BertLMHead(MegatronModule):
args
=
get_args
()
self
.
bias
=
torch
.
nn
.
Parameter
(
torch
.
zeros
(
mpu_vocab_size
))
self
.
bias
.
tensor_model_parallel
=
True
self
.
bias
.
partition_dim
=
0
self
.
bias
.
partition_stride
=
1
mpu
.
set_tensor_model_parallel_attributes
(
self
.
bias
,
True
,
0
,
1
)
self
.
parallel_output
=
parallel_output
self
.
dense
=
get_linear_layer
(
hidden_size
,
hidden_size
,
init_method
)
...
...
megatron/mpu/__init__.py
View file @
c4c68dce
...
...
@@ -44,7 +44,8 @@ from .initialize import model_parallel_is_initialized
from
.layers
import
ColumnParallelLinear
from
.layers
import
RowParallelLinear
from
.layers
import
VocabParallelEmbedding
from
.layers
import
(
set_defaults_if_not_set_tensor_model_parallel_attributes
,
from
.layers
import
(
set_tensor_model_parallel_attributes
,
set_defaults_if_not_set_tensor_model_parallel_attributes
,
copy_tensor_model_parallel_attributes
)
from
.mappings
import
copy_to_tensor_model_parallel_region
...
...
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