Large language models (LLMs) such as GPT-3, OPT, and LLaMA have demonstrated remarkable accuracy in a wide range of tasks. However, training these models can incur significant expenses, often requiring tens of thousands of GPUs for months of continuous operation. Typically, this training is carried out in specialized GPU clusters equipped with homogeneous high-speed Remote Direct Memory Access (RDMA) network interface cards (NICs). The acquisition and maintenance of such dedicated clusters is challenging. Current LLM training frameworks, like Megatron-LM and Megatron-DeepSpeed, focus primarily on optimizing training within homogeneous cluster settings. In this paper, we introduce Holmes, a training framework for LLMs that employs thoughtfully crafted data and model parallelism strategies over the heterogeneous NIC environment. Our primary technical contribution lies in a novel scheduling method that intelligently allocates distinct computational tasklets in LLM training to specific groups of GPU devices based on the characteristics of their connected NICs. Furthermore, our proposed framework, utilizing pipeline parallel techniques, demonstrates scalability to multiple GPU clusters, even in scenarios without high-speed interconnects between nodes in distinct clusters. We conducted comprehensive experiments that involved various scenarios in the heterogeneous NIC environment. In most cases, our framework achieves performance levels close to those achievable with homogeneous RDMA-capable networks (InfiniBand or RoCE), significantly exceeding training efficiency within the pure Ethernet environment. Additionally, we verified that our framework outperforms other mainstream LLM frameworks under heterogeneous NIC environment in terms of training efficiency and can be seamlessly integrated with them.
翻译:摘要:大型语言模型(如GPT-3、OPT和LLaMA)在广泛任务中展现出卓越的准确性。然而,训练这些模型需要巨额成本,通常需要数万块GPU连续运行数月。此类训练通常在配备同构高速远程直接内存访问(RDMA)网卡的专用GPU集群中进行。获取和维护这类专用集群极具挑战性。现有LLM训练框架(如Megatron-LM和Megatron-DeepSpeed)主要致力于优化同构集群环境下的训练。本文提出了Holmes——一个针对异构网卡环境的LLM训练框架,采用精心设计的数据并行与模型并行策略。我们主要的技术贡献在于一种新型调度方法:根据GPU设备所连接网卡的特性,智能地将LLM训练中的不同计算任务分配给特定GPU设备组。此外,所提出的框架利用流水线并行技术,即使在跨集群节点间缺乏高速互连的场景下,也展现出对多GPU集群的可扩展性。我们针对异构网卡环境下的多种场景进行了全面实验。在多数情况下,该框架的性能接近同构RDMA网络(InfiniBand或RoCE)所能达到的水平,显著优于纯以太网环境下的训练效率。此外,我们验证了在异构网卡环境下,所提框架在训练效率上优于其他主流LLM框架,并可与之无缝集成。