arXiv:2502.21231cs.DCcs.AI2025-02被引 21

ByteScale让大模型在超长上下文下高效训练,支持12000+ GPU并行。

ByteScale: Efficient Scaling of LLM Training with a 2048K Context Length on More Than 12,000 GPUs

  • 创新性提出动态混合数据并行(HDP)策略,统一处理长短序列。
  • 通过智能分片与通信优化,使训练效率提升最高7.89倍。
  • 适合大规模长文本、多模态及强化学习场景的高效训练需求。

扩展长上下文能力对大语言模型至关重要。现有训练框架通常将数据并行(Inter-data partitioning)与上下文并行(Intra-data partitioning)视为独立技术,采用静态通信组(如二维网格)组织设备。然而,实际训练中序列长度差异显著,静态网格与数据异构性不匹配,导致冗余通信和计算不均衡,降低训练效率。本文提出ByteScale,一种高效、灵活且可扩展的大规模混合长短序列训练框架。其核心是新型并行策略——混合数据并行(HDP),通过动态网格设计统一两类并行。我们设计通信优化器,基于数据感知的分片与动态通信消除短序列冗余通信,并通过选择性卸载压缩长序列通信开销;同时开发平衡调度器,通过并行感知的数据分配缓解计算不平衡。我们在超过12,000个GPU的生产集群上,对7B至141B模型、256K至2048K上下文长度进行了评估。结果表明,ByteScale相比最先进系统最高提速7.89倍。

原文摘要 · Abstract (English)

Scaling long-context ability is essential for Large Language Models (LLMs). To amortize the memory consumption across multiple devices in long-context training, inter-data partitioning (a.k.a. Data Parallelism) and intra-data partitioning (a.k.a. Context Parallelism) are commonly used. Current training frameworks predominantly treat the two techniques as orthogonal, and establish static communication groups to organize the devices as a static mesh (e.g., a 2D mesh). However, the sequences for LLM training typically vary in lengths, no matter for texts, multi-modalities or reinforcement learning. The mismatch between data heterogeneity and static mesh causes redundant communication and imbalanced computation, degrading the training efficiency. In this work, we introduce ByteScale, an efficient, flexible, and scalable LLM training framework for large-scale mixed training of long and short sequences. The core of ByteScale is a novel parallelism strategy, namely Hybrid Data Parallelism (HDP), which unifies the inter- and intra-data partitioning with a dynamic mesh design. In particular, we build a communication optimizer, which eliminates the redundant communication for short sequences by data-aware sharding and dynamic communication, and further compresses the communication cost for long sequences by selective offloading. Besides, we also develop a balance scheduler to mitigate the imbalanced computation by parallelism-aware data assignment. We evaluate ByteScale with the model sizes ranging from 7B to 141B, context lengths from 256K to 2048K, on a production cluster with more than 12,000 GPUs. Experiment results show that ByteScale outperforms the state-of-the-art training system by up to 7.89x.

大模型训练长上下文分布式并行计算

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。