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
cfd30236
Commit
cfd30236
authored
Mar 28, 2022
by
zms1999
Browse files
Fix GShardGate random_routing
parent
4edeccd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fmoe/gates/gshard_gate.py
fmoe/gates/gshard_gate.py
+1
-1
No files found.
fmoe/gates/gshard_gate.py
View file @
cfd30236
...
...
@@ -14,7 +14,7 @@ class GShardGate(NaiveGate):
assert
topk
==
2
,
'topk should be 2 in gshard'
super
().
__init__
(
d_model
,
num_expert
,
world_size
,
top_k
=
2
)
self
.
capacity
=
capacity
self
.
random_routing
=
True
self
.
random_routing
=
random_routing
def
forward
(
self
,
x
):
naive_outs
=
super
().
forward
(
x
,
return_all_scores
=
True
)
...
...
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