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
FastMoE
Commits
66f7166d
Commit
66f7166d
authored
Feb 26, 2021
by
Rick Ho
Browse files
let fmoe.megatron use correct mpu
parent
b0990e4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
fmoe/megatron.py
fmoe/megatron.py
+2
-1
No files found.
fmoe/megatron.py
View file @
66f7166d
...
@@ -99,6 +99,7 @@ def fmoefy(model, num_experts=None, distributed_experts=True,
...
@@ -99,6 +99,7 @@ def fmoefy(model, num_experts=None, distributed_experts=True,
tensor_model_parall_comm x data_parallel_comm, which is not created.
tensor_model_parall_comm x data_parallel_comm, which is not created.
'''
'''
from
megatron
import
get_args
from
megatron
import
get_args
from
megatron
import
mpu
args
=
get_args
()
args
=
get_args
()
if
num_experts
is
not
None
:
if
num_experts
is
not
None
:
args
.
num_experts
=
num_experts
args
.
num_experts
=
num_experts
...
@@ -121,7 +122,7 @@ def fmoefy(model, num_experts=None, distributed_experts=True,
...
@@ -121,7 +122,7 @@ def fmoefy(model, num_experts=None, distributed_experts=True,
args
.
distributed_experts
=
distributed_experts
args
.
distributed_experts
=
distributed_experts
for
l
in
model
.
language_model
.
transformer
.
layers
:
for
l
in
model
.
language_model
.
transformer
.
layers
:
l
.
mlp
=
MegatronMLP
(
args
,
None
)
l
.
mlp
=
MegatronMLP
(
args
,
mpu
.
get_model_parallel_group
()
)
return
model
return
model
...
...
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