arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.03211cs.LGcs.PF
收藏

DistZO2:利用分布式并行计算实现大语言模型的高吞吐、内存高效零阶微调

DistZO2: High-Throughput and Memory-Efficient Zeroth-Order Fine-tuning LLMs with Distributed Parallel Computing

King Abdullah University of Science and Technology (KAUST)(卡斯特大学)

Liangyu Wang, Huanyi Xie, Di Wang

AI总结:

DistZO2通过扰动并行、分布式数据并行和二维并行设计,结合硬件感知通信策略,将零阶微调扩展到多GPU系统,在OPT-175B上实现3倍加速并保持内存高效。

摘要:

由于规模庞大,大语言模型(LLMs)的微调仍然资源密集。虽然零阶(ZO)优化通过消除反向传播提供了一种内存高效的替代方案,但其在数千亿参数模型上的应用受到GPU内存和计算吞吐量的限制。ZO2框架通过将模型参数卸载到CPU内存,并在单个GPU上将Transformer块传输与双重前向计算重叠,解决了内存瓶颈问题。然而,ZO2仍受限于单设备执行,吞吐量有限。在这项工作中,我们提出了DistZO2,一个用于大语言模型分布式零阶微调的高吞吐、内存高效框架。DistZO2引入了三种并行策略:(1)扰动并行(PertP),将两次扰动前向传播跨设备并行化;(2)分布式数据并行(DDP),针对ZO训练的标量梯度特性进行了适配;(3)统一的二维并行设计,将PertP与DDP相结合。为了进一步缓解参数卸载引入的通信瓶颈,我们提出了一种硬件感知的通信策略,该策略将参数块切片,并通过NVLink等高速互连在GPU之间重新分配。DistZO2将零阶微调扩展到现代多GPU系统,在保持ZO2内存效率的同时大幅提升了训练吞吐量。在我们对OPT-175B的实验中,DistZO2通过分布式计算实现了相对于ZO2的3倍加速。DistZO2的代码已在https://github.com/liangyuwang/zo2开源。

英文摘要:

Fine-tuning large language models (LLMs) remains resource-intensive due to their sheer scale. While zeroth-order (ZO) optimization provides a memory-efficient alternative by eliminating backward passes, its application to multi-hundred-billion-parameter models is constrained by GPU memory and compute throughput. The ZO2 framework addresses the memory bottleneck by offloading model parameters to CPU memory and overlapping transformer block transfer with dual forward computation on a single GPU. However, ZO2 remains limited by its single-device execution and achieves modest throughput. In this work, we present DistZO2, a high-throughput, memory-efficient framework for distributed zeroth-order fine-tuning of LLMs. DistZO2 introduces three parallel strategies: (1) Perturbation Parallelism (PertP), which parallelizes the two perturbed forward passes across devices; (2) Distributed Data Parallelism (DDP), adapted to the scalar-gradient nature of ZO training; and (3) a unified 2D Parallelism design that combines PertP and DDP. To further mitigate communication bottlenecks introduced by parameter offloading, we propose a hardware-aware communication strategy that slices parameter blocks and redistributes them across GPUs via high-speed interconnects such as NVLink. DistZO2 scales zeroth-order fine-tuning to modern multi-GPU systems, preserving ZO2's memory efficiency while substantially improving training throughput. In our experiments on OPT-175B, DistZO2 achieves a 3x speedup over ZO2 with distributed computing. DistZO2's code has been open-sourced in https://github.com/liangyuwang/zo2.

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

↑