需先按 INSTALL.md 装好依赖,且 rollout 依赖 SGLang 0.5.19 与 vLLM-Omni 0.28 等指定版本;部分模型(如 MiniMax-H3、Boogu-Image、WAN 2.2 V2V)目前仅支持 trainside;运行前需自行准备对应模型权重。
UniRL
Tencent-Hunyuan活跃维护统一多模态模型的强化学习训练框架,打通 SGLang、vLLM 推理后端,方便把多模态大模型跑通 RL 训练流程。
UniRL is a Framework for Unified Multimodal Model Reinforcement Learning
pip 依赖安装见 INSTALL.md;python -m unirl.train_diffusion --config-name=diffusion/sd3/sd3_trainside --cfg job --resolve
bash examples/run_experiment_single_node.sh diffusion/sd3/sd3_trainsideREADME 未说明具体显存要求;异步 AR 与扩散入口需在独立 GPU 分区上重叠 rollout 与训练,多机部署见启动指南。
腾讯混元开源的多模态统一强化学习后训练框架,一套 RL 循环覆盖扩散与自回归模型
统一多模态模型的强化学习训练框架,打通 SGLang、vLLM 推理后端,方便把多模态大模型跑通 RL 训练流程。
核心能力
- 用统一 RL 循环完成采样、打分、算优势、更新策略与权重回传
- 分层可组合架构,rollout 引擎、算法、模型包、奖励服务均可插拔
- 内置团队自研 Flow-DPPO、DRPO、CPPO 算法及可运行示例
- 支持 SFT、agentic 与异步训练,异步模式下 rollout 与训练分卡重叠
- 覆盖 SD3.5、FLUX.2、WAN、HunyuanVideo、BAGEL 等图像视频模型
容易踩的坑
- v0.2.0UniRL v0.2.0最新正式版2026-10-08 · 2026-10-08 08:43 UTC
Highlights
UniRL
v0.2.0is the first release since the initialv0.1.0drop and folds in ~350 merged PRs. It focuses on four themes:- Much broader model coverage: 12 new model packages — Z-Image, Qwen-Image-Edit-2511, Boogu-Image, LTX-2 / LTX-2.3 (text-to-audio+video), WAN 2.2 V2V, MiniMax-H3 (text-to-video+audio), SenseNova-U1.5, Janus-Pro, Qwen3.5, Qwen3-MoE (VeOmni EP), Qwen3-Omni Thinker, and Cosmos3 — plus new modes for BAGEL and HunyuanImage 3.0.
- New training modes: supervised fine-tuning (
train_sft), multi-turn agentic RL (train_agentic), and disaggregated async RL for both AR (train_async_ar) and diffusion (train_async_diffusion). - More algorithms: CPPO, AR DPPO, GSPO, PPO with GAE + value head, DiffusionOPD (on-policy distillation), and a reference-model KL for DiffusionNFT.
- Current rollout stacks & aligned performance components: rebuilt SGLang Diffusion and vLLM-Omni engines, a new direct vLLM TP engine and FastVideo engine, TP/EP weight sync for full weights and LoRA, unified batched-step diffusion replay (
BatchedStepReplayMixin), cross-stage text-embedding deduplication and CPU LRU caching, guarded CUDA MPS reward workers, and fail-closed typed contracts across all layers, all on SGLang 0.5.19 / vLLM-Omni 0.28 / torch 2.13 + CUDA 13.
Models
- Image diffusion: Z-Image with trainside and SGLang Diffusion rollout (#41, #73); Qwen-Image-Edit-2511 with DiffusionNFT and FlowGRPO (#128, #171); Boogu-Image-0.1 (#219); FLUX.2-Klein image-edit conditioning and ti2i rollout (#79, #242); Qwen-Image SGLang / vLLM rollout engines (#34).
- Video diffusion: LTX-2 T2V and LTX-2.3 T2AV with a joint audio+video SDE policy (#91, #115, #233); WAN 2.2 V2V (#113); WAN 2.1 and WAN 2.2-A14B on SGLang Diffusion (#183, #184); MiniMax-H3 T2VA Flow-GRPO (#347, #403, #513); HunyuanVideo 1.5 FlashAttention (#427).
- Unified models: BAGEL-7B-MoT multi-mode RL (it2i / t2t / i2t / it2t / t2ti) and UniGRPO on a single trainside (#62, #100, #148); BAGEL on vLLM-Omni with per-group canvas and sibling run packing (#89, #549, #550); HunyuanImage 3.0 all-modality generation, it2i GRPO, pure-T2I FlowGRPO, VeOmni expert parallelism, stage-pipelined rollout, batched AR recaption, and heterogeneous AR/DiT replica pools (#61, #186, #342, #140, #311, #609); SenseNova-U1.5 pixel flow with OCR recipes (#389, #407).
- AR / omni: Janus-Pro i2t and t2i (#141); Qwen3.5 text + single-image (#174); Qwen3-Omni Thinker on vLLM-Omni with text, video, audio-in-video, standalone audio and standalone image training (#235, #260, #306, #309, #610).
- World model: Cosmos3 omnimodal SFT adapters for video prediction and action BC (#200).
Training Modes & Trainers
- SFT domain covering CE and flow-matching over the shared TrainStack (#209), with agent-conversation, interleaved image-text trajectory, Qwen3-Omni audio, and WAN 2.1 full-transformer SFT (#234, #352, #345, #320).
- Agentic multi-turn rollout and training on
Samplelineages (#214, #315, #363). - Disaggregated async trainers:
AsyncARTrainerandAsyncDiffusionTrainer, with staleness budgeting, temporally consistent version metrics, dynamic prompt dispatch, and rollout refill before scoring (#68, #192, #310, #289, #213, #540). - Semi-independent reward on a dedicated GPU slab (#134); opt-in diffusion role residency (#302, #428).
Algorithms
- CPPO (#58), AR DPPO (#85), GSPO (#178), AR PPO with GAE and a value head (#254, #256, #259).
- DiffusionOPD on-policy distillation with multi-teacher and video-KL support (#232, #432); teacher-anchored capability negotiation in
ARTrainer(#457). - DiffusionNFT under the EMA shadow adapter and with a reference-model KL penalty (#21, #411); Flow-DPPO beta KL (#112); FlowGRPO bounded-memory chunked replay backward (#465); WindowScheduler
decay/exp_decay(#489). - ReFL / DRaFT-K differentiable-reward training, now hosted under
experimental/(#120, #210, #281).
Rollout Engines & Weight Sync
- SGLang Diffusion v2
- v0.1.0UniRL v0.1.02026-10-07 · 2026-10-07 03:47 UTC
查看更新说明
Initial public release of UniRL, a reinforcement learning framework for unified multimodal models. Install with
pip install unirl==0.1.0.What's included
- Training entrypoints: diffusion RL (
train_diffusion), AR RL for LLM / VLM (train_ar), prompt enhancement (train_pe), and unified AR + diffusion RL (train_unified_model). - Algorithms: Flow-DPPO and DRPO (team-proposed), plus GRPO, FlowGRPO, and DiffusionNFT.
- Models: Stable Diffusion 3.5, Qwen-Image, FLUX.2-Klein, WAN 2.1, WAN 2.2, HunyuanVideo 1.0 / 1.5, HunyuanImage 3.0, BAGEL, Qwen3, Qwen2.5-VL, and the Prompt-Enhancer composition.
- Rollout engines: trainside, SGLang (diffusion and LLM), and vLLM-Omni, on a Ray + FSDP runtime with LoRA / full-weight sync.
- Training entrypoints: diffusion RL (
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
A Reinforcement Learning Framework for Unified Multimodal Models
U(you)·ni(need)·RL for unified multimodal intelligence
News 🚀
- [2026-10] UniRL v0.2.0 released — 12 new model packages, SFT / agentic / async training modes, and SGLang 0.5.19 + vLLM-Omni 0.28 rollout stacks (release notes).
- [2026-06] DRPO released — "Rethinking the Divergence Regularization in LLM RL" (arXiv).
- [2026-06] Flow-DPPO released — "FlowDPPO: Divergence Proximal Policy Optimization for Flow Matching Models" (arXiv).
- [2026-06] CPPO released — "Beyond Uniform Token-Level Trust Region in LLM Reinforcement Learning" (arXiv).
About 💡
UniRL applies one RL post-training loop — generate samples, score them, compute advantages, update the policy, and sync weights back to rollout workers — across multimodal model families.
UniRL is a layered, composable system. Each training entrypoint loads a
Hydra example config and creates the matching domain trainer. RL trainers
coordinate generation, scoring, and updates across pluggable
rollout engines, algorithms, model bundles, reward services, and
the shared distributed runtime: Ray DevicePool, FSDP, Transfer
Queue (TQ), and LoRA/full-weight sync. SFT consumes supervised manifests, while
the async AR and diffusion entrypoints overlap rollout with training on separate
GPU slabs. See examples/README.md
for all entrypoints and unirl/README.md for the runtime loop,
deployment modes, and module map.
Team-Proposed Algorithms 🌟
🌟 These algorithms are proposed by our team — the highlight of UniRL. Each algorithm's folder holds a step-by-step tutorial and a runnable example recipe. We highly recommend trying them in our framework!
| Algorithm | Paper | Tutorial | Notes |
|---|---|---|---|
| Flow-DPPO | "Flow-DPPO: Divergence Proximal Policy Optimization for Flow Matching Models" | FlowDPPO/ | Diffusion/flow RL with an exact divergence-based trust-region mask. |
| DRPO | "Rethinking the Divergence Regularization in LLM RL" | DRPO/ | Token-level LLM RL with a smooth advantage-weighted quadratic regularizer. |
| CPPO | "Beyond Uniform Token-Level Trust Region in LLM Reinforcement Learning" | CPPO/ | Token-level LLM RL with a position-weighted, cumulative-prefix-budget Binary-TV mask. |
UniRL also wires in standard reference algorithms — (LLM's)GRPO, DiffusionNFT,
DanceGRPO, and MixGRPO — in unirl/algorithms/.
Model Support 🎨
Model and algorithm support are two independent dimensions that compose within
a domain: any diffusion algorithm (see above) runs on a diffusion
model, AR algorithms on AR models — so UniRL covers many more model × algorithm
combinations than the shipped example recipes alone. The table below is the model
dimension: each row links one runnable recipe. Full matrix — package, every recipe,
rollout engine, and restriction per model — in
unirl/models/README.md.
| Model | Category | Modality | Recipe | Status |
|---|---|---|---|---|
| Stable Diffusion 3.5 | Image diffusion | Text → Image | sd3_trainside | ✅ |
| Qwen-Image | Image diffusion | Text → Image | qwen_image_trainside | ✅ |
| Qwen-Image-Edit-2511 | Image diffusion | Text + Image → Image | qwen_image_edit_plus_nft | ✅ |
| FLUX.2-Klein (4B / 9B) | Image diffusion | Text → Image / Text + Image → Image | flux2_klein_trainside | ✅ |
| Z-Image | Image diffusion | Text → Image | z_image_trainside | ✅ |
| Boogu-Image-0.1 | Image diffusion | Text → Image | boogu_image_trainside | ✅ trainside only |
| WAN 2.1 | Video diffusion | Text / Image → Video | wan21_t2v | ✅ |
| WAN 2.2 (A14B) | Video diffusion | Text / Image → Video | wan22_t2v_14b | ✅ |
| WAN 2.2 V2V | Video diffusion | Video → Video | wan22_v2v_14b | ✅ trainside only |
| HunyuanVideo 1.0 | Video diffusion | Text → Video | hunyuan_video10_t2v_trainside | ✅ |
| HunyuanVideo 1.5 | Video diffusion | Text → Video | hunyuan_video15_t2v_dancegrpo_trainside | ✅ |
| LTX-2 | Video diffusion | Text → Video | ltx2_t2v_trainside | ✅ |
| LTX-2.3 | Video diffusion | Text → Audio + Video | ltx2_3_t2av_trainside | ✅ trainside only |
| MiniMax-H3 | Video diffusion | Text → Video + Audio | minimax_h3_t2va_trainside | ✅ trainside only |
| HunyuanImage 3.0 | Unified AR + diffusion | Text / Text + Image → Image | hi3_trainside_t2i | ✅ |
| BAGEL-7B-MoT | Unified AR + diffusion | Text / Text + Image → Image; Text + Image → Text | bagel_trainside_lora | ✅ |
| SenseNova-U1.5 | Unified MoT pixel flow | Text → Image | sensenova_u1_5_trainside | ✅ trainside only |
| Janus-Pro | Unified AR | Text → Image; Text + Image → Text | janus_pro_grpo_t2i_lora | ✅ trainside only |
| Qwen3 | LLM AR | Text → Text | qwen3_grpo_4b_base_dapo_sglang | ✅ |
| Qwen3-MoE (VeOmni EP) | LLM AR | Text → Text | qwen3_moe_grpo_30b_a3b_veomni_ep_sglang | 🧩 bundle-only |
| Qwen3.5 (9B / 35B-A3B) | VLM AR | Text / Text + Image → Text | qwen3_5_grpo_9b_base_dapo_sglang | ✅ sglang only |
| Qwen2.5-VL | VLM AR | Text + Image → Text | qwen_vl_grpo_geo3k_mc_4x8 | ✅ |
| Qwen3-Omni Thinker | Omni-modality AR | Text / Image / Audio / Video → Text | qwen3_omni_video_r1_gspo_lora_vllm_omni_1x4 | ✅ vllm_omni only |
| Cosmos3-Nano | World model | Video (+ action) prediction | sft/cosmos3_droid100_videopred | 🧪 SFT-only |
| Prompt-Enhancer | LLM + diffusion (composed) | Text → Text → Image | pe_trainside_pickscore | 🔗 composed |
✅ runnable end-to-end with the linked recipe (a qualifier names the only rollout engine that has a recipe) · 🧩 bundle-only (no pipeline of its own; runs under another package's pipeline) · 🧪 SFT-only (no rollout path) · 🔗 composed from other rows. SFT, async, agentic, and scorer-service requirements per model are in the full matrix.
Training Modes 🧩
Each entrypoint has one built-in default, used when --config-name is omitted.
| Training path | Trains | Entrypoint | Built-in default recipe |
|---|---|---|---|
| Diffusion RL | Image / video diffusion models | train_diffusion | diffusion/sd3/sd3_trainside |
| AR RL | Vision-language (VLM) + text-only (LLM) models | train_ar | ar/qwen_vl_grpo_geo3k_mc_4x8 |
| SFT | Supervised text, multimodal, and diffusion models | train_sft | sft/qwen3_sft |
| Prompt enhancement | AR rewriter + diffusion reward | train_pe | pe/pe_trainside_pickscore |
| Unified RL | Unified AR + diffusion models | train_unified_model | unified_model/hi3_vllmomni |
| Agentic RL | Service-scored multi-turn tool use | train_agentic | deep_research/deep_research_search_judge |
| Async AR RL | AR models with separate train / rollout workers | train_async_ar | ar/qwen3_grpo_4b_base_dapo_sglang_async |
| Async diffusion RL | Diffusion models with separate train / rollout workers | train_async_diffusion | diffusion/bagel/bagel_vllmomni_async |
See examples/README.md for the full launch guide, naming
schema, and how to add a recipe.
Agentic Workflows 🤖
train_agentic extends the AR path with multi-turn tool use. Each turn is a
Sample in a lineage; terminal answers are scored by a reward service, and
training waits at a colocated rollout barrier.
AgenticTrainer synchronizes current training weights before every rollout,
dispatches sibling trajectories concurrently, and waits for complete GRPO groups
before scoring and training. Each successful trajectory receives one group-normalized
advantage, which is applied to every generated assistant turn. Failed
trajectories are excluded from the update.
See the agent environment guide for the environment, tool, and trajectory contracts.
Getting Started ⚡
Install dependencies first — see INSTALL.md.
# compose-check, then launch a single-node example
python -m unirl.train_diffusion --config-name=diffusion/sd3/sd3_trainside --cfg job --resolve
bash examples/run_experiment_single_node.sh diffusion/sd3/sd3_trainside
Full launch guide — multi-node, every entrypoint, mooncake.
Roadmap 🗺️
We are actively expanding model and algorithm coverage. Near-term directions:
- Broaden algorithm coverage for the newer model families — FLUX.2-Klein, HunyuanVideo 1.0 / 1.5, and Bagel.
- Extend the team-proposed algorithms (Flow-DPPO, DRPO) to more model families.
- Broaden reward backends and rollout-engine coverage across domains.
Want a model or algorithm prioritized? Open a feature request to discuss.
Contributing 🤝
Contributions and questions are welcome. Before opening a pull request, read the
repository conventions in AGENTS.md, run the
pre-PR checks for the files you
touched, and fill in the pull request template.
Use the issue forms for a
bug report
or
feature request.
WeChat is fine for chat; bugs still belong on GitHub so they stay searchable.
Acknowledgement 🙏
UniRL builds on ideas and infrastructure from the open-source RL and inference ecosystem. We especially thank vLLM, SGLang, slime, and verl.
Citation 📚
If you find UniRL helpful, please cite:
@misc{unirl_github,
title = {{UniRL: A Reinforcement Learning Framework for Unified Multimodal Models}},
author = {Haonan Wang and Linyu Wu and Qian Qiu and Lewei Jin and Bowen Ping and Jianghai Chen and Yiheng Du and Guangxin He and Yu Shi and Yongguang Lin and Zhuoxin Zhou and Zhanchao Zhou and Keming Wu and Rizhen Hu and Xuefei Ning and Lvfang Tao and Feiyu Hu and Xiangyan Liu and Siqi Kou and Jiarui Yao and Xiangxin Zhou and Liefeng Bo and Wenxi Zhu and Tianyu Pang},
year = {2026},
howpublished = {\url{https://github.com/Tencent-Hunyuan/UniRL}},
urldate = {2026-06-05}
}
If you use DRPO, please also cite:
@article{yao2026rethinking,
title={Rethinking the Divergence Regularization in LLM RL},
author={Yao, Jiarui and Zhou, Xiangxin and Qi, Penghui and Lee, Wee Sun and Bo, Liefeng and Pang, Tianyu},
journal={arXiv preprint arXiv:2606.09821},
year={2026}
}
If you use Flow-DPPO, please also cite:
@article{ping2026flow,
title={Flow-DPPO: Divergence Proximal Policy Optimization for Flow Matching Models},
author={Ping, Bowen and Zhou, Xiangxin and Qi, Penghui and Luo, Minnan and Bo, Liefeng and Pang, Tianyu},
journal={arXiv preprint arXiv:2606.11025},
year={2026}
}