[issue1] DeepEP internode_ll SM/QP 预算公式复现与扫描工具 - #27
Open
shsaihdsaiudh wants to merge 1 commit into
Open
Conversation
…eoretical_num_sms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue
#1
提交内容
src/code/issue1/sm_qp_budget.py:DeepEP V2ElasticBuffer.get_theoretical_num_sms()与get_theoretical_num_qps()的独立可运行复现。不依赖 GPU 和 DeepEP 运行时,可直接用于离线扫参与推导说明。对照源码:
deepseek-ai/DeepEPcommitdd758caf451848bd150e1046af3d0a73e5fff38d,deep_ep/buffers/elastic.pyL729–L853。保留的建模步骤:
G * (1 - C(E - E/G, k) / C(E, k))估计 top-k 命中的期望 distinct rank 数(scale-out 与全局各算一次);rdma_traffic/rdma_gbs与nvlink_traffic/nvlink_gbs识别瓶颈链路;max(4, ...)下限、偶数对齐,prefer_overlap_with_compute=False时抬到 64,最后受设备 SM 数上限约束;min(num_sms, 8+1),hybrid 取num_sms*16+1,最后受num_allocated_qps限制。相比直接读源码,本实现额外导出了每一步的中间量(
normalized_traffic、link_time_units、bottleneck、read_limited_sms、write_limited_sms、raw_sms),便于对照推导过程,也便于后续定位模型预测与实测最优 SM 数的偏差来源。验证
python -m pytest src/code/issue1/test_sm_qp_budget.py -q # 3 passed python src/code/issue1/sm_qp_budget.py默认扫描 1/2/4/8 节点 × top-k 1/2/4/8,结果写入
src/code/issue1/results/(JSON + CSV),含各配置的瓶颈链路、推荐 SM/QP 数与相对固定 24 SM 的节省量。带宽、专家数、每节点 GPU 数、设备 SM 数均为命令行可替换参数。当前边界
本 PR 覆盖验收要求 1 中的模型推导说明与可复现扫描工具部分。
验收要求 1 的"模型预测值 vs 实测最优 SM 数对比曲线"和验收要求 2(带宽不低于人工扫参最优值 95%、端到端收益分析)需要 ≥2 节点 DeepEP 环境实测 SM 扫描曲线后回填。提交者当前为单卡环境,无法给出实测对比。
results/中所有数值均为模型预测值,文件内已标注,未与实测数据混淆。