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
3e8c263c
Commit
3e8c263c
authored
Apr 27, 2021
by
Rick Ho
Browse files
compute capacity in gshard
parent
1aced6d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fmoe/layers.py
fmoe/layers.py
+2
-2
No files found.
fmoe/layers.py
View file @
3e8c263c
...
@@ -4,7 +4,7 @@ Layers that FMoE provides to users
...
@@ -4,7 +4,7 @@ Layers that FMoE provides to users
import
torch
import
torch
import
torch.nn
as
nn
import
torch.nn
as
nn
from
.functions
import
moe_
prepare_forward
from
.functions
import
prepare_forward
from
.functions
import
MOEScatter
,
MOEGather
,
MOELinear
from
.functions
import
MOEScatter
,
MOEGather
,
MOELinear
from
.functions
import
AllGather
,
Slice
from
.functions
import
AllGather
,
Slice
from
.gates
import
NaiveGate
from
.gates
import
NaiveGate
...
@@ -112,7 +112,7 @@ def _fmoe_general_global_forward(inp, gate, expert_fn, num_expert, world_size):
...
@@ -112,7 +112,7 @@ def _fmoe_general_global_forward(inp, gate, expert_fn, num_expert, world_size):
global_expert_count
,
global_expert_count
,
fwd_expert_count
,
fwd_expert_count
,
fwd_batch_size
,
fwd_batch_size
,
)
=
moe_
prepare_forward
(
gate
,
num_expert
,
world_size
)
)
=
prepare_forward
(
gate
,
num_expert
,
world_size
)
x
=
MOEScatter
.
apply
(
x
=
MOEScatter
.
apply
(
inp
,
pos
,
inp
,
pos
,
local_expert_count
,
global_expert_count
,
fwd_batch_size
,
world_size
local_expert_count
,
global_expert_count
,
fwd_batch_size
,
world_size
...
...
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