arXiv:2505.11329cs.DCcs.LG2025-05中稿 · MLSys 2026被引 20

优化大模型分布式推理通信与计算重叠,提升低延迟场景下的性能。

TokenWeave: Efficient Compute-Communication Overlap for Distributed LLM Inference

  • 创新融合AllReduce与RMSNorm操作,减少通信资源占用。
  • 在1024个标记长度下实现最高1.28倍延迟降低、1.19倍吞吐提升。
  • 适配H100等现代显卡,适合追求高效率的LLM部署团队。

使用张量并行进行大语言模型(LLMs)分布式推理时,即使在通过NVLink连接的GPU之间,仍可能产生高达20%的通信开销。尽管已有技术通过将计算分解为更小任务以实现通信与计算重叠,但这些方法在vLLM、SGLang和TensorRT-LLM等系统中默认未启用。原因在于:为支持低延迟服务,每次迭代处理的标记数通常较小,将此类小负载进一步分解反而导致性能下降;同时通信会占用大量流式多处理器(SMs),挤占本可用于计算的资源。我们提出TokenWeave,首个能在标记长度小至1024时实现高效计算-通信重叠的系统。该系统识别出此前被忽视的RMSNorm操作至关重要,并通过新设计的融合AllReduce--RMSNorm内核加以优化。该内核利用现代GPU(如Hopper、Blackwell)上的NVSHARP/Multimem特性,仅用2–8个SM即可高效协同完成通信与RMSNorm运算,在8×H100 DGX系统上表现优异。评估显示,跨多种模型与工作负载,延迟最高降低1.28倍(基准÷我们的结果),吞吐最高提升1.19倍(我们的结果÷基准)。在多个场景下,其性能甚至优于完全移除通信的等效模型。源码已公开于https://github.com/microsoft/tokenweave。

原文摘要 · Abstract (English)

Distributed inference of large language models (LLMs) using tensor parallelism can introduce communication overheads of $20$% even over GPUs connected via NVLink, a high-speed GPU interconnect. Several techniques have been proposed to mitigate these overheads by decomposing computations into smaller tasks and overlapping communication with these subtasks. However, none of these techniques are turned on by default during tensor-parallel serving in systems like vLLM, SGLang and TensorRT-LLM. This is because the number of tokens processed per iteration is typically kept small to support low-latency serving, and decomposing such smaller workloads to enable communication overlap results in worse performance. Further, the communication itself uses many streaming multiprocessors (SMs) that would otherwise be available for computation, increasing overhead. We present TokenWeave, the first system to enable efficient compute-communication overlap for tensor-parallel model inference for token lengths as small as 1024. TokenWeave identifies RMSNorm, a previously overlooked operation, as crucial and optimizes it along with communication by implementing a novel fused AllReduce--RMSNorm kernel. Further, this kernel leverages the NVSHARP/Multimem feature available on modern GPUs (e.g., Hopper, Blackwell) to jointly perform communication and RMSNorm efficiently using only $2-8$ streaming multiprocessors (SMs) on an $8\times$H100 DGX system. Our evaluations demonstrate up to $\boldsymbol{1.28\times}$ speedup in latency (baseline$÷$ours) and up to $\boldsymbol{1.19\times}$ higher throughput (ours$÷$baseline) across multiple models and workloads. In several settings, TokenWeave delivers better performance than an equivalent model with all communication removed. The source code is available at https://github.com/microsoft/tokenweave.

大模型推理通信优化GPU并行RMSNorm

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。