mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #797] Add EP_RDMA_GBS env to declare RDMA link bandwidth when ibstat under-reports it (fixes under-provisioned num_sms on CX8 800G) #791
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#791
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?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepEP/pull/797
Author: @sssssakuraaaaa
Created: 10/26/2026
Status: 🔄 Open
Base:
main← Head:fix/env-rdma-gbs📝 Commits (1)
b7ac457Add EP_RDMA_GBS env to declare RDMA link bandwidth when ibstat under-reports it📊 Changes
1 file changed (+10 additions, -0 deletions)
View changed files
📝
deep_ep/utils/envs.py(+10 -0)📄 Description
Problem
get_theoretical_num_sms(deep_ep/buffers/ep.py) auto-estimates the dispatch/combine SM countfrom the RDMA bandwidth returned by
get_rdma_gbs()(deep_ep/utils/envs.py), which parsesibstat'sRatefield. In a bonded (802.3ad LAG) RDMA setup this under-detects bandwidth andunder-provisions the SM count for the inter-node (scale-out) path:
ibstat(and the kernel's/sys/class/net/<dev>/speed) report a single memberlink's rate, not the bonded aggregate. On a ConnectX-8 800G NIC that member shows
400(4X NDR), so
get_rdma_gbsreturns 50 GB/s instead of 100.mlx5_0, which on some hosts is a 200G front-end/management NIC (notthe GPU rail), yielding 25 GB/s.
Either way the auto
num_smscomes out far too low (e.g. ~6–8 instead of ~28), which directlystarves the scale-out path. Users currently work around it by hard-coding
--num-sms, a magicnumber that doesn't adapt to token/expert/topk changes.
Fix
Add an opt-in
EP_RDMA_GBSenv that declares the true per-GPU RDMA link bandwidth (GB/s). Whenset,
get_rdma_gbsreturns it directly; when unset, behavior is unchanged. This feeds the correctinput to the existing SM model so
num_smsis computed correctly and adapts to the workload,instead of overriding the output with
--num-sms.(
osis already imported at the top of the file.)Verification
B300, 2 nodes × 8 GPU (EP16), hybrid mode, NCCL 2.32.3 / CUDA 13,
tests/ep/test_ep.pyexperts=256 hidden=7168 topk=8 token=4096,
EP_OVERRIDE_RDMA_SL=162,--num-sms 0(auto):EP_RDMA_GBS=100(true CX8 800G)Declaring the true bandwidth lets the model pick 28 SM and matches a manual
--num-sms 32(132 GB/s / 464 µs), without the magic number. The middle row shows that even selecting the correct
rail NIC still under-reports (bond member 400G → only 16 SM), which is why a declaration — not
better auto-detection — is the robust fix in a bonded 800G setup.
Usage
Scope / safety
Additive and opt-in; no change when the env is unset. Fixing the
mlx5_0default / auto rail-NICselection is intentionally out of scope — on a bond it still can't reach the true 800G because
ibstat/sysfs only expose a member link, so it wouldn't remove the need to declare.Independent of #791 (symmetric-window ordering,
EP_RELAXED_WIN_ORDERING) and #794 (tail-signallayout); the three don't depend on each other.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.