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
f1a6e6fd
Unverified
Commit
f1a6e6fd
authored
May 19, 2023
by
Rick Ho
Committed by
GitHub
May 19, 2023
Browse files
Revert "convert input to same type as weight for mixed precision training"
parent
3a0eb3e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fmoe/linear.py
fmoe/linear.py
+2
-2
No files found.
fmoe/linear.py
View file @
f1a6e6fd
...
...
@@ -63,14 +63,14 @@ class FMoELinear(nn.Module):
self
.
bias
=
nn
.
Parameter
(
torch
.
zeros
(
num_expert
,
out_feat
))
else
:
self
.
register_parameter
(
"bias"
,
None
)
self
.
reset_parameters
()
def
forward
(
self
,
inp
,
fwd_expert_count
):
r
"""
Call MOE function
"""
x
=
MOELinear
.
apply
(
inp
.
type_as
(
self
.
weight
)
,
fwd_expert_count
,
self
.
weight
,
self
.
bias
)
x
=
MOELinear
.
apply
(
inp
,
fwd_expert_count
,
self
.
weight
,
self
.
bias
)
return
x
def
extra_repr
(
self
)
->
str
:
...
...
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