通过微批次协同执行隐藏分布式LLM训练中的通信成本
Hiding Communication Cost in Distributed LLM Training via Micro-batch Co-execution
AI总结:
本文提出受DNA结构启发的DHelix微结构,通过链交错协同调度两条微批次流的前向与后向计算来隐藏通信开销,在多个GPU集群上显著提升LLM训练的MFU。
摘要:
大语言模型(LLMs)的发展使得大规模分布式训练成为必要。然而,即使经过高度优化的框架,由于巨大的通信量,仍然在模型FLOPS利用率(通常低于50%)方面遭受显著损失。与此同时,我们的全面性能分析显示,计算密集型和通信密集型算子能够很好地重叠。本文介绍了DHelix,这是一种受DNA结构启发、能够大幅提升LLM训练效率的新型微结构。DHelix设计的核心是链交错(Strand Interleaving,SI),它将流经GPU的连续训练微批次流视为两条链。DHelix将两条链的前向和后向传递并置,并对SI方案进行系统性优化,通过算子级重叠分析结果和基于动态规划的搜索算法,协同调度来自相对链的算子。同时,DHelix使两条链能够共享模型状态和激活数据的空间,以不到3%的额外内存空间有效容纳两个微批次。DHelix能够与所有形式的现有数据/模型并行无缝集成,其中最具挑战性的是流水线并行,这得益于其独特的模型折叠设计,形成了W形流水线。我们在3个GPU集群(A40、A800和H100)上评估了DHelix在流行的Llama和GPT稠密模型以及Phi专家混合(MoE)模型上的训练效果。结果表明,在64-A40和64-A800集群上,它分别实现了12-40%(最高58% MFU)和2-29%(最高71% MFU)的提升,显著优于最先进的方法。在H100集群上,尽管更快的网络降低了DHelix的利润空间,但它使得跨节点张量并行变得有前景,而这一做法目前由于通信成本过高而难以实施。
英文摘要:
The growth of Large Language Models (LLMs) has necessitated large-scale distributed training. Highly optimized frameworks, however, still suffer significant losses in Model FLOPS utilization (often below 50%) due to large communication volumes. Meanwhile, our comprehensive profiling shows that the computation- and communication-intensive operators overlap well. This paper introduces DHelix, a novel micro-structure that dramatically improves the efficiency of LLM training inspired by the DNA structure. Central to DHelix's design is Strand Interleaving (SI), which views the continuous stream of training micro-batches through a GPU as two strands. DHelix juxtaposes the forward and backward passes of the two strands and performs a systematic optimization for an SI plan that co-schedules the operators from the opposite strands, enabled by operator-level overlap profiling results and a dynamic-programming based search algorithm. Meanwhile, DHelix enables the two strands to share model states and space for activation data, effectively accommodating two micro-batches with under 3% extra memory space. Dhelix seamlessly integrates with all forms of existing data/model parallelism, the most challenging being pipeline parallelism, thanks to its unique model folding design that results in a W-shaped pipeline. We evaluate DHelix training with the popular Llama and GPT dense models, plus the Phi Mixture of Expert (MoE) model, across 3 GPU clusters (A40, A800, and H100). Results show that it achieves 12-40% (up to 58% MFU) and 2-29% (up to 71% MFU) improvement on the 64-A40 and 64-A800 clusters, respectively, significantly outperforming state-of-the-art methods. On the H100 cluster, though the faster network reduces DHelix's profit margin, it makes cross-node tensor parallelism promising, a practice currently prohibitive due to communication costs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。