提出新型并行策略Helix,让大模型长文本生成更快更高效。
Helix Parallelism: Rethinking Sharding Strategies for Interactive Multi-Million-Token LLM Decoding
- KV缓存分片+张量并行混合用,突破传统并行瓶颈
- 在相同延迟下支持32倍更大批处理,延迟降低1.5倍
- 适合超长序列实时推理,尤其适用于黑森林芯片
随着大模型上下文长度突破数百万令牌,实时自回归解码在严格令牌间延迟(TTL)约束下面临巨大压力。核心瓶颈在于前馈网络(FFN)权重访问和长键值(KV)缓存读取。虽然张量并行(TP)可缓解FFN权重读取开销,但对注意力计算扩展性差;当TP宽度超过KV头数时,导致KV数据冗余、并行度受限、批大小无法提升。同时,长KV历史的DRAM读取随批大小线性增长,进一步限制效率。本文提出Helix并行策略,将注意力阶段的KV缓存分片到多个GPU,再复用这些GPU执行密集型层的张量并行(或MoE的TPxExpert),并通过轻量通信保持精确注意力行为。为降低通信开销,引入了批量重叠优化(Helix HOP-B)。相比传统并行方法,Helix在固定批大小下将延迟降低最多1.5倍,相同延迟预算下支持高达32倍更大的批处理,应用于DeepSeek-R1模型,在黑森林架构上显著提升吞吐-延迟帕累托性能,使超长序列实时推理成为可能。
原文摘要 · Abstract (English)
As LLMs scale to multi-million-token KV histories, real-time autoregressive decoding under tight Token-to-Token Latency (TTL) constraints faces growing pressure. Two core bottlenecks dominate: accessing Feed-Forward Network (FFN) weights and reading long KV caches. While Tensor Parallelism (TP) helps mitigate the cost of FFN weight reads, it does not scale well for attention. When TP width exceeds the number of KV heads, it leads to inefficient KV duplication, limits parallelism, and constrains batch size. Simultaneously, DRAM reads for long KV histories scale linearly with batch size, further capping efficiency. We introduce Helix Parallelism, a hybrid execution strategy that applies KV parallelism during attention to shard KV caches across GPUs, then reuses the same GPUs for TP in dense LLMs or TPxExpert Parallel (EP) in MoEs during FFN computation. To preserve exact attention behavior, Helix includes a lightweight communication step. To minimize the exposed communication cost, we introduce Helix HOP-B. Helix HOP-B effectively minimizes communication overhead through batchwise overlap, preserving low TTL while improving GPU efficiency. Compared to conventional parallelism approaches, Helix reduces TTL by up to 1.5x at fixed batch sizes and supports up to 32x larger batches under the same latency budget for DeepSeek-R1, pushing forward the throughput-latency Pareto on Blackwell and making real-time inference with ultra-long-sequence practical.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。