mini-verl

DaoyuanLi2816Apache-2.0活跃维护

在单张消费级显卡上跑 PPO、GRPO 和同策略蒸馏的轻量 RL 训练框架,让普通玩家也能做 LLM 对齐后训练。

verl for a single consumer GPU. PPO, GRPO and on-policy distillation on NVIDIA GPUs.

v0.16.0发布于 2026-09-12 07:30 UTC309star74fork同步于 2026-11-07 07:29 UTC

怎么上手

由 README 提炼,执行前请确认
python -m pip install "miniverl[train,hydra]"
miniverl run --example hydra-ppo --bind reward.provider=target_length --run-id local-ppo
硬件要求按 README 说明

单张 NVIDIA 消费级 GPU,README 以 RTX 4080 实测:Qwen3-0.6B/1.7B 在线蒸馏峰值显存 3.1914 GiB,SmolLM2-360M/1.7B 为 1.4961 GiB;模型能否装下取决于显存与负载。

支持 Apple Silicon需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在单张消费级 NVIDIA GPU 上跑 PPO、GRPO 和在线蒸馏的 verl 精简版

在单张消费级显卡上跑 PPO、GRPO 和同策略蒸馏的轻量 RL 训练框架,让普通玩家也能做 LLM 对齐后训练。

核心能力

  • 复用 verl 配置字段与 Hydra overrides 映射到本地执行
  • Actor、critic、reference、reward、teacher 分阶段共享同一张 GPU
  • 从 checkpoint 精确恢复模型、优化器、数据位置与随机状态
  • 导出 PEFT adapter、Parquet 数据集及运行配置与源码标识
  • 支持 PPO、GRPO、在线蒸馏,另有 SFT、DPO、离线 KD 原生配方

容易踩的坑

需先按 PyTorch 官网安装匹配的 CUDA 版 PyTorch,再装 miniverl;训练、Hydra、量化依赖需通过 extras 单独安装;示例默认用 Qwen3-0.6B,需自行准备模型权重。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.16.0
  1. v0.16.0miniVERL v0.16.0最新正式版2026-09-12 · 2026-09-12 07:30 UTC

    What's Changed

    Full Changelog: https://github.com/DaoyuanLi2816/mini-verl/compare/v0.15.0...v0.16.0

  2. v0.15.0miniVERL v0.15.02026-09-10 · 2026-09-10 07:16 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/DaoyuanLi2816/mini-verl/compare/v0.14.0...v0.15.0

  3. v0.14.0miniVERL v0.14.02026-09-09 · 2026-09-09 08:34 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/DaoyuanLi2816/mini-verl/compare/v0.13.0...v0.14.0

  4. v0.13.0miniVERL v0.13.02026-09-08 · 2026-09-08 13:28 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/DaoyuanLi2816/mini-verl/compare/v0.12.0...v0.13.0

  5. v0.12.0miniVERL v0.12.02026-09-08 · 2026-09-08 07:27 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/DaoyuanLi2816/mini-verl/compare/v0.11.0...v0.12.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    CI Build PyPI Python License

    verl for a single consumer GPU.

    Run PPO, GRPO and on-policy distillation on one NVIDIA GPU. Bring your verl configs, train locally, pick up interrupted runs and export your models.

    PyPI v0.16.0 is stable; main is development.

    Your first local experiment

    Install the matching CUDA-enabled build using the PyTorch installer, then:

    python -m pip install "miniverl[train,hydra]"
    miniverl data sample --reward-profile target-length --rows 8 --out data/rl-prompts.parquet
    miniverl run --example hydra-ppo --bind reward.provider=target_length --dry-run
    miniverl run --example hydra-ppo --bind reward.provider=target_length --run-id local-ppo
    

    This Qwen3-0.6B example trains with a simple length reward. Inspect it in rewards.jsonl, or follow the five-minute workflow to use GRPO, resume training and export an adapter.

    Already have a verl experiment? Bring its config tree and Hydra overrides:

    miniverl run --verl-config-path /path/to/verl/trainer/config \
      --verl-config-name ppo_trainer --dry-run \
      algorithm.adv_estimator=grpo actor_rollout_ref.rollout.n=8 trainer.n_gpus_per_node=8
    

    The direct-config guide walks through binding your data and reward function. The single-GPU guide helps you choose a model and memory settings. Install extras add training, Hydra or quantization dependencies; choose the CUDA PyTorch build separately.

    Choose your path

    You want to…Start hereTake away
    Train with rewardsPPO / GRPO walkthroughA trained adapter, reward logs and resumable checkpoints
    Distill a teacherOPD quickstartA student trained on its own rollouts with teacher feedback
    Move to a larger setupExport and hand offPEFT, Parquet and config files, plus a report of remaining setup

    SFT, DPO and offline KD are also available through native recipes. Hardware planning helps fit a workload to your GPU.

    What a run gives you

    • Familiar configs. Reuse verl fields and overrides; inspect how each maps to local execution.
    • Visible training. Follow rollouts, rewards, losses and teacher targets.
    • Exact recovery. Resume model, optimizer, data position and random state from a checkpoint.
    • Reusable outputs. Export adapters, datasets and the configuration and source identities behind the run.

    How it works

    Actor, critic, reference, reward and teacher roles share the GPU in phases. PPO trains an actor and a separate critic; GRPO uses grouped rewards; OPD learns from teacher targets on the student's current rollouts.

    Measured results

    On an RTX 4080, the Qwen3-0.6B/1.7B OPD workload completed eight updates over 32 distinct prompts at 3.1914 GiB peak reserved VRAM. An interruption after update four reproduced byte-identical trajectories, adapter and optimizer tensors on resume. The SmolLM2-360M/1.7B workload used 1.4961 GiB. Workload and measurements · 24-cell rollout-backend study.

    For task outcomes, read the calculator study, RecoveryBench, Alignment Lab and External Alignment Gate. These include negative and mixed results, with their original data and scope.

    About and compatibility

    miniVERL is an independent Apache-2.0 project for single-GPU NVIDIA CUDA training. It supports documented verl configuration profiles; model fit depends on GPU memory and workload. See the compatibility matrix for supported upstream versions and semantics, and limitations for hardware coverage, scientific scope and the distributed-execution boundary.

    Development

    git clone https://github.com/DaoyuanLi2816/mini-verl.git
    cd mini-verl
    python -m pip install -e ".[dev,train]"
    pytest -q -m "not gpu and not network"
    

    Contributing · Changelog · Citation · Security · License