arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.21788cs.DCcs.LG
收藏

利用灵活上下文并行实现LLM训练的高效扩展

Efficient Scaling of LLM Training with Flexible Context Parallelism

The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Huawei Technologies Co., Ltd.(华为技术有限公司)

Yifan Niu, Han Xiao, Dongyi Liu, Wei Zhou, Jia Li

AI总结:

针对数据异构导致负载不均和通信冗余问题,提出自适应重配置通信组和上下文并行度的FCP策略,实现近线性加速比,最高达1.46倍吞吐提升。

摘要:

扩展长上下文能力对于大型语言模型(LLM)至关重要。然而,现实世界的数据包含大量具有异构长度的序列。现有的LLM训练库依赖于静态并行策略,在数据异构下会遭受严重的负载不均衡、冗余通信和次优的硬件利用率。在这项工作中,我们提出了灵活上下文并行(FCP),一种高效的并行策略,能够在LLM训练期间自适应地重配置通信组和上下文并行度。我们推广了更灵活的非2的幂次并行度,并开发了一个多项式时间算法,为每个训练批次生成近乎最优的并行策略,开销仅为毫秒级。即使在极端数据异构下,FCP也能保持高硬件效率。实验结果表明,FCP在LLM和多模态大模型(MLLM)训练中均显著优于Megatron-LM和DeepSpeed,在保持大规模集群近线性扩展效率的同时,平均吞吐量提升高达1.46倍。对于极端不平衡的批次,FCP甚至实现了2.24倍的加速。

英文摘要:

Scaling long-context capabilities is crucial for Large Language Models (LLMs). However, real-world data contain a large number of sequences with heterogeneous lengths. Existing training libraries for LLMs rely on static parallelism strategies, which suffer from severe load imbalance, redundant communication, and suboptimal hardware utilization under data heterogeneity. In this work, we propose Flexible Context Parallelism (FCP), an efficient parallelism strategy that adaptively reconfigures communication groups and context parallelism degrees during LLM training. We generalize more flexible non-power-of-two parallelism degrees and develop a polynomial-time algorithm to generate near-optimal parallelism strategies with only millisecond-level overhead per training batch. FCP is able to maintain high hardware efficiency even under extreme data heterogeneity. Experimental results demonstrate that FCP significantly outperforms Megatron-LM and DeepSpeed in both LLM and MLLM training, achieving up to 1.46x speedup in average throughput while maintaining near-linear scaling efficiency across large-scale clusters. For extremely unbalanced batches, FCP even achieves 2.24x speedup.

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

↑