davila7/claude-code-templates

post-training-openrlhf

High-performance RLHF framework with Ray+vLLM acceleration.

  • SKILL.md 已保存
  • 英文来源资料
  • 安装与运行未实测
先判断是否解决你的问题

post-training-openrlhf 是什么?

High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.

以上为来源原文,中文用途说明尚待整理。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 post-training-openrlhf,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 post-training-openrlhf

请在 Codex 的当前工作环境中安装并检查 post-training-openrlhf 这个 Skill。

项目身份:davila7/claude-code-templates / post-training-openrlhf
来源:https://github.com/davila7/claude-code-templates/blob/c1bc5c1df4ff0bffb9a04d8f7790543681232423/cli-tool/components/skills/ai-research/post-training-openrlhf/SKILL.md
已定位的源文件:cli-tool/components/skills/ai-research/post-training-openrlhf/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-23T04:29:48.865Z
中文使用说明
尚待整理,保留英文来源内容
安装与任务测试
本站未执行安装或任务测试
来源复核
已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料

cli-tool/components/skills/ai-research/post-training-openrlhf/SKILL.md · 抓取时间 2026-11-23T04:29:48.865Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.

查看源文件章节 / Source sections
  • 原文:OpenRLHF - High-Performance RLHF Training
  • 快速开始 / Quick start
  • 原文:Common workflows
  • 原文:Workflow 1: Full RLHF pipeline (SFT → Reward Model → PPO)
  • 原文:Workflow 2: GRPO training (no critic model needed)
  • 原文:Workflow 3: DPO training (preference optimization)
  • 原文:When to use vs alternatives
  • 原文:Common issues
  • 原文:Advanced topics
  • 原文:Hardware requirements
  • 原文:Resources
快速开始 / Quick start

OpenRLHF is a Ray-based RLHF framework optimized for distributed training with vLLM inference acceleration. **Installation**: ```bash # Launch Docker container docker run --runtime=nvidia -it --rm --shm-size="10g" --cap-add=SYS_ADMIN \ -v $PWD:/openrlhf nvcr.io/nvidia/pytorch:25.02-py3 bash # Uninstall conflicts sudo pip uninstall xgboost transformer_engine flash_attn pynvml -y # Install OpenRLHF with vLLM pip install openrlhf[vllm] ``` **PPO Training** (Hybrid Engine): ```bash ray start --head --node-ip-address 0.0.0.0 --num-gpus 8 ray job submit --address="http://127.0.0.1:8265" \ --runtime-env-json='{"working_dir": "/openrlhf"}' \ -- python3 -m openrlhf.cli.train_ppo_ray \ --ref_num_nodes 1 --ref_num_gpus_per_node 8 \ --reward_num_nodes 1 --reward_num_gpus_per_node 8 \ --critic_num_nodes 1 --critic_num_gpus_per_node 8 \ --actor_num_nodes 1 --actor_num_gpus_per_node 8 \ --vllm_num_engines 4 --vllm_tensor_parallel_size 2 \ --colocate_all_models \ --vllm_gpu_memory_utilization 0.5 \ --pretrain OpenRLHF/Llama-3-8b-sft-mixture \ --reward_pretrain OpenRLHF/Llama-3-8b-rm-700k \ --save_path ./output/llama3-8b-rlhf \ --micro_train_batch_size 8 --train_batch_size 128 \ --micro_rollout_batch_size 16 --rollout_batch_size 1024 \ --max_epochs 1 --prompt_max_len 1024 --generate_max_len 1024 \ --zero_stage 3 --bf16 \ --actor_learning_rate 5e-7 --critic_learning_rate 9e-6 \ --init_kl_coef 0.01 --normalize_reward \ --gradient_checkpointing --packing_samples \ --vllm_enable_sleep --deepspeed_enable_sleep ``` **GRPO Training** (Group Normalized Policy Optimization): ```bash # Same command as PPO, but add: --advantage_estimator group_norm ```

原文:Workflow 1: Full RLHF pipeline (SFT → Reward Model → PPO)

**Step 1: Train reward model** (DPO): ```bash deepspeed --module openrlhf.cli.train_rm \ --save_path ./output/llama3-8b-rm \ --save_steps -1 --logging_steps 1 \ --eval_steps -1 --train_batch_size 256 \ --micro_train_batch_size 1 --pretrain meta-llama/Meta-Llama-3-8B \ --bf16 --max_epochs 1 --max_len 8192 \ --zero_stage 3 --learning_rate 9e-6 \ --dataset OpenRLHF/preference_dataset_mixture2_and_safe_pku \ --apply_chat_template --chosen_key chosen \ --rejected_key rejected --flash_attn --gradient_checkpointing ``` **Step 2: PPO training**: ```bash ray start --head --node-ip-address 0.0.0.0 --num-gpus 8 ray job submit --address="http://127.0.0.1:8265" \ -- python3 -m openrlhf.cli.train_ppo_ray \ --ref_num_nodes 1 --ref_num_gpus_per_node 8 \ --reward_num_nodes 1 --reward_num_gpus_per_node 8 \ --critic_num_nodes 1 --critic_num_gpus_per_node 8 \ --actor_num_nodes 1 --actor_num_gpus_per_node 8 \ --vllm_num_engines 4 --vllm_tensor_parallel_size 2 \ --colocate_all_models \ --pretrain OpenRLHF/Llama-3-8b-sft-mixture \ --reward_pretrain ./output/llama3-8b-rm \ --save_path ./output/llama3-8b-ppo \ --micro_train_batch_size 8 --train_batch_size 128 \ --micro_rollout_batch_size 16 --rollout_batch_size 1024 \ --max_epochs 1 --prompt_max_len 1024 --generate_max_len 1024 \ --zero_stage 3 --bf16 \ --actor_learning_rate 5e-7 --critic_learning_rate 9e-6 \ --init_kl_coef 0.01 --normalize_reward \ --vllm_enable_sleep --deepspeed_enable_sleep ```

