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
2bd187cb
Commit
2bd187cb
authored
Sep 02, 2023
by
zms1999
Browse files
[BUG FIX] sync torch stream before nccl send/recv
parent
ff28081c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
cuda/fastermoe/smart_schedule.h
cuda/fastermoe/smart_schedule.h
+2
-0
No files found.
cuda/fastermoe/smart_schedule.h
View file @
2bd187cb
...
@@ -123,6 +123,7 @@ void fmoe_cuda_fused_forward_impl(
...
@@ -123,6 +123,7 @@ void fmoe_cuda_fused_forward_impl(
long
num_expert
,
long
rank
,
long
world_size
,
long
expert_size
,
long
num_expert
,
long
rank
,
long
world_size
,
long
expert_size
,
long
pipeline_gran
,
CudaStreamManager
*
smgr
)
{
long
pipeline_gran
,
CudaStreamManager
*
smgr
)
{
auto
torch_stream
=
c10
::
cuda
::
getCurrentCUDAStream
().
stream
();
auto
torch_stream
=
c10
::
cuda
::
getCurrentCUDAStream
().
stream
();
cudaStreamSynchronize
(
torch_stream
);
int
*
local_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
int
*
local_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
int
*
global_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
int
*
global_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
...
@@ -282,6 +283,7 @@ void fmoe_cuda_fused_backward_impl(
...
@@ -282,6 +283,7 @@ void fmoe_cuda_fused_backward_impl(
long
num_expert
,
long
rank
,
long
world_size
,
long
num_expert
,
long
rank
,
long
world_size
,
long
pipeline_gran
,
CudaStreamManager
*
smgr
)
{
long
pipeline_gran
,
CudaStreamManager
*
smgr
)
{
auto
torch_stream
=
c10
::
cuda
::
getCurrentCUDAStream
().
stream
();
auto
torch_stream
=
c10
::
cuda
::
getCurrentCUDAStream
().
stream
();
cudaStreamSynchronize
(
torch_stream
);
int
*
local_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
int
*
local_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
int
*
global_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
int
*
global_ptr
=
new
int
[
num_expert
*
world_size
+
1
];
...
...
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