This document records the intentional differences between:
- Upstream base: OpenRLHF
openrlhf/at commit
f372a2d41e26c3c47a0f6653fb94c31f5c257942(describe:v0.9.0-3-gf372a2d) - This repo:
openrlhf/
Primary goals of this log:
- auditability: quickly answer “what upstream files changed and why?”
- reproducibility: document integration points that affect behavior
- rebasing: reduce conflict surface when updating upstream
Scope note: upstream OpenRLHF includes many additional CLIs/trainers (SFT/RM/DPO/...) that are intentionally not vendored in this paper code release. This repo focuses on the subset needed for the C3 paper pipeline and PPO/Ray training/eval integration.
Upstream is extended to accept C3 task/role configs (via c3.integration.marl_specs and configs/tasks/*.yaml)
and to propagate task metadata into training/eval.
Primary touchpoint:
openrlhf/cli/train_ppo_ray.py(major extension)
Experience making and training loop are extended to support multi-agent rollout structures used by C3 (e.g., transcript nodes, leaf markers, depth, teammate context).
Primary touchpoints:
openrlhf/trainer/ppo_utils/experience_maker.pyopenrlhf/trainer/ppo_trainer.py(+ async variant)
A small run-metadata utility is added so runs can dump reproducibility metadata (config snapshot, command line, environment hints).
Primary touchpoint:
openrlhf/utils/run_metadata.py(new)
Counts (within openrlhf/):
- Added: 4 files
- Modified: 22 files
- Removed (not vendored): 20 files
These lists are reproducible. See the "How to regenerate this summary" section below.
-
openrlhf/cli/train_ppo_ray_tooling.py
Split-out CLI tooling/helpers used bytrain_ppo_ray.py(argument normalization, ray init, logging helpers). -
openrlhf/trainer/ppo_trainer_plugins.py
Minimal plugin hooks used by the C3 integration to keep upstream modifications localized. -
openrlhf/trainer/ppo_utils/dynamic_filtering.py
Dynamic filtering support extracted/extended for the C3 pipeline. -
openrlhf/utils/run_metadata.py
Reproducibility helpers to initialize/write run artifacts and metadata.
Core integration points (most important):
-
openrlhf/cli/train_ppo_ray.py
Major extension: C3 task loading integration + additional planning/normalization utilities. -
openrlhf/trainer/ppo_trainer.py
C3-compatible experience fields + integration hooks. -
openrlhf/trainer/ppo_utils/experience_maker.py
C3 rollout field propagation (multi-agent structures). -
openrlhf/trainer/ray/ppo_critic.py
Extended critic actor variants used by C3 pipeline.
Complete modified-file list (for audit):
openrlhf/cli/train_ppo_ray.pyopenrlhf/datasets/__init__.pyopenrlhf/datasets/prompts_dataset.pyopenrlhf/models/actor.pyopenrlhf/models/loss.pyopenrlhf/models/model.pyopenrlhf/models/utils.pyopenrlhf/trainer/ppo_trainer.pyopenrlhf/trainer/ppo_trainer_async.pyopenrlhf/trainer/ppo_utils/experience_maker.pyopenrlhf/trainer/ppo_utils/replay_buffer.pyopenrlhf/trainer/ray/launcher.pyopenrlhf/trainer/ray/ppo_actor.pyopenrlhf/trainer/ray/ppo_critic.pyopenrlhf/trainer/ray/vllm_engine.pyopenrlhf/trainer/ray/vllm_engine_async.pyopenrlhf/trainer/ray/vllm_worker_wrap.pyopenrlhf/utils/deepspeed/deepspeed.pyopenrlhf/utils/distributed_sampler.pyopenrlhf/utils/logging_utils.pyopenrlhf/utils/remote_rm_utils.pyopenrlhf/utils/utils.py
The following upstream files exist in OpenRLHF openrlhf/ at the pinned commit but are intentionally
not included in this release to keep the paper codebase focused:
Removed CLIs:
openrlhf/cli/batch_inference.pyopenrlhf/cli/interactive_chat.pyopenrlhf/cli/lora_combiner.pyopenrlhf/cli/serve_rm.pyopenrlhf/cli/train_dpo.pyopenrlhf/cli/train_kd.pyopenrlhf/cli/train_kto.pyopenrlhf/cli/train_prm.pyopenrlhf/cli/train_rm.pyopenrlhf/cli/train_sft.py
Removed datasets:
openrlhf/datasets/process_reward_dataset.pyopenrlhf/datasets/reward_dataset.pyopenrlhf/datasets/sft_dataset.pyopenrlhf/datasets/unpaired_preference_dataset.py
Removed trainers:
openrlhf/trainer/dpo_trainer.pyopenrlhf/trainer/kd_trainer.pyopenrlhf/trainer/kto_trainer.pyopenrlhf/trainer/prm_trainer.pyopenrlhf/trainer/rm_trainer.pyopenrlhf/trainer/sft_trainer.py
This section describes how to reproduce Section B.
If using the provided OpenRLHF.zip:
cd <path-to-OpenRLHF>/OpenRLHF
git checkout f372a2d41e26c3c47a0f6653fb94c31f5c257942From your C3 repo root:
python - <<'PY'
from pathlib import Path
import hashlib
c3 = Path("openrlhf")
up = Path("<path-to-OpenRLHF>/OpenRLHF/openrlhf")
def files(root: Path):
return sorted([p.relative_to(root).as_posix() for p in root.rglob("*") if p.is_file()])
def sha256(p: Path):
h = hashlib.sha256()
with p.open("rb") as f:
for chunk in iter(lambda: f.read(1024 * 1024), b""):
h.update(chunk)
return h.hexdigest()
c3_files = set(files(c3))
up_files = set(files(up))
added = sorted(c3_files - up_files)
removed = sorted(up_files - c3_files)
common = sorted(c3_files & up_files)
modified = []
for rel in common:
if sha256(c3 / rel) != sha256(up / rel):
modified.append(rel)
print("Added:", len(added))
print("Modified:", len(modified))
print("Removed (not vendored):", len(removed))
print("\n# Added")
[print(x) for x in added]
print("\n# Modified")
[print(x) for x in modified]
print("\n# Removed (not vendored)")
[print(x) for x in removed]
PYWhen updating the upstream anchor:
- Update
docs/UPSTREAM.mdwith the new commit (and describe string). - Re-diff
openrlhf/against upstreamopenrlhf/and refresh Section B lists:- Added / Modified / Removed
- Ensure integration touchpoints remain minimal and stable:
cli/train_ppo_ray.pytrainer/ppo_trainer.pytrainer/ppo_utils/experience_maker.pytrainer/ray/ppo_critic.pyutils/run_metadata.py
- Run the release gate:
bash scripts/audit/pre_release.sh