Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 7 min read Case study hardMaster

vLLM V0 to V1: Correctness Before Corrections in RL

Migrating PipelineRL's rollout generation from vLLM V0 (0.8.5) to V1 (0.18.1) caused training metrics (clip rate, KL, entropy, reward) to diverge. Matching the V0 reference took four backend fixes: setting logprobs-mode=processed_logprobs so returned logprobs reflect temperature and top-k/top-p processing, explicitly disabling V1's default prefix caching and async scheduling, reproducing V0's inflight weight-update semantics with pause_generation(mode="keep", clear_cache=False), and computing the lm_head in fp32 to match the trainer. Batch invariance and the logprob-mode fix alone did not close the gap. The broader recommendation is to restore inference-backend correctness before adding objective-side off-policy corrections such as truncated importance sampling, so those corrections don't hide backend bugs.

Assumes: policy-gradient RL for LLMs (PPO/GRPO)importance ratios and KL divergenceLLM inference engineslogits sampling (temperature, top-k/top-p)

Related posts

  • Putting RL back in RLHF

    Hugging Face hardMaster

    RLOO (REINFORCE Leave-One-Out) is now available as a trainer in Hugging Face TRL. It is an online RLHF algorithm that drops PPO's value model. It treats the whole completion as a single action, uses the REINFORCE loss, and computes each sample's baseline as the mean reward of the other k−1 completions for the same prompt. That cuts vRAM by roughly 50-70% and makes training 2-3x faster than PPO on Pythia 1B and 6.9B, while matching PPO's GPT-4-judged win rate (78.7% for 6.9B on TL;DR) and beating DPO. Code walkthroughs show the advantage computation and that REINFORCE is a special case of the PPO loss. There is a caveat: bf16 numerical mismatches between generation and training logprobs hurt RLOO more than PPO.

  • PipelineRL

    Hugging Face hardMaster

    PipelineRL resolves the tradeoff between inference throughput and on-policy data in LLM reinforcement learning by doing inflight weight updates: after each optimizer step, trainers broadcast new weights via NCCL to inference servers, which pause only long enough to receive them and then keep generating with existing KV caches. Trained on the Open-Reasoner-Zero dataset at 7B and 32B, it matches or beats Open-Reasoner-Zero on AIME 2024 and MATH 500 using a simplified GRPO with no value function, importance-weight clamping, KL penalty or entropy bonus. The modular design defines HTTP contracts for inference servers (init_process_group, request_weight_update, chat completion) and Python contracts for trainers, so engines like vLLM, SGLang, DeepSpeed or FSDP can be swapped in.

  • Unlocking Agentic RL Training for GPT-OSS: A Practical Retrospective

    Hugging Face hardMaster

    Agentic RL training of GPT-OSS-20B in verl initially failed with exploding gradient norms, KL and entropy, and flat rewards. The LinkedIn team traced this to three problems. First, MoE routing nondeterminism made on-policy PPO importance ratios deviate from 1, fixed by reusing the detached current log-prob as the old log-prob. Second, a training–inference mismatch between SGLang/vLLM and FSDP was partly mitigated with sequence-level rollout correction. Third, and most important, FlashAttention v2 lacks support for GPT-OSS attention sinks, so the team took the forward pass from vLLM's FlashAttention v3 fork and implemented the sink-gradient backward pass, deriving the gradient formula. With the fix, training is stable and rewards improve steadily on GSM8K, verifiable instruction following and multi-turn ReTool tool use; the post also covers FSDP memory blow-ups caused by repeated MoE expert materialization.

  • No GPU left behind: Unlocking Efficiency with Co-located vLLM in TRL

    Hugging Face hardMaster

    TRL v0.18.0 can run vLLM co-located with the training job on the same GPUs. vLLM's external_launcher executor puts it inside the torch.distributed process group, replacing the separate HTTP server that left training and inference GPUs idle in turn during GRPO's frequent generation steps. Benchmarks show up to 1.43× throughput for a 1.5B model with larger batches and up to 1.73× for a 7B model with higher tensor parallelism, though extra TP hurts small models. Qwen2.5-Math-72B trained ~1.26× faster on fewer GPUs with matching rewards and Math500 scores, using vLLM level-2 sleep to free memory and DeepSpeed ZeRO-3 with CPU optimizer offload. The write-up also covers debugging a TP seed-determinism regression, a buffer-restore bug after sleep and a remaining shutdown segfault.

  • Toward RL on mixed-precision, mixed-accelerator samplers

    Modal hardMaster

    RL training of Qwen3.6-35B-A3B on agentic coding stays stable when samplers run on six accelerator types (A100 through B300, RTX PRO 6000) in NVFP4, FP8 and BF16 with their own kernels, feeding a BF16 trainer on B200. Uncorrected GRPO collapses on both mixed and homogeneous samplers. Only score centering plus masked importance sampling (optionally with top-p mask replay) trains to the end, matching homogeneous-sampler SWE-bench Pro V2 pass@4 despite 4.7× larger sampler–trainer KL, at about 15% lower sampling cost per update. The central claim is that stability depends on whether mismatch keeps growing, not on its size, so off-policy correction can stand in for bitwise-identical on-policy matching. Collapse shows up as falling reward, KL growing 3× or more, and episodes ending when the model stops calling its tool.

The quest for software engineering knowledge.

Look:
Layout: