> ## Documentation Index
> Fetch the complete documentation index at: https://starforge.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 用 OpenRLHF 训练

> 自建镜像、DeepSpeed + vLLM colocate、GRPO 和 REINFORCE++-baseline

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf new my-ppo --method openrlhf/ppo
sf submit my-ppo --profile h200:8
```

OpenRLHF **0.11.0** 作为一等框架。方法有：`openrlhf/sft`、`dpo`、`rm`、`grpo`、`ppo`、
`reinforce-baseline`。配置走 CLI flag，不是 Hydra。

<Warning>
  上游的 Dockerfile 装了依赖栈但**没有**装 `openrlhf` 包，也没有发布可直接用的训练镜像。
  管理员必须先设 `FORGE_IMAGE_OPENRLHF`，或者登记 `openrlhf-0.11.0` 这个 runtime id，提交才能工作。

  Ray 版本由那个镜像固定——上游 0.11.0 用的是 `ray==2.55.0`。不要把 TRL 或 verl 的版本抄过来；
  不一致的症状是「集群起来了但 worker 注册不上」。
</Warning>

## 创建和提交

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
sf new my-orlh --method openrlhf/grpo
sf submit my-orlh --profile h200:8 \
  --model Qwen/Qwen3.5-9B \
  --train-data data/prompts.jsonl
```

绑定（recipe）：

| 字段   | 旗标                         |
| ---- | -------------------------- |
| 模型   | `actor.model_name_or_path` |
| 训练数据 | `data.prompt_dataset`      |
| 验证   | `eval.dataset`             |

GRPO 会设 `algo.advantage.estimator=group_norm`、`train.colocate_all=true`，以及 vLLM/DeepSpeed sleep。所有 role 共卡（colocate hybrid engine）。拓扑会展开成各 role 的 `num_nodes` / `num_gpus_per_node`。

recipe 里的 `no_std_norm` 是 Dr.GRPO 口径。

`openrlhf/reinforce-baseline` 是 REINFORCE++-baseline（全局 batch 归一化 + 组均值）。其它框架没有这个估计器。

## 镜像冒烟

运维：`./deploy/docker/build-runtimes.sh openrlhf` 和 `scripts/image_smoke.py`。用户只需要部署侧已经发布过镜像。
