mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #577] Question about synchronization guarantee in DeepEP dispatch low latency kernel #355
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Yi-sir on GitHub (Feb 2, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/577
Hi,
I've been reading the DeepEP dispatch low latency kernel code, but I have a concern about the synchronization mechanism:
My understanding of the issue:
In the dispatch kernel, each rank can only guarantee that the tokens it sends have been received by the target expert (through the atomic_finish_counter_per_expert mechanism). However, I don't see a synchronization mechanism that ensures the kernel exits only after receiving all expected tokens from other ranks.
Specifically:
The sending side uses atomic_finish_counter_per_expert to track local send completion
The receiving side uses while (ld_acquire_sys_global(rdma_recv_count...) == 0) to wait for notifications from specific ranks
But there seems to be no barrier or counter that aggregates "total expected receives from all ranks" to ensure the kernel waits for all of them before returning
My question:
Is there a mechanism I'm missing that guarantees a rank has received tokens from all other ranks before the kernel exits? Or does the kernel actually exit without ensuring full reception, relying on external synchronization (e.g., nvshmem_barrier_all() or a second kernel launch) to guarantee consistency?
I would appreciate any clarification on this. Thank you very much!
@Yi-sir commented on GitHub (Feb 2, 2026):
As an additional question: When running DeepSeek-V3.1 model using SGLang, I observed in the profiling traces that the dispatch low latency recv operation takes longer than dispatch ll send. However, DeepEP/tests/test_low_latency.py shows the opposite results (where send takes longer than recv). Is this behavior expected/normal?
@polarstormx commented on GitHub (Feb 3, 2026):
In the recv phase, each warp group is responsible for one src rank of a local expert. If a src rank's data hasn't arrived, the corresponding warp group will keep waiting in the while loop, preventing the kernel from exiting. Perhaps you thought that one while loop is waiting for multiple senders?
@Yi-sir commented on GitHub (Feb 3, 2026):
Thank you! I did misunderstand what warp groups do in the recv phase...