Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

miniVERL — lower verl experiment semantics onto one CUDA GPU

CI Build PyPI Python License

PyPI · Stable docs · Development docs · 中文

miniVERL runs a validated subset of verl experiment semantics on one NVIDIA GPU. Give it a resolved verl-shaped config and Parquet prompts; its versioned compiler produces a reviewable local plan, executes actor/reference/teacher/ reward roles in phases, and publishes portable PEFT and data artifacts.

The current development line covers PPO/GAE, GRPO, Dr.GRPO, RLOO and REINFORCE++ against official verl v0.9.0 (483b8a00). PPO uses an independent trainable critic with its own optimizer and checkpoint state; actor KL, entropy regularization, grouped rollouts, task rewards and a pinned sequence-classifier reward role share the same provenance model. The established verl v0.8.0 OPD profiles remain available for direct GKD and sampled-k1 distillation.

PyPI v0.14.0 is stable; main is development.

Your first local experiment

Install the CUDA-enabled PyTorch build that matches your machine, then:

python -m pip install "miniverl[train]"
miniverl data sample --reward-profile target-length --rows 8 --out data/rl-prompts.parquet
miniverl import-verl --profile verl-rl-v0.9-single-gpu-v3 \
  --example ppo --out local-ppo.yaml
miniverl validate local-ppo.yaml
miniverl train local-ppo.yaml --dry-run

Both PPO and GRPO examples ship in the wheel. The importer writes the original input, compatibility report, native recipe and an upstream-adaptation ledger. Remove --dry-run to run two iterations with the pinned Qwen3-0.6B model. Then inspect, resume and export:

miniverl train local-ppo.yaml --run-id local-ppo
miniverl inspect runs/local-ppo
miniverl train local-ppo.yaml --resume-from runs/local-ppo/checkpoints/step-000002
miniverl export-adapter --run runs/local-ppo --out runs/local-ppo/model
miniverl export-verl --run runs/local-ppo --target-verl v0.9.0 --out ppo-handoff
miniverl bridge doctor ppo-handoff --json

The five-minute workflow explains each artifact and offers the matching GRPO commands. These are small length-reward exercises; their reward is directly inspectable in rewards.jsonl.

[train] supplies the ML stack; [cuda] additionally supplies quantization. Select PyTorch's CUDA build with the PyTorch installer. The single-GPU guide covers memory planning and the maintainer-measured RTX 4080 environment.

What a run gives you

  • A field-by-field compiler report. Experiment fields retain their meaning; physical distribution fields receive an explicit one-GPU lowering.
  • Policy-bound trajectories. Group/sample identity, generated-token spans, behavior log-probabilities and policy version travel together.
  • Auditable rewards and objectives. Reward components, group advantages, reference KL, clipping, entropy and update metrics are structured data.
  • Exact recovery. Transactional manifests and checkpoints restore policy, optimizer, cursor, RNG and reward identities before another rollout.
  • Portable outputs. PEFT adapters, safetensors, Parquet, resolved config and typed provenance can move into a larger workflow.

How it works

A resolved verl config compiles into a validated single-GPU plan; actor, critic, reference, teacher and reward roles run in phases and produce portable artifacts plus a readiness report.

One GPU is treated as a temporal scheduler for logical roles. RL generates complete prompt groups, scores outcomes, evaluates optional reference and reward-model roles, computes the pinned advantage estimator, and updates the actor. PPO adds a separate critic phase with clipped value updates. OPD uses the same trajectory and checkpoint foundations, with teacher targets supplying the learning signal.

Choose your path

GoalFirst commandPrimary artifactNext step
Run local RLminiverl import-verl --profile verl-rl-v0.9-single-gpu-v3 --example grpo --out local.yamlnative recipe + compatibility reportRL quickstart
Run local OPDminiverl plan --profile verl-opd-v0.8-single-gpu-v1 --config verl-opd.yaml --out plan.jsonimmutable execution planOPD quickstart
Fit your GPUminiverl plan --config verl-opd.yaml --probemeasured placement planHardware planning
Hand off artifactsminiverl export-verl --run runs/my-run --target-verl v0.9.0 --out scaleoutactor, critic, Parquet + config bundleCompatibility contract

Native recipes also support SFT, DPO and offline KD, plus calculator, JSON navigation, read-only SQLite and custom tool environments.

Current capability matrix

Experiment surfaceLocal statusContract
PPO / GAEsemantically conformantindependent critic, clipped value loss, actor/critic exact resume
GRPO / Dr.GRPOsemantically conformantverl v0.9 group statistics and vanilla clipped policy loss
RLOO / REINFORCE++semantically conformantverl v0.9 advantage and masking rules
Grouped n > 1 rolloutssupportedcomplete groups, stable sample seeds and behavior-policy identity
Task rewards and trained RMsupportedbuilt-ins, environment verifier, trusted Python API, or pinned HF sequence classifier
Actor KL and entropysemantically conformantsampled-token reference KL and entropy regularization
Direct GKD / sampled-k1 OPDsupportedpinned verl v0.8 profiles with teacher targets
Ray, FSDP/FSDP2, Megatron, TP/PP/DP > 1distributed-onlythese change physical scale, not the local objective

The upstream compatibility corpus resolves real verl examples and records every field's outcome. The v3 profile preserves prompt-based minibatch units; v1/v2 remain available for existing recipes.

Measured systems evidence

The published Qwen3-0.6B/1.7B OPD workload consumed 32 distinct prompts and completed eight current-policy updates at 3.1914 GiB peak reserved VRAM on an RTX 4080. A matched interruption after update four reproduced byte-identical trajectories, adapter and optimizer tensors. The SmolLM2-360M/1.7B workload completed the same shape at 1.4961 GiB. System records contain configs, hashes and phase timings.

Rollout Runtime v2 measured hf_cached and managed vLLM across 24 RTX 4080 cells spanning response length, sampling mode and n=1/4. See the runtime report. Evidence for the new RL family is published through the exact-wheel release qualification rather than presented as a task-quality comparison.

Research record

The scientific reports preserve their original outcomes and frozen inputs: calculator protocol, RecoveryBench, Alignment Lab, and the External Alignment Gate. They are scoped studies, separate from runtime qualification.

Compatibility boundary

miniVERL targets one local process and one NVIDIA CUDA GPU. The compiler distinguishes exact or conformant semantics, local physical lowering, distributed-only settings, feasible work not yet implemented, and technically unsupported inputs. The compatibility policy is the complete matrix; limitations collects architecture, measurement, security and generalization boundaries in one place. miniVERL is an independent Apache-2.0 project.

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"

See CONTRIBUTING.md, CHANGELOG.md, CITATION.cff, the guide for verl users, SECURITY.md and the Apache-2.0 license.

关于 About

Run a documented subset of verl-style OPD on one consumer GPU—typed config, Parquet prompts, and PEFT scale-out artifacts.
agentic-rlalignmentconsumer-gpuknowledge-distillationllmllm-agentsllm-alignmenton-policy-distillationpeftpost-trainingqloraqwensingle-gputool-useverl

语言 Languages

Python99.6%
Jinja0.3%
PowerShell0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
183
Total Commits
峰值: 69次/周
Less
More

核心贡献者 Contributors