mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #51] Confuse about the estimated bandwidth on tests/test_internode.py #47
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#47
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 @Fangjin98 on GitHub (Mar 6, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/51
We ran tests/test_internode.py on 2/4 H800-IB machines, and found that the estimated bandwidth sometimes can achieve up to 50GBps, which exceed the hardware capacity of NICs. SO we think if there is a mistake on bandwidth calculation.
Can you confirm this issue or correct any errors in the following analysis?
We perform some tests, and it seems that the reason is that test_internode.py count the tokens to themselves as the
num_tokens_per_rdma_rank, so the estimiated bandwidth is approximate (N_NODES / (N_NODES-1)) times to the real bandwidth.We use
mlnx_perf -i ib1to monitor the NIC rx_vport_rdma_unicast_bytes/tx_vport_rdma_unicast_bytes. The results seem to validate our assumption.For example, in 2-H800 scenario, the program print the following:
And the print of
mlnx_perf -i ib1is the following:173098/1024/8 = 21.13 GBps ~= 43.24 / 2
In 4-H800 scenario, we observe the estimated bandwidth is 51.98GBps, and the monitored bandwidth is about 37 GBps. 37/51.98 ~= 3/4.
It seems that
dispatchin internode.py does not utilize RDMA for intra-node communication, so that parts of tokens should not be calculated in num_tokens_per_rdma_rank.We replace the original code with the following to correct the bandwidth estimation:
@oliverYoung2001 commented on GitHub (Mar 6, 2025):
You are right! I found this problem, too.
@LyricZhao commented on GitHub (Mar 6, 2025):
You are absolutely correct.
However, from a programming perspective, a lot of the code logic is shared across all ranks, and some operations even require a certain level of synchronization among all ranks. For example, during the combine kernels, if a token's reduce data source comes from both its own rank and other ranks, even if the data copy speed within its own rank is very fast, it will still be somewhat blocked by other ranks.
Moreover, with only around 20 SMs, which also includes the copying of RDMA buffers from other ranks, the actual bandwidth for copying data to its own memory isn't that high (it's even comparable to the network card's bandwidth). To some extent, we have also considered the overall metrics as the speed of self-copying.
During the debugging process of V3 training, we have been continuously tuning EP64 and EP128, and the gap between these two computation methods isn't significant. Therefore, we consciously decided to keep this issue as is, but indeed, when there are very few ranks, the computational difference can be quite large.
Thank you for your feedback :) We will have an internal discussion next week to consider whether to change the test metrics.
@Fangjin98 commented on GitHub (Mar 7, 2025):
Thanks for your reply.
It seems that the current metrics is showing the algorithm bandwidth (of RDMA send), while we thought it denotes the bus bandwidth. So these is a little gap.
@jiangjiang-coder66 commented on GitHub (Apr 10, 2025):
Hi @LyricZhao , I used tests/test_internode.py, the measured IB bandwidth using the original code under EP64 is 45 GB/s which closed to github performance, while the bandwidth tested with the code provided by @Fangjin98 is 32 GB/s. The difference is quite significant.
@LyricZhao commented on GitHub (Apr 11, 2025):
If the tokens are evenly distributed, I guess it should be
45 * 7/8 = 39.375? Anyway, there is still some space for optimization, we will refactor the code for better IB utilization later.@jiangjiang-coder66 commented on GitHub (Apr 18, 2025):
Yes, you are right. I retested it with tokens are evenly distributed, the scale closed to 7/8. Thanks for replying.
@LyricZhao commented on GitHub (Apr 22, 2025):
Performance now has been optimized, see https://github.com/deepseek-ai/DeepEP/pull/130.