解码令牌并行:用于可扩展LLM解码的内存高效分布式注意力并行
Decode Token Parallelism: Memory-Efficient Distributed Attention Parallelism for Scalable LLM Decoding
AI总结:
提出解码令牌并行(TKNP)架构,解耦权重放置与注意力所有权,在vLLM中实现后,在64个H100 GPU上针对长上下文高并发工作负载,相比DCP和数据并行分别提升最高1.7倍、2.06倍完成吞吐量。
摘要:
在高并发且上下文较长的场景下服务大语言模型,需要KV缓存容量和注意力带宽随解码池扩展。现有并行策略存在权衡:数据并行复制模型权重,限制KV容量;张量并行在模型的KV头数量处停止扩展注意力,并在节点间推送密集的集合通信;解码上下文并行(DCP)通过分片序列恢复容量,但需添加部分注意力结果的跨节点聚合。我们观察到解码期间,密集层和注意力的扩展方式不同:密集层在批次中分摊权重读取,在单个NVLink域内高效运行,而注意力成本随每个活跃请求的KV缓存增长。我们提出解码令牌并行(TKNP),一种将权重放置与注意力所有权解耦的解码池架构。TKNP在节点间以平衡的层块分布单个模型副本。持有某层块的活跃节点使用节点内张量并行为整个批次执行其投影和MLP,而每个节点针对本地驻留的KV缓存为自身的请求计算注意力。这在不复制权重的情况下扩展了跨节点的请求本地注意力:仅当前令牌激活值跨网络传输,密集全归约保持在NVLink内,注意力无需跨节点合并部分结果。在vLLM中实现并在Llama 3.1 405B和Nemotron-4 340B上、最多64个H100 GPU上评估,TKNP在匹配GPU数量下,针对长上下文高并发工作负载,相比DCP将完成吞吐量提升最高1.7倍,相比数据并行提升最高2.06倍。
英文摘要:
Serving large language models at high concurrency with long contexts requires KV-cache capacity and attention bandwidth that grow with the decode pool. Existing parallelization strategies trade one against the other: data parallelism replicates model weights, limiting KV capacity; tensor parallelism stops scaling attention at the model's KV-head count and pushes dense collectives across nodes; and decode context parallelism (DCP) recovers capacity by sharding the sequence but adds cross-node aggregation of partial attention results. We observe that during decode, dense layers and attention scale differently: dense layers amortize weight reads across the batch and run efficiently within a single NVLink domain, whereas attention cost grows with every active request's KV cache. We present Decode Token Parallelism (TKNP), a decode-pool architecture that decouples weight placement from attention ownership. TKNP distributes a single model copy across nodes in balanced layer blocks. The active node holding a block executes its projections and MLP for the full batch using intra-node tensor parallelism, while every node computes attention for its own requests against locally resident KV cache. This extends request-local attention across nodes without replicating weights: only current-token activations cross the network, dense all-reduces remain within NVLink, and attention requires no cross-node merging of partial results. Implemented in vLLM and evaluated on Llama 3.1 405B and Nemotron-4 340B on up to 64 H100 GPUs, TKNP improves completion throughput for long-context, high-concurrency workloads by up to 1.7$\times$ over DCP and by up to 2.06$\times$ over data parallelism at matched GPU count.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。