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
ColossalAI
Commits
3f70a2b1
"tests/vscode:/vscode.git/clone" did not exist on "b9b469ea508717f72cc6c1a5cb8d2e522c87bb23"
Unverified
Commit
3f70a2b1
authored
Mar 15, 2022
by
HELSON
Committed by
GitHub
Mar 15, 2022
Browse files
removed noisy function during evaluation of MoE router (#419)
parent
adebb3e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
colossalai/nn/layer/moe/layers.py
colossalai/nn/layer/moe/layers.py
+2
-2
No files found.
colossalai/nn/layer/moe/layers.py
View file @
3f70a2b1
...
...
@@ -52,7 +52,7 @@ class Top1Router(nn.Module):
def
forward
(
self
,
inputs
:
torch
.
Tensor
,
cuda_mode
:
bool
=
False
):
if
self
.
noisy_func
is
not
None
:
if
self
.
noisy_func
is
not
None
and
self
.
training
:
inputs_noisy
=
self
.
noisy_func
(
inputs
)
else
:
inputs_noisy
=
inputs
...
...
@@ -126,7 +126,7 @@ class Top2Router(nn.Module):
def
forward
(
self
,
inputs
:
torch
.
Tensor
,
cuda_mode
:
bool
=
False
):
# inputs: [s, h]
if
self
.
noisy_func
is
not
None
:
if
self
.
noisy_func
is
not
None
and
self
.
training
:
inputs
=
self
.
noisy_func
(
inputs
)
logits
=
autocast_softmax
(
inputs
,
dim
=-
1
)
# logits: [s, e]
...
...
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