Files
project_6/upstream_ref/xllm/docs/zh/features/multi_streams.md
EX Engine 002f9879b2 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
2026-08-10 02:54:03 +00:00

1.3 KiB
Raw Blame History

多流并行

背景

大模型分布式推理场景中需要引入额外的通信操作将不同设备上的计算结果聚合在一起。以Deepseek这类大规模的MoE模型为例分布式规模通常较大通信开销也会随之变大。计算和通信都采用同一个stream的话在通信的同时device计算资源会出现浪费一直等待通信完成才能开始后面的计算。

功能介绍

xLLM在模型图层支持了多流并行功能将输入的batch拆分成2个micro batches一个流执行一个micro batch的计算操作另一个流执行另一个micro batch的通信操作计算和通信同时执行从而掩盖通信开销。 异步调度

使用方式

xLLM中提供了gflags参数enable_multi_stream_parallel默认false如需开启在xLLM的服务启动脚本中设置为true即可示例如下

--enable_multi_stream_parallel=true

性能效果

prefill双流并行开启后基本可掩盖75以上的通信开销在DeepSeek-R1模型上只输出1个token的情况下

  • TTFT下降 7%
  • 吞吐 提升7%

!!! warning "注意" 双流并行目前只支持prefill阶段请求输入越长收益越大。 目前仅支持DeepSeek、Qwen3 dense非MoE模型。