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

MOCAP:面向晶圆级芯片的面向预填充LLM推理的内存协调分块流水线框架

MOCAP: Wafer-Scale-Chip-Oriented Memory-Orchestrated Chunked Pipelining Framework for Prefill-Only LLM Inference

Tsinghua University(清华大学);Shanghai Jiao Tong University(上海交通大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)

Zichuan Wang, Huizheng Wang, Yuheng Xiao, Haonan Zuo, Taiquan Wei, Jinyi Deng, Chao Li, Yang Hu, Shouyi Yin

AI总结:

提出MOCAP框架,通过内存平衡KV重分配和延迟平衡分块划分,解决晶圆级芯片上长上下文预填充中的内存和延迟不平衡问题,显著降低端到端延迟并提高吞吐量。

摘要:

大型语言模型(LLM)越来越多地用于预填充工作负载,其中端到端延迟主要由预填充阶段决定。对于长上下文预填充,通信开销随序列长度增长,并迅速成为传统GPU系统上的瓶颈,这使得晶圆级芯片(WSC)因其高通信带宽和大聚合计算与内存容量而成为有前景的基板。加速预填充的一种自然方法是将长输入序列划分为多个块,并在设备间以更细粒度的流水线方式执行它们。然而,直接将这一想法应用于WSC上的长上下文预填充仍然具有挑战性。首先,块间的因果依赖导致KV缓存跨流水线阶段不均匀累积,造成严重的内存不平衡并限制可行的序列长度。其次,后面的块需要更多的注意力计算,因为每个块依赖于前面的块,导致块级延迟不平衡。为了解决这些挑战,我们提出了MOCAP,一种面向WSC上预填充LLM推理的内存协调分块流水线框架。MOCAP引入了内存平衡KV重分配(MBKR)以通过跨流水线阶段重新分配KV缓存来缓解内存不平衡,从而扩展可行的序列长度。它进一步结合了延迟平衡分块划分(LBCP),以在注意力成本增长和KV重分配开销下平衡块执行成本,提高流水线效率。实验结果表明,与GPipe相比,MOCAP平均实现了76.4%更低的端到端延迟和3.24倍的吞吐量提升。与Terapipe相比,MOCAP还将最大支持序列长度扩展了高达1.31倍。

英文摘要:

Large language models (LLMs) are increasingly used in prefill-only workloads, where end-to-end latency is dominated by the prefill phase. For long-context prefill, communication overhead grows with sequence length and quickly becomes a bottleneck on conventional GPU systems, making wafer-scale chips (WSCs) a promising substrate due to their high communication bandwidth and large aggregate compute and memory capacity. A natural way to accelerate prefill is to partition a long input sequence into multiple chunks and execute them in a finer-grained pipeline across devices. However, directly applying this idea to long-context prefill on WSCs remains challenging. First, causal dependency across chunks causes KV cache to accumulate unevenly across pipeline stages, creating severe memory imbalance and limiting the feasible sequence length. Second, later chunks require more attention computation because each chunk depends on preceding chunks, leading to chunk-level latency imbalance. To address these challenges, we present MOCAP, a memory-orchestrated chunked pipelining framework for prefill-only LLM inference on WSCs. MOCAP introduces Memory-Balanced KV Reallocation (MBKR) to alleviate memory imbalance by redistributing KV cache across pipeline stages, thereby extending the feasible sequence length. It further incorporates Latency-Balanced Chunk Partitioning (LBCP) to balance chunk execution cost under both attention-cost growth and KV reallocation overhead, improving pipeline efficiency. Experimental results show that, compared with GPipe, MOCAP achieves 76.4\% lower end-to-end latency and 3.24$\times$ higher throughput on average. MOCAP also extends the maximum supported sequence length by up to 1.31$\times$ compared with Terapipe.

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

↑