通过自适应张量并行加速同步RLHF训练中的长尾生成
Accelerating Long-Tail Generation in Synchronous RLHF Training via Adaptive Tensor Parallelism
AI总结:
针对同步RLHF训练中长尾生成导致的GPU利用率低问题,提出自适应张量并行方法PAT,通过预测引导的在线重配置和轻量级状态迁移机制,显著降低生成延迟和端到端训练迭代延迟。
摘要:
基于人类反馈的强化学习(RLHF)已成为提升模型质量的关键后训练范式。然而,同步三阶段RLHF流水线常受限于生成阶段,其中响应长度偏斜导致解码过程中有效批量大小迅速缩小,使得GPU在少数长响应未完成时处于低利用率状态。主流框架采用静态张量并行(TP)配置,无法适应变化的批量特征,留下了大量性能提升空间。我们提出PAT,一种自适应TP方法,在每次RLHF迭代的生成阶段动态重配置TP。PAT引入两项关键技术。首先,一种预测引导的在线重配置方法基于离线性能分析决定重配置时机和目标TP配置,仅在预测延迟收益超过重配置开销时触发重配置。其次,一种轻量级在线重配置机制仅更新受TP变化影响的状态和布局:通过基于成本模型在KV缓存迁移和重计算之间选择,适配未完成的解码状态;执行原地权重重分片;并重用缓存的通信组。我们在SGLang之上实现PAT,并将其集成到VeRL框架中。使用DeepScaleR对LLaMA3.1-8B和Qwen3-14B的评估表明,与原始VeRL设置相比,PAT将生成延迟降低高达34.6%,端到端RLHF训练迭代延迟降低高达27.2%。
英文摘要:
Reinforcement Learning from Human Feedback (RLHF) has become a key post-training paradigm for improving model quality. However, the synchronous three-stage RLHF pipeline is often bottlenecked by the generation stage, where response-length skew causes the effective batch size to shrink rapidly during decoding, leaving GPUs underutilized while a few long responses remain unfinished. Mainstream frameworks employ a static tensor parallelism (TP) configuration that cannot adapt to changing batch characteristics, leaving substantial performance headroom unexplored. We propose PAT, an adaptive TP method that dynamically reconfigures TP during the generation stage of each RLHF iteration. PAT introduces two key techniques. First, a predictor-guided online reconfiguration method decides both the reconfiguration point and the target TP configuration based on offline profiling, triggering reconfiguration only when the predicted latency benefit outweighs the reconfiguration overhead. Second, a lightweight online reconfiguration mechanism updates only the states and layouts affected by TP changes: it adapts unfinished decoding states through a cost-model-based choice between KV-cache migration and recomputation, performs in-place weight resharding, and reuses cached communication groups. We implement PAT on top of SGLang and integrate it with the VeRL framework. Evaluations on LLaMA3.1-8B and Qwen3-14B using DeepScaleR show that PAT reduces generation latency by up to 34.6% and end-to-end RLHF training iteration latency by up to 27.2% compared to the original VeRL setup.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。