arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.21100cs.DC
收藏

NanoCP: 数据专家并行解码的请求级动态上下文并行

NanoCP: Taming Load Imbalance in Data-Expert Parallel Decoding under Variable-Length Workloads

Fudan University(复旦大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Huazhong University of Science and Technology(华中科技大学);The Chinese University of Hong Kong(香港中文大学);Shanghai Jiao Tong University(上海交通大学);Harbin Institute of Technology(哈尔滨工业大学);Peking University(北京大学);SenseTime(商汤科技)

Jiefei Chen, Binbin Lin, Jinming Ma, Jiangfei Duan, Haojie Duanmu, Hao Liu, Qinxiu Cheng, Xiuhong Li, Zhilin Pei, Hui Wang, Xingcheng Zhang, Dahua Lin

AI总结:

本文提出NanoCP,通过动态上下文并行技术解耦MoE通信与KV缓存放置,实现上下文并行度的动态平衡,从而在不增加额外负载的情况下提升请求速率和降低尾延迟。

摘要:

现代Mixture-of-Experts (MoE)模型服务系统采用混合数据专家并行性:专家并行性(EP)将专家跨GPU分布以扩展容量,而数据并行性(DP)在实例间复制注意力层以处理独立请求。现有系统将每个请求的注意力、MoE通信和KV缓存绑定到单个实例。由于注意力延迟随KV缓存大小而增加,而MoE通信延迟随批处理大小而增加,这种绑定无法同时平衡两者,导致EP滞后;它还使KV内存碎片化,长上下文情况下尾延迟增加。尽管现有上下文并行性(CP)缓解了这些限制,但其均匀的并行度导致显著的通信和注意力侧开销。我们提出\work,通过动态上下文并行(DCP)解耦MoE通信与KV缓存放置,并通过动态上下文并行实现双平衡。DCP为每个请求分配一个根据其KV足迹大小的上下文并行度:长请求将注意力分布在多个实例上;短请求保持本地。这种动态并行性有效地将KV缓存液化到集群中,平衡每个实例的KV缓存占用和批处理大小,而无需额外的负载平衡成本。为了将DCP与静态执行连接起来,\work引入了一个面向时间(AOT)图引擎配以定制的基于路由的通信后端。实验结果表明,\work在严格的时间每输出令牌(TPOT)服务级别目标(SLOs)下,请求速率可提高高达1.88倍至3.27倍。此外,\work显著缓解了滞后,将P99尾延迟降低了高达1.79倍至2.12倍。

英文摘要:

Modern serving systems for Mixture-of-Experts (MoE) models adopt hybrid data-expert parallelism: expert parallelism (EP) shards experts across GPUs to scale capacity, while data parallelism (DP) replicates attention layers across instances to process independent requests. Existing systems bind each request's attention, MoE communication, and KV cache to a single instance. Because attention latency scales with KV cache size while MoE communication latency scales with batch size, this binding cannot balance both simultaneously, producing EP stragglers; it also fragments KV memory across instances, inflating tail latency under long contexts. While existing context parallelism (CP) mitigates these constraints, existing group-level and uniform CP designs incur prohibitive communication and attention-side overheads. We present NanoCP, which decouples MoE communication from KV cache placement and achieves dual balance through dynamic context parallelism (DCP). DCP assigns each request a context-parallel degree sized to its KV footprint: long requests distribute attention across multiple instances; short requests remain local. This dynamic parallelism effectively liquefies the KV cache across DP instances within each node, balancing both the per-instance KV cache occupancy and batch sizes without unnecessary load-balancing costs. To bridge DCP with static execution, NanoCP introduces an ahead-of-time (AOT) graph engine paired with a custom routing-based communication backend. Experimental results show that, under 99% TPOT-SLO attainment, NanoCP achieves $3.27\times$ and $2.11\times$ the maximum sustainable request rate of the best-performing vLLM baseline on the DeepSeek-V3 Issue 1% and Issue 5% workloads, respectively, while reducing P99 TPOT by $1.94\times$ and $2.01\times$ on the same two workloads, respectively.

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

↑