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

解耦乌lysses:通过头级分块实现内存高效的上下文并行

Untied Ulysses: Memory-Efficient Context Parallelism via Headwise Chunking

Together AI

Ravi Ghadia, Maksim Abraham, Sergei Vorobyov, Max Ryabinin

AI总结:

UPipe通过头级分块实现内存高效的上下文并行,显著减少激活内存使用,支持更长的上下文长度。

摘要:

高效处理长序列的Transformer模型通常需要通过上下文并行将计算分散到加速器上。在这一类方法中,主导的方案如环形注意或DeepSpeed Ulysses,能够在上下文维度上扩展,但并未关注内存效率,这限制了它们所能支持的序列长度。更先进的技术,如完全流水线化的分布式Transformer或激活卸载,虽然可以进一步扩展可能的上下文长度,但以牺牲训练吞吐量为代价。在本文中,我们提出了UPipe,一种简单而有效的上下文并行技术,它在注意力头级别执行细粒度的分块。该技术显著减少了自注意力的激活内存使用,突破了激活内存瓶颈,解锁了更长的上下文长度。我们的方法在注意力层中将中间张量内存使用减少高达87.5%对于32B Transformer,同时在训练速度方面与之前的上下文并行技术相当。UPipe可以在单个8×H100节点上训练Llama3-8B时支持5M token的上下文长度,比先前的方法提高了超过25%。

英文摘要:

Efficiently processing long sequences with Transformer models usually requires splitting the computations across accelerators via context parallelism. The dominant approaches in this family of methods, such as Ring Attention or DeepSpeed Ulysses, enable scaling over the context dimension but do not focus on memory efficiency, which limits the sequence lengths they can support. More advanced techniques, such as Fully Pipelined Distributed Transformer or activation offloading, can further extend the possible context length at the cost of training throughput. In this paper, we present UPipe, a simple yet effective context parallelism technique that performs fine-grained chunking at the attention head level. This technique significantly reduces the activation memory usage of self-attention, breaking the activation memory barrier and unlocking much longer context lengths. Our approach reduces intermediate tensor memory usage in the attention layer by as much as 87.5$\%$ for 32B Transformers, while matching previous context parallelism techniques in terms of training speed. UPipe can support the context length of 5M tokens when training Llama3-8B on a single 8$\times$H100 node, improving upon prior methods by over 25$\%$.

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

↑