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
2ed4351d
Commit
2ed4351d
authored
Jan 01, 2021
by
Rick Ho
Browse files
moe test script
parent
706f0cfd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
pytorch/cuda/moe_test.py
pytorch/cuda/moe_test.py
+3
-1
No files found.
pytorch/cuda/moe_test.py
View file @
2ed4351d
...
@@ -32,7 +32,9 @@ def perf():
...
@@ -32,7 +32,9 @@ def perf():
maxt
=
0.
maxt
=
0.
sqtot
=
0.
sqtot
=
0.
for
i
in
range
(
n_runs
):
for
i
in
range
(
n_runs
):
gate
=
torch
.
randint
(
low
=
0
,
high
=
num_expert
,
size
=
(
batch_size
,
),
requires_grad
=
False
).
int
().
cuda
()
gate
=
torch
.
randint
(
low
=
0
,
high
=
num_expert
*
torch
.
distributed
.
get_world_size
(),
size
=
(
batch_size
,
),
requires_grad
=
False
).
int
().
cuda
()
ts
=
time
.
time
()
ts
=
time
.
time
()
o
=
moe
(
inp
,
gate
)
o
=
moe
(
inp
,
gate
)
te
=
time
.
time
()
te
=
time
.
time
()
...
...
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