ref(upstream): FULL TREE — Deep-Spark xllm (1470) + ds_vllm csrc/models (703)
Replaces cherry-picked upstream_ref with complete source trees. xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files) Complete: kernels → layers → models → runtime → scheduler → api Excluded: .git, binary images, third_party submodule checkouts ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files) Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops Excluded: tests, benchmarks, docs, examples (not needed for reference) Critical call chains now fully traceable: MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp Attention: ixformer.h → xllm_paged_attention → attention.cpp
This commit is contained in:
17
upstream_ref/xllm/docs/zh/features/moe_params.md
Normal file
17
upstream_ref/xllm/docs/zh/features/moe_params.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# EP并行
|
||||
## 背景介绍
|
||||
在部署DeepSeek-R1 671B参数规模模型时传统分布式部署面临、显存利用率低、通信开销大、硬件成本高昂等核心瓶颈,因此需要引入ep并行。
|
||||
+ 在同等资源下,单张卡上的Expert越少,可用于KV Cache的显存越多,可Cache的token个数越多。
|
||||
+ 因MLA的特性,同等资源下TP Size越小,冗余的KV Cache就越少,可Cache的token个数越多。
|
||||
+ 采用大规模ep并行部署,可以将同一个expert的token计算集中到同一设备上,提高硬件利用率
|
||||
## 参数设置
|
||||
+ dp_size:设置Attention部分的dp规模大小,默认值为1,可设置为2的指数倍,当dp_size不等于卡数时,dp组内为tp并行.
|
||||
+ ep_size:设置MoE部分的ep规模大小,默认值为1,可设置为2的指数倍,当ep_size不等于卡数时,dp组内为tp并行.
|
||||
+ expert_parallel_degree :ep并行相关参数,不开启ep时默认设置为0,开启ep时默认为1,此时为ep level1,当ep_size等于卡数时可以设置为2开启ep level2.
|
||||
|
||||
支持 MLA 的模型会自动开启 MLA,不再需要手动配置。
|
||||
## 方案设计
|
||||
+ 当开启ep时,默认为ep level1,此时attn与moe部分计算完成后,通过All Gather全卡通讯将数据发送到下一阶段,以64卡attn部分dp32tp2 moe部分ep32tp2为例,执行流程如下:
|
||||

|
||||
+ 当ep_size设置为卡数时,可以开启ep level2,此时attn部分与moe部分之间通讯变为ALL2ALL,只向需要的卡发送数据,降低通讯量与通讯开销,以64卡部署为例,执行流程如下:
|
||||

|
||||
Reference in New Issue
Block a user