原文:Workflow 2: GRPO training (no critic model needed)

Memory-efficient alternative to PPO: ```bash ray job submit --address="http://127.0.0.1:8265" \ -- python3 -m openrlhf.cli.train_ppo_ray \ --advantage_estimator group_norm \ --ref_num_nodes 1 --ref_num_gpus_per_node 8 \ --reward_num_nodes 1 --reward_num_gpus_per_node 8 \ --actor_num_nodes 1 --actor_num_gpus_per_node 8 \ --vllm_num_engines 4 --vllm_tensor_parallel_size 2 \ --colocate_all_models \ --pretrain OpenRLHF/Llama-3-8b-sft-mixture \ --reward_pretrain OpenRLHF/Llama-3-8b-rm-700k \ --save_path ./output/llama3-8b-grpo \ --micro_train_batch_size 8 --train_batch_size 128 \ --micro_rollout_batch_size 16 --rollout_batch_size 1024 \ --max_epochs 1 --bf16 \ --actor_learning_rate 5e-7 \ --init_kl_coef 0.01 --use_kl_loss --kl_estimator k3 \ --normalize_reward --no_advantage_std_norm ``` **Key GRPO parameters**: - `--advantage_estimator group_norm` - Enables GRPO - `--use_kl_loss` - KL loss from GRPO paper - `--kl_estimator k3` - Loss function (k2 ≈ k1) - `--no_advantage_std_norm` - Disables std normalization

原文:Workflow 3: DPO training (preference optimization)

Simpler alternative without reward model: ```bash deepspeed --module openrlhf.cli.train_dpo \ --save_path ./output/llama3-8b-dpo \ --save_steps -1 --logging_steps 1 \ --eval_steps -1 --train_batch_size 256 \ --micro_train_batch_size 2 --pretrain meta-llama/Meta-Llama-3-8B \ --bf16 --max_epochs 1 --max_len 8192 \ --zero_stage 3 --learning_rate 5e-7 --beta 0.1 \ --dataset OpenRLHF/preference_dataset_mixture2_and_safe_pku \ --apply_chat_template --chosen_key chosen \ --rejected_key rejected --flash_attn --gradient_checkpointing ```

原文:When to use vs alternatives

**Use OpenRLHF when**: - Training large models (7B-70B+) with RL - Need vLLM inference acceleration - Want distributed architecture with Ray - Have multi-node GPU cluster - Need PPO/GRPO/RLOO/DPO in one framework **Algorithm selection**: - **PPO**: Maximum control, best for complex rewards - **GRPO**: Memory-efficient, no critic needed - **RLOO**: Modified PPO with per-token KL - **REINFORCE++**: More stable than GRPO, faster than PPO - **DPO**: Simplest, no reward model needed **Use alternatives instead**: - **TRL**: Single-node training, simpler API - **veRL**: ByteDance's framework for 671B models - **DeepSpeedChat**: Integrated with DeepSpeed ecosystem

原文:Common issues

**Issue: GPU OOM with large models** Disable model colocation: ```bash # Remove --colocate_all_models flag # Allocate separate GPUs for each model --actor_num_gpus_per_node 8 \ --critic_num_gpus_per_node 8 \ --reward_num_gpus_per_node 8 \ --ref_num_gpus_per_node 8 ``` **Issue: DeepSpeed GPU index out of range** Set environment variable: ```bash export RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES=1 ``` **Issue: Training instability** Use Hybrid Engine instead of async: ```bash --colocate_all_models \ --vllm_enable_sleep \ --deepspeed_enable_sleep ``` Adjust KL coefficient: ```bash --init_kl_coef 0.05 # Increase from 0.01 ``` **Issue: Slow generation during PPO** Enable vLLM acceleration: ```bash --vllm_num_engines 4 \ --vllm_tensor_parallel_size 2 \ --vllm_gpu_memory_utilization 0.5 ```

文件 SHA256:bee857184f3d922557f8b09887d05382db9f2beb813722ac0fc71eb1df34d96d

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-23T04:29:48.865Z

High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.

查看历史简介来源

历史收录数据

来源仓库davila7/claude-code-templates
Skill源路径cli-tool/components/skills/ai-research/post-training-openrlhf/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源