Archive of AI

Source Snapshot / 2024-09-28-bytedance-verl-hybridflow-4

verl Documentation

Linked event: 2024-09-28 · HybridFlow and verl Open-Sourced, Evolving into Foundational Post-Training Infrastructure for Open Reasoning Models

Publisher
verl Project
Archived
2026-11-23
Capture Method
Direct page capture
HTTP / SHA-256
200 / 32533d8fb668948e
Original URL
Open source ↗
Wayback Backup
Not archived
This page preserves a plain-text static snapshot against link rot. When citing figures, tables, or full legal terms, verify against the original URL and Wayback Machine archive.

Welcome to verl’s documentation!

View page source

Welcome to verl’s documentation!

verl is a flexible, efficient and production-ready RL training framework designed for large language models (LLMs) post-training. It is an open source implementation of the HybridFlow paper.

verl is flexible and easy to use with:

Easy extension of diverse RL algorithms: The hybrid programming model combines the strengths of single-controller and multi-controller paradigms to enable flexible representation and efficient execution of complex Post-Training dataflows. Allowing users to build RL dataflows in a few lines of code.

Seamless integration of existing LLM infra with modular APIs: Decouples computation and data dependencies, enabling seamless integration with existing LLM frameworks, such as PyTorch FSDP, Megatron-LM, vLLM and SGLang. Moreover, users can easily extend to other LLM training and inference frameworks.

Flexible device mapping and parallelism: Supports various placement of models onto different sets of GPUs for efficient resource utilization and scalability across different cluster sizes.

Ready integration with popular HuggingFace models

verl is fast with:

State-of-the-art throughput: By seamlessly integrating existing SOTA LLM training and inference frameworks, verl achieves high generation and training throughput.

Efficient actor model resharding with 3D-HybridEngine: Eliminates memory redundancy and significantly reduces communication overhead during transitions between training and generation phases.

Installation

Requirements

Choices of Backend Engines

Install with uv

Install with uv in a custom environment

Managing environments explicitly

uv troubleshooting

Install from docker image

Install with AMD GPUs - ROCM kernel support

Quickstart: PPO training on GSM8K dataset

Introduction

Dataset Introduction

Step 1: Prepare the dataset

Step 2: Download a model for post-training

Step 3: Perform PPO training with the instruct model

Multinode Training

Option 1: Launch Manually

Option 2: Launch via SkyPilot on Kubernetes or clouds

Option 3: Launch via Slurm

Option 4: Launch via dstack

How to debug?

Multi-node training on AMD clusters

Ray Debug Tutorial

More Resources

Agentic RL Training

Server-based Asynchronous Rollout

Multi-turn Conversations and Tool Calls

Agent Framework

Programming guide

How to Extend verl

RL Researcher

Agent Framework Developer

Training/Inference Framework Developer

HybridFlow Programming Guide

Motivation and Design

Codebase walkthrough (PPO)

Repository organization

The Design of verl.single_controller

A Running Example: generate_sequences

Beyond RL Post-Training: Generalizing verl.single_controller

Data Preparation

Prepare Data for Post-Training

Implement Reward Function for Dataset

Configurations

Config Explanation

ppo_trainer.yaml for RL FSDP Backend

evaluation.yaml

sft_trainer.yaml for SFT FSDP Backend

PPO Code Architecture

GSM8K Example

Megatron-FSDP Example

Multi-Modal Example Architecture

SkyPilot Examples

Proximal Policy Optimization (PPO)

Group Relative Policy Optimization (GRPO)

Recipe: Decoupled Clip and Dynamic Sampling Policy Optimization (DAPO)

Recipe: Self-Play Fine-Tuning (SPIN)

Recipe: Self-Play Preference Optimization (SPPO)

Recipe: Entropy Mechanism

On-Policy RL with Optimal Reward Baseline (OPO)

Algorithm Baselines

GPG: Group Policy Gradient

Rollout Correction

Mathematical Formulations of Rollout Correction Methods in verl

Optimal Token Baseline (OTB)

Divergence Proximal Policy Optimization (DPPO)

On-Policy Distillation (OPD)

Direct Reward Optimization

PPO Trainer and Workers

Model Engine

Engine Workers

Automodel Backend

TorchTitan Backend

SGLang Backend

TensorRT-LLM Backend

Performance Tuning Guide

Training DeepSeek 671b

Dynamic Context Parallelism

Verl LLM Best Practices (DAPO + Qwen3-235B)

Rollout KV Cache Offload via Mooncake-Store

Upgrading to vLLM >= 0.8

Hardware Resource Needed for RL

verl Profiler System

NVIDIA Nsight Systems profiling in verl

PyTorch Profiling in verl

Adding new models

Add models with the FSDP backend

Add models with the Megatron-LM backend

Adding DeepSeek V4 support

Experimental Megatron Agent Compose preview

Async Training

One-step-off training

Delta Weight Sync

V1 Async Trainer

Fully asynchronous training

Recipe: Async On-Policy Knowledge Distillation Trainer

Dynamic resource scheduling

Low Precision

FP8 RL in verl

MXFP8 RL on Blackwell

MXFP4 MoE QAT on Blackwell

NVFP4 RL on Blackwell

Low-Precision Rollout and Quantization-Aware Training

Advanced Features

Using Checkpoints to Support Fault Tolerance Training

RoPE Scaling override

Attention Implementation Override

RL(HF) algorithms with LoRA Support

Multi-turn Rollout Support

Ray API Design Tutorial

Extend to other RL(HF) algorithms

Sandbox Fusion Example

Trace Function Usage Instructions

Use RL-Insight to Monitor Training

SkipManager: Cache and Replay Rollouts

TransferQueue Data System

Use Prometheus and Grafana to Monitor Rollout

Guide to Using MTP in SFT/RL Training and Inference

Full Determinism for Reproducible RL Training

FSDP-Turbo backend

Hardware Support

Multi-Chip Support

AMD (ROCm) Tutorial

Ascend (NPU) Tutorial

API References

Data interface

Single Controller interface

Trainer Interface

verl 0.7 release blog

Frequently Asked Questions

Distributed training

Install related

Illegal memory access

Triton compile_module_from_src error

What is the meaning of train batch size, mini batch size, and micro batch size?

How to generate ray timeline to analyse performance of a training job?

How to set proxy only for wandb?

Missmatch between inference and training sequence (high actor/grad_norm)

Contributing

Editing Agent Instructions

Development Notes

Sandbox Fusion Tool Integration

Contribution

verl is free software; you can redistribute it and/or modify it under the terms

of the Apache License 2.0. We welcome contributions.

Join us on GitHub, Slack and Wechat for discussions.

Contributions from the community are welcome! Please check out our project roadmap and good first issues to see where you can contribute.

Code Linting and Formatting

We use pre-commit to help improve code quality. To initialize pre-commit, run:

pip install pre-commit

pre-commit install

To resolve CI errors locally, you can also manually run pre-commit by:

pre-commit run

Adding CI tests

If possible, please add CI test(s) for your new feature:

Find the most relevant workflow yml file, which usually corresponds to a hydra default config (e.g. ppo_trainer, ppo_megatron_trainer, sft_trainer, etc).

Add related path patterns to the paths section if not already included.

Minimize the workload of the test script(s) (see existing scripts for examples).

We are HIRING! Send us an email if you are interested in internship/FTE opportunities in MLSys/LLM reasoning/multimodal alignment.