diff --git a/AGENTS.md b/AGENTS.md index 55ee7d4e..6617a2df 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,6 +35,10 @@ Namespaces are one honking great idea -- let's do more of those! - **Git dependency pins**: when pinning git dependencies in `pyproject.toml`, always use a small (7-char) commit hash for the `rev` field. - **Never edit `.venv/`**: the local virtual env is read-only. Edits there are silently overwritten by the next `uv sync` and don't propagate to teammates or CI. Reading files under `.venv/` to understand library behavior is fine; writing is not. To fix a dependency issue, update `pyproject.toml` (pin a fork via 7-char commit hash if needed), vendor the code into `src/`, or patch upstream. +## Docs + +- **Docs reflect `main`, not history**: `docs/` describes the current state of the codebase only. Don't mention removed/legacy fields, migration paths, or "this used to be X" anecdotes. + ## Skills Skills live in `skills/` and are symlinked to `.claude/skills/`. They teach agents how to handle specific workflows (e.g. starting the inference server, writing configs). When you make changes to the codebase, check if any skills need to be updated to stay accurate. diff --git a/CHANGELOG.md b/CHANGELOG.md index f1721b70..c77d682a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Documenting **breaking** configuration changes — renamed, removed, or moved fields that require users to update existing configs. +- **`wandb.shared` removed**: The deprecation shim that popped `wandb.shared` from input dicts with a `FutureWarning` (introduced in #2649) is gone. The `rl` entrypoint always uses shared W&B mode now, and existing configs that still set `wandb.shared = true` (or `false`) will fail validation. Drop the field from your config. (2026-05-27) - **`max_async_level` and `strict_async_level` removed**: The async-execution semantics between trainer and orchestrator are now design invariants, not config knobs. The trainer always runs exactly one step ahead of inference, and the orchestrator always adopts the freshest checkpoint that doesn't violate the one-step barrier. The shared top-level `max_async_level`, the per-sub-config `trainer.max_async_level` / `orchestrator.max_async_level`, and `orchestrator.strict_async_level` have all been removed. Existing configs setting any of these must drop the field; the previous defaults (`max_async_level = 1`, `strict_async_level = false`) match the new hardcoded behavior. Bench mode no longer bypasses the weight-ckpt wait (the `int(1e9)` workaround is gone) and `multimodal/rl_color_codeword_feat_renderer.toml`'s prior `max_async_level = 0` (fully synchronous on-policy) is no longer expressible. (2026-05-25) - **`teacher_inference` removed from RL entrypoint**: The `[teacher_inference]` config block and the `deployment.num_teacher_gpus` / `deployment.num_teacher_nodes` fields have been removed. The `rl` entrypoint now only manages the student-policy inference server. External teachers (used by OPD and local-vLLM SFT) must be started manually (e.g. `CUDA_VISIBLE_DEVICES=1 uv run inference --model.name --server.port 8001 ...`) and pointed at via `[orchestrator.teacher.client]`. Existing configs using `[teacher_inference]` or `deployment.num_teacher_gpus` / `deployment.num_teacher_nodes` must drop those fields and bring up the teacher out-of-band. (2026-05-25) - **`rollouts_per_example` → `group_size`**: The orchestrator-level field, the group-level `[orchestrator.eval]` field, and the per-env `[[orchestrator.eval.env]]` field have all been renamed. The old name still parses as a validation alias (in both TOML and CLI), so existing configs keep working without changes; new configs should prefer `group_size`. (2026-05-22) diff --git a/docs/training.md b/docs/training.md index b8f9b95f..53fc7fa7 100644 --- a/docs/training.md +++ b/docs/training.md @@ -289,9 +289,10 @@ W&B is off by default. Enable with `--wandb`: ```bash uv run rl @ rl.toml --wandb # default project, random name uv run rl @ rl.toml --wandb.project my-proj --wandb.name run-42 +uv run rl @ rl.toml --no-wandb # force-disable even if the TOML enables it ``` -The trainer and orchestrator log into a **single shared W&B run**, so all metrics from both processes land in one place. Shared mode requires the W&B SDK ≥ 0.19.9 and is incompatible with `wandb.offline = true`. The legacy split (two runs suffixed `-trainer` and `-orchestrator`, gated on `wandb.shared = false`) has been removed; the `shared` field is accepted but ignored with a deprecation warning. +The trainer and orchestrator log into a **single shared W&B run**, so all metrics from both processes land in one place. Shared mode requires the W&B SDK ≥ 0.19.9 and is incompatible with `wandb.offline = true`. By default, every 10 steps each process also logs a sample of prompts/completions (with rewards and advantages) and reward/advantage/entropy distributions as W&B tables. Tune via `--wandb.log-extras.interval` and `--wandb.log-extras.sample-ratio`, or disable subsets: diff --git a/packages/prime-rl-configs/src/prime_rl/configs/rl.py b/packages/prime-rl-configs/src/prime_rl/configs/rl.py index 5873a792..a10e6b02 100644 --- a/packages/prime-rl-configs/src/prime_rl/configs/rl.py +++ b/packages/prime-rl-configs/src/prime_rl/configs/rl.py @@ -76,25 +76,6 @@ class SharedWandbConfig(BaseConfig): offline: bool | None = False """Run W&B in offline mode. Incompatible with shared mode, which is always on for the ``rl`` entrypoint.""" - @model_validator(mode="before") - @classmethod - def deprecate_shared_field(cls, data: Any) -> Any: - """``wandb.shared`` is deprecated. The ``rl`` entrypoint now always uses - shared W&B mode (single run for trainer + orchestrator); the legacy split - with ``-trainer`` / ``-orchestrator`` suffixes is gone. Drop the field - from input dicts with a warning so older configs keep loading. - """ - if isinstance(data, dict) and "shared" in data: - warnings.warn( - "wandb.shared is deprecated and will be removed in a future release. " - "The rl entrypoint always uses shared W&B mode now; remove this field " - "from your config.", - FutureWarning, - stacklevel=2, - ) - data.pop("shared", None) - return data - @model_validator(mode="after") def validate_not_offline(self): if self.offline: diff --git a/packages/prime-rl-configs/src/prime_rl/utils/validation.py b/packages/prime-rl-configs/src/prime_rl/utils/validation.py index 02c0d05b..054950f9 100644 --- a/packages/prime-rl-configs/src/prime_rl/utils/validation.py +++ b/packages/prime-rl-configs/src/prime_rl/utils/validation.py @@ -162,9 +162,12 @@ def propagate_shared_fields(data: Any) -> Any: # conflicts (e.g. shared ``ckpt.interval`` vs ``trainer.ckpt.interval``) # are already caught above; the bare block is exempt because # ``[ckpt]`` + ``[trainer.ckpt] keep_last = 3`` is a legitimate - # "enable + customise per side" pattern. + # "enable + customise per side" pattern. The ``isinstance(dict)`` check + # (not ``is not None``) is what makes CLI ``--no-wandb`` / ``--no-ckpt`` + # work — those land as the *string* ``"None"`` until ``BaseConfig``'s + # parent-class validator converts it, which happens after this one. for key in ("ckpt", "wandb"): - if get(key) is not None: + if isinstance(get(key), dict): fill(f"trainer.{key}", {}) fill(f"orchestrator.{key}", {})