arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2409.19256cs.LGcs.DC
收藏

HybridFlow:一种灵活且高效的 RLHF 框架

HybridFlow: A Flexible and Efficient RLHF Framework

The University of Hong Kong(香港大学);ByteDance(字节跳动)

Guangming Sheng, Chi Zhang, Zilingfeng Ye, Xibin Wu, Wang Zhang, Ru Zhang, Yanghua Peng, Haibin Lin, Chuan Wu

AI总结:

本文提出 HybridFlow,通过混合单/多控制器范式、分层 API 与 3D-HybridEngine,实现灵活高效的 RLHF 数据流执行,吞吐量最高提升 20.57×。

摘要:

来自人类反馈的强化学习(RLHF)被广泛用于大语言模型(LLM)对齐。传统 RL 可建模为数据流,其中每个节点表示一个神经网络(NN)的计算,每条边表示 NN 之间的数据依赖。RLHF 使数据流变得复杂:它将每个节点扩展为一个分布式 LLM 训练或生成程序,并将每条边扩展为多对多组播。传统 RL 框架使用单一控制器执行数据流,由其同时指示节点内计算和节点间通信;在 RLHF 中,由于分布式节点内计算会产生巨大的控制分发开销,这种方式可能效率低下。现有 RLHF 系统采用多控制器范式,但由于分布式计算与数据通信嵌套,可能缺乏灵活性。我们提出 HybridFlow,它以混合方式结合单控制器和多控制器范式,以实现 RLHF 数据流的灵活表示和高效执行。我们精心设计了一组分层 API,用于解耦并封装复杂 RLHF 数据流中的计算和数据依赖,从而支持高效的操作编排以实现 RLHF 算法,并将计算灵活映射到各种设备上。我们进一步设计了 3D-HybridEngine,用于在训练和生成阶段之间高效地对 actor 模型进行重新分片,实现零内存冗余并显著降低通信开销。实验结果表明,与最先进的基线相比,使用 HybridFlow 运行多种 RLHF 算法时,吞吐量提升了 1.53×~20.57×。HybridFlow 源代码将在 https://github.com/volcengine/verl 提供。

英文摘要:

Reinforcement Learning from Human Feedback (RLHF) is widely used in Large Language Model (LLM) alignment. Traditional RL can be modeled as a dataflow, where each node represents computation of a neural network (NN) and each edge denotes data dependencies between the NNs. RLHF complicates the dataflow by expanding each node into a distributed LLM training or generation program, and each edge into a many-to-many multicast. Traditional RL frameworks execute the dataflow using a single controller to instruct both intra-node computation and inter-node communication, which can be inefficient in RLHF due to large control dispatch overhead for distributed intra-node computation. Existing RLHF systems adopt a multi-controller paradigm, which can be inflexible due to nesting distributed computation and data communication. We propose HybridFlow, which combines single-controller and multi-controller paradigms in a hybrid manner to enable flexible representation and efficient execution of the RLHF dataflow. We carefully design a set of hierarchical APIs that decouple and encapsulate computation and data dependencies in the complex RLHF dataflow, allowing efficient operation orchestration to implement RLHF algorithms and flexible mapping of the computation onto various devices. We further design a 3D-HybridEngine for efficient actor model resharding between training and generation phases, with zero memory redundancy and significantly reduced communication overhead. Our experimental results demonstrate 1.53$\times$~20.57$\times$ throughput improvement when running various RLHF algorithms using HybridFlow, as compared with state-of-the-art baselines. HybridFlow source code will be available at https://github.com/volcengine/verl.

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

↑