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
945004e7
Commit
945004e7
authored
Sep 11, 2023
by
Rick Ho
Browse files
fix shadow
parent
226e0779
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
cuda/fastermoe/smart_schedule.cpp
cuda/fastermoe/smart_schedule.cpp
+1
-2
fmoe/fastermoe/schedule.py
fmoe/fastermoe/schedule.py
+1
-1
No files found.
cuda/fastermoe/smart_schedule.cpp
View file @
945004e7
...
@@ -44,10 +44,9 @@ void _reduce_grad(
...
@@ -44,10 +44,9 @@ void _reduce_grad(
long
expert_size
)
{
long
expert_size
)
{
auto
smgr
=
getCudaStreamManager
(
t
.
device
().
index
());
auto
smgr
=
getCudaStreamManager
(
t
.
device
().
index
());
auto
torch_stream
=
c10
::
cuda
::
getCurrentCUDAStream
().
stream
();
cudaEvent_t
evt_stash
;
cudaEvent_t
evt_stash
;
cudaEventCreate
(
&
evt_stash
);
cudaEventCreate
(
&
evt_stash
);
cudaEventRecord
(
evt_stash
,
torch
_s
tream
);
cudaEventRecord
(
evt_stash
,
smgr
->
torch
S
tream
()
);
FMOE_SWE
(
smgr
->
stream
(
0
),
evt_stash
);
FMOE_SWE
(
smgr
->
stream
(
0
),
evt_stash
);
cudaEventDestroy
(
evt_stash
);
cudaEventDestroy
(
evt_stash
);
...
...
fmoe/fastermoe/schedule.py
View file @
945004e7
...
@@ -37,7 +37,7 @@ class MoEForward(Function):
...
@@ -37,7 +37,7 @@ class MoEForward(Function):
try
:
try
:
# To skip torch autograd's version check.
# To skip torch autograd's version check.
with
torch
.
autograd
.
graph
.
saved_tensors_hooks
(
nothing
,
nothing
):
with
torch
.
autograd
.
graph
.
saved_tensors_hooks
(
nothing
,
nothing
):
y0
=
expert_fn
(
x
,
torch
.
tensor
([
x
.
shape
[
0
]],
dtype
=
torch
.
int64
))
y0
=
expert_fn
(
x
,
torch
.
tensor
([
x
.
shape
[
0
]],
dtype
=
torch
.
int64
)
,
expert_idx
)
except
Exception
as
e
:
except
Exception
as
e
:
# Ignore the error and fall back for compatibility to older
# Ignore the error and fall back for compatibility to older
# versions of PyTorch
# versions of PyTorch
...
...
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