[论文解读] FLUX: Fast Software-based Communication Overlap On GPUs Through Kernel Fusion
FLUX 提出了一种新型的基于软件的 GPU 通信重叠技术,通过细粒度内核融合,在张量并行深度学习工作负载中隐藏高达 96% 的通信延迟。通过将通信和计算过度分解为细小的块,并将它们融合为单个内核,FLUX 在多种 GPU 集群上实现了训练速度最高 1.24 倍、推理速度最高 1.66 倍的加速效果。
Large deep learning models have demonstrated strong ability to solve many tasks across a wide range of applications. Those large models typically require training and inference to be distributed. Tensor parallelism is a common technique partitioning computation of an operation or layer across devices to overcome the memory capacity limitation of a single processor, and/or to accelerate computation to meet a certain latency requirement. However, this kind of parallelism introduces additional communication that might contribute a significant portion of overall runtime. Thus limits scalability of this technique within a group of devices with high speed interconnects, such as GPUs with NVLinks in a node. This paper proposes a novel method, Flux, to significantly hide communication latencies with dependent computations for GPUs. Flux over-decomposes communication and computation operations into much finer-grained operations and further fuses them into a larger kernel to effectively hide communication without compromising kernel efficiency. Flux can potentially overlap up to 96% of communication given a fused kernel. Overall, it can achieve up to 1.24x speedups for training over Megatron-LM on a cluster of 128 GPUs with various GPU generations and interconnects, and up to 1.66x and 1.30x speedups for prefill and decoding inference over vLLM on a cluster with 8 GPUs with various GPU generations and interconnects.
研究动机与目标
- 为解决现有 GPU 通信重叠技术在高延迟或高带宽互连环境下的性能不佳问题。
- 减少张量并行深度学习工作负载中暴露的通信时间,当前该问题限制了多 GPU 系统的可扩展性。
- 在训练和推理期间的通信密集型操作中,提升 GPU 利用率和 FLOPS 效率。
- 设计一种模块化、可自动调优的解决方案,兼容多种 GPU 架构(如 A100、H800)和互连技术(如 PCIe、NVLink)。
- 在不牺牲内核效率的前提下,实现跨多样化硬件配置的高效通信重叠。
提出的方法
- 将通信和计算操作过度分解为小于传统分块方法的细粒度块。
- 将每个分块的计算和通信操作融合为单个更大的内核,以实现有效的重叠。
- 将每个融合后的块映射到一个线程块,以支持合并内存访问并提升 GPU 占用率。
- 应用与架构感知的优化技术,包括块坐标重排、GPU 指令选择和通信顺序选择。
- 基于 NVIDIA CUTLASS 实现模块化设计,并支持在不同 GPU 代际和互连类型上的自动调优。
- 利用内核融合减少内核启动开销,改善内存访问模式,从而提升整体 GPU 利用率。
实验结果
研究问题
- RQ1在现代 GPU 上,细粒度分解与融合通信和计算操作是否能显著降低暴露的通信延迟?
- RQ2基于内核融合的通信重叠与现有中粒度重叠技术相比,在 GPU 利用率和性能方面表现如何?
- RQ3在不同 GPU 架构和互连技术(如 PCIe 与 NVLink)之间,通信重叠效率能在多大程度上保持稳定?
- RQ4所提出的方法是否能在最小化架构假设的前提下,在训练和推理工作负载中均实现显著性能提升?
- RQ5该框架的自动调优能力在不同硬件配置下的有效性如何?
主要发现
- FLUX 在融合内核中实现了高达 96% 的通信重叠效率,显著优于现有方法。
- 在 128-GPU 集群上,FLUX 在训练工作负载中相比 Megatron-LM 实现了最高 1.24 倍的加速。
- 在推理方面,FLUX 在 8-GPU 集群上相比 vLLM 实现了最高 1.66 倍的加速,解码阶段达到 1.30 倍加速。
- 在 A100 PCIe 上,FLUX 在操作级别评估中相比 TransformerEngine 实现了最高 3.25 倍加速,即使 NCCL 是基线。
- FLUX 在硬件差异下表现出稳健性能,在 H800 NVLink 集群上实现了平均 72% 的重叠效率,而 TransformerEngine 仅为 20%。
- 在 A100 PCIe 的某些大模型规模场景中,FLUX 的运行速度甚至超过了非重叠基线,表明其有效隐藏了延迟。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。