arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.11329cs.DCcs.LG
收藏

TokenWeave:分布式大语言模型推理中的高效计算-通信重叠

TokenWeave: Efficient Compute-Communication Overlap for Distributed LLM Inference

Microsoft(微软)

Raja Gond, Nipun Kwatra, Ramachandran Ramjee

AI总结:

TokenWeave通过优化RMSNorm与通信的融合核,实现高效计算-通信重叠,提升低token长度下的推理性能,实验显示延迟降低1.28倍,吞吐量提升1.19倍。

摘要:

分布式大语言模型(LLM)推理使用张量并行时,即使在NVLink连接的GPU上,通信开销仍可达20%。现有技术通过分解计算任务并重叠通信与子任务来缓解此问题,但未在vLLM、SGLang和TensorRT-LLM等系统中启用。此问题源于每轮处理的token数量通常较小以支持低延迟服务,分解此类小工作负载以实现通信重叠会导致性能下降。此外,通信本身使用大量流多处理器(SMs),这些SMs本可用于计算,从而增加开销。我们提出TokenWeave,这是首个支持高效计算-通信重叠的系统,适用于token长度最小为1024的情况。TokenWeave识别RMSNorm为关键操作,并通过实现新型融合AllReduce-RMSNorm内核进行优化。进一步,该内核利用现代GPU(如Hopper、Blackwell)的NVSHARP/Multimem特性,仅使用2-8个SMs在8×H100 DGX系统上高效执行通信和RMSNorm。我们的评估显示,在多个模型和工作负载中,延迟降低达1.28倍(基准÷我们),吞吐量提升达1.19倍(我们÷基准)。在某些设置中,TokenWeave的表现优于移除通信的等效模型。源代码可在https://github.com/microsoft/tokenweave获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