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
ae2c434e
Commit
ae2c434e
authored
Feb 03, 2021
by
Rick Ho
Browse files
fix pure data parallel
parent
6b8d2f2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
fmoe/megatron.py
fmoe/megatron.py
+5
-1
No files found.
fmoe/megatron.py
View file @
ae2c434e
...
@@ -5,11 +5,15 @@ def create_moe_mlp(args, model_parallel_rank, group):
...
@@ -5,11 +5,15 @@ def create_moe_mlp(args, model_parallel_rank, group):
assert
(
assert
(
args
.
seq_length
*
args
.
batch_size
%
args
.
model_parallel_size
==
0
args
.
seq_length
*
args
.
batch_size
%
args
.
model_parallel_size
==
0
),
"Batch size x sequence length should be multiple of mp size"
),
"Batch size x sequence length should be multiple of mp size"
if
args
.
model_parallel_size
==
1
:
world_size
=
1
else
:
world_size
=
args
.
world_size
fmoe
=
FMoETransformerMLP
(
fmoe
=
FMoETransformerMLP
(
args
.
num_experts
,
args
.
num_experts
,
d_model
=
args
.
hidden_size
,
d_model
=
args
.
hidden_size
,
d_hidden
=
args
.
hidden_size
*
4
,
d_hidden
=
args
.
hidden_size
*
4
,
world_size
=
args
.
world_size
,
world_size
=
world_size
,
model_parallel_size
=
args
.
model_parallel_size
,
model_parallel_size
=
args
.
model_parallel_size
,
model_parallel_rank
=
model_parallel_rank
,
model_parallel_rank
=
model_parallel_rank
,
mp_group
=
group
,
mp_group
=
group
,
...
...
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