Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
DeepEP
Commits
dd13c714
"example/vscode:/vscode.git/clone" did not exist on "1661828bea236e24d1368ab14e379f5ef3259e2e"
Commit
dd13c714
authored
Jun 11, 2025
by
Chenggang Zhao
Browse files
Check the empty list
parent
a8299ca7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
deep_ep/buffer.py
deep_ep/buffer.py
+2
-1
tests/test_intranode.py
tests/test_intranode.py
+2
-1
No files found.
deep_ep/buffer.py
View file @
dd13c714
...
@@ -290,7 +290,8 @@ class Buffer:
...
@@ -290,7 +290,8 @@ class Buffer:
recv_topk_idx: received expert indices.
recv_topk_idx: received expert indices.
recv_topk_weights: received expert weights.
recv_topk_weights: received expert weights.
num_recv_tokens_per_expert_list: Python list shaped `[num_local_experts]`, the received token count by
num_recv_tokens_per_expert_list: Python list shaped `[num_local_experts]`, the received token count by
each local expert, aligned to the input `expert_alignment`.
each local expert, aligned to the input `expert_alignment`. If `num_worst_tokens` is specified, the list
will be empty.
handle: the returned communication handle.
handle: the returned communication handle.
event: the event after executing the kernel (valid only if `async_finish` is set).
event: the event after executing the kernel (valid only if `async_finish` is set).
"""
"""
...
...
tests/test_intranode.py
View file @
dd13c714
...
@@ -117,9 +117,10 @@ def test_main(num_sms: int, local_rank: int, num_ranks: int, rank: int, buffer:
...
@@ -117,9 +117,10 @@ def test_main(num_sms: int, local_rank: int, num_ranks: int, rank: int, buffer:
if
with_topk
:
if
with_topk
:
num_worst_tokens
=
num_tokens
*
num_ranks
num_worst_tokens
=
num_tokens
*
num_ranks
dispatch_args
.
update
({
'num_worst_tokens'
:
num_worst_tokens
})
dispatch_args
.
update
({
'num_worst_tokens'
:
num_worst_tokens
})
recv_worst_x
,
recv_worst_topk_idx
,
recv_worst_topk_weights
,
_
,
_
,
event
=
buffer
.
dispatch
(
**
dispatch_args
)
recv_worst_x
,
recv_worst_topk_idx
,
recv_worst_topk_weights
,
empty_list
,
_
,
event
=
buffer
.
dispatch
(
**
dispatch_args
)
event
.
current_stream_wait
()
if
async_mode
else
()
event
.
current_stream_wait
()
if
async_mode
else
()
recv_worst_x
=
per_token_cast_back
(
*
recv_worst_x
)
if
isinstance
(
recv_worst_x
,
tuple
)
else
recv_worst_x
recv_worst_x
=
per_token_cast_back
(
*
recv_worst_x
)
if
isinstance
(
recv_worst_x
,
tuple
)
else
recv_worst_x
assert
len
(
empty_list
)
==
0
assert
num_worst_tokens
==
recv_worst_x
.
size
(
0
)
assert
num_worst_tokens
==
recv_worst_x
.
size
(
0
)
assert
num_worst_tokens
==
recv_worst_topk_idx
.
size
(
0
)
assert
num_worst_tokens
==
recv_worst_topk_idx
.
size
(
0
)
assert
num_worst_tokens
==
recv_worst_topk_weights
.
size
(
0
)
assert
num_worst_tokens
==
recv_worst_topk_weights
.
size
(
0
)
...
...
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