mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #84] Questions on Profiling dispatch_t for Low-Latency Kernel Dispatch Bandwidth Calculation #77
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#77
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 @ghghliu on GitHub (Mar 20, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/84
Hi,
I have a question regarding the calculation of low-latency kernel dispatch bandwidth. In the separate profiling part, the dispatch bandwidth is calculated as:
Could you please clarify how
dispatch_tis profiled whenreturn_recv_hookisFalse? Specifically:dispatch_tstart at the dispatch kernel launch and end when the dispatch send phase completes?I have this question because some of the bw result exceed the nic's max bandwidth, so I guess maybe the end timestamp is not all the token dispatched are received, but estimated by all the token for the expert in this rank are received?
Thanks a lot!
@LyricZhao commented on GitHub (Mar 21, 2025):
It starts at launch, ends after receiving all data, i.e.
send + recvphases, whenreturn_recv_hook=False.Yes.
How many ranks are you using? For local-to-local transfer, we are using direct memory copy but not RDMA. For example, if you are using 8 ranks, 1/8 bandwidth is sending to the local rank, so the real bandwidth is
7/8 * the printed bandwidth.Moreover, even for ranks in the same node, we are not using NVLink but using RDMA. So the only thing you have to consider is to the local GPU (rank) copy.
@ghghliu commented on GitHub (Mar 21, 2025):
Thank you for the quick reply,
We did a simple test in one server with 8 gpu and 8 cx7 nic. After get the topk_idx tensor as the default random way, we mask the expert index belong to gpu0 with the fellowing code, so that gpu 0 receive zero token from other ranks(including itself, so no local gpu mem copy), but send tokens to other rank as usual.
and the result are as fellows, rank 0 dispatch bandwidth is 79.21GB/s. It looks like the time ends when other rank told rank0 zero expert is sent to you.
[rank 3] Dispatch bandwidth: 41.64 GB/s, avg_t=153.35 us | Combine bandwidth: 38.82 GB/s, avg_t=318.30 us
[rank 1] Dispatch bandwidth: 41.61 GB/s, avg_t=158.27 us | Combine bandwidth: 40.54 GB/s, avg_t=314.36 us
[rank 0] Dispatch bandwidth: 79.21 GB/s, avg_t=83.24 us | Combine bandwidth: 32.74 GB/s, avg_t=389.67 us
[rank 7] Dispatch bandwidth: 39.92 GB/s, avg_t=165.17 us | Combine bandwidth: 41.46 GB/s, avg_t=307.76 us
[rank 2] Dispatch bandwidth: 43.53 GB/s, avg_t=156.21 us | Combine bandwidth: 41.62 GB/s, avg_t=316.21 us
[rank 4] Dispatch bandwidth: 41.81 GB/s, avg_t=158.22 us | Combine bandwidth: 40.65 GB/s, avg_t=314.93 us
[rank 6] Dispatch bandwidth: 42.19 GB/s, avg_t=154.88 us | Combine bandwidth: 39.78 GB/s, avg_t=317.84 us
[rank 5] Dispatch bandwidth: 42.24 GB/s, avg_t=156.95 us | Combine bandwidth: 40.57 GB/s, avg_t=316.24 us
about this part,
1、Are the receive phase and send phases executed sequentially or asynchronously? Is it possible the rank receiving all data dispatched to it before its dispatched token are received by others, and if this happens, will the profile ends?
2、Is the sender determining the completion of the sending phase by CQE of the message that sends the number of tokens?
@LyricZhao commented on GitHub (Mar 21, 2025):
Yes, so the printed bandwidth is uni-directional send bandwidth.
Asynchronously, as there is no barrier before launching the dispatch kernel. But as all the ranks will try to read the number of tokens from all ranks, it is a natural "barrier", after several rounds, all ranks should be synchronized.
Yes, possible. But receiving have two "stages", the first is the data transmission (hidden in network), the second is organizating the data using GPU kernels. The first may be not counted before profile starts, but the second will always be counted before the profile ends.
The main branch has now removed CQE mechanism.
BTW, for more convenient communication between us, can you have my WeChat (LyricZ_THU)? If you can speak Chinese.
@ghghliu commented on GitHub (Mar 21, 2025):
Get it, thanks a lot!
@wangshaochuang commented on GitHub (Apr 2, 2025):
@sphish commented on GitHub (Apr 3, 2025):
@wangshaochuang nvshmem 在创建 cq 的时候设置了 overrun 模式。
@wangshaochuang commented on GitHub (Apr 3, 2025):
明白了,谢谢
@wangshaochuang commented on GitHub (Apr 3, 2025):
@LyricZhao commented on GitHub (Apr 3, 2025):
一共有两套 buffer,不会有重用的情况。