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
6b38250f
Commit
6b38250f
authored
Jan 13, 2021
by
Jiezhong Qiu
Browse files
import from pytorch dir
parent
3501fa41
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
pytorch/cuda/moe.py
pytorch/cuda/moe.py
+1
-1
pytorch/mem_transformer.py
pytorch/mem_transformer.py
+1
-1
No files found.
pytorch/cuda/moe.py
View file @
6b38250f
...
@@ -2,7 +2,7 @@ import math
...
@@ -2,7 +2,7 @@ import math
from
torch
import
nn
from
torch
import
nn
import
torch
import
torch
from
moe_function
import
moe
from
.
moe_function
import
moe
class
MOELayer
(
nn
.
Module
):
class
MOELayer
(
nn
.
Module
):
...
...
pytorch/mem_transformer.py
View file @
6b38250f
...
@@ -34,7 +34,7 @@ class PositionalEmbedding(nn.Module):
...
@@ -34,7 +34,7 @@ class PositionalEmbedding(nn.Module):
return
pos_emb
[:,
None
,:]
return
pos_emb
[:,
None
,:]
class
CustomizedMoEPositionwiseFF
(
nn
.
Module
):
class
CustomizedMoEPositionwiseFF
(
nn
.
Module
):
def
__init__
(
self
,
d_model
,
d_inner
,
dropout
,
pre_lnorm
=
False
,
top_k
=
2
,
num_expert
=
32
):
def
__init__
(
self
,
d_model
,
d_inner
,
dropout
,
pre_lnorm
=
False
,
top_k
=
2
,
num_expert
=
64
):
super
(
CustomizedMoEPositionwiseFF
,
self
).
__init__
()
super
(
CustomizedMoEPositionwiseFF
,
self
).
__init__
()
print
(
"CustomizedMoEPositionwiseFF num_expert=%d top_k=%d"
%
(
num_expert
,
top_k
))
print
(
"CustomizedMoEPositionwiseFF num_expert=%d top_k=%d"
%
(
num_expert
,
top_k
))
...
...
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