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

HSAP: 一种面向混合上下文生成模型的分层序列感知并行方法

HSAP: A Hierarchical Sequence-aware Parallelism for Hybrid-Context Generative Models

Southern University of Science and Technology(南方科技大学);International Digital Economy Academy(国际数字经济学院)

Songxin Zhang, Zejian Xie, Zhuoyang Song, Cong lin, Junyu Lu, Jiaxing Zhang, Bingyi Jing

AI总结:

提出一种分层序列感知并行框架,通过JIT编译优化通信策略,解决混合上下文打包序列中的因果注意力计算问题,在多个指标上优于现有方法。

摘要:

在本文中,我们旨在结合现有序列并行范式的优势并克服其缺点,其中最严重的问题是在一个更强的序列并行框架中无法正确计算混合上下文打包序列上的因果注意力。打包序列以高效预训练和微调大语言模型的实际技术会导致注意力计算中的交叉污染问题,当序列长度维度上没有并行时,该问题可以有效解决。然而,在序列并行中,现有方法要么忽略混合上下文序列的场景,要么相反地牺牲和限制并行度以支持该场景。为此,我们创新性地提出了一种高效的序列感知并行算法,以克服跨多个设备组的密集张量传输和部分注意力计算的障碍。我们的算法利用JIT(即时)编译来优化NCCL级别所有设备组的通信策略。此外,我们将现有序列并行范式集成到一个分层序列感知并行框架中,该框架受益于我们的序列感知算法。我们还详细阐述了分层框架的内存和通信开销管理以优化其性能。通过多次实验,我们证明了我们提出的方法在多个指标上优于其他最先进的序列并行方法。

英文摘要:

In this paper, we aim to combine the advantages of existing sequence parallelism paradigms and overcomes their drawbacks, the most serious of which is the incapability to correctly compute causal attention on the hybrid-context packed sequences, in a stronger sequence parallelism framework. The practical technique of packing sequences for efficiently pretraining and fine-tuning large language models causes cross-contamination problem in attention computation, which can be effectively solved when no parallelism in the sequence length dimension is taken. However, in sequence parallelism, existing approaches either ignore the scenario of hybrid-context sequences or conversely sacrifice and limit parallelism degree for supporting the scenario. To this end, we innovatively propose an efficient Sequence-Aware Parallelism algorithm to conquer the obstacles of intensive tensor transmission and partial attention computation across multiple device groups. Our algorithm utilizes JIT (Just-In-Time) compilation to optimize the communication strategy of all device groups in NCCL level. Further, we integrate existing sequence parallelism paradigms into a Hierarchical Sequence-Aware Parallelism framework which benefits from our sequence-aware algorithm. We additionally elaborate on the memory and communication overhead management of the hierarchical framework to optimize its performance. Through multiple experiments, we demonstrate that our proposed approach outperform other state-of-the-arts sequence parallelism approches in multiple metrics.

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

↑