-
Notifications
You must be signed in to change notification settings - Fork 414
feat: online evals during sft #3256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a168c33
Add online evals to the SFT entrypoint
mikasenghaas 7585d0e
Harden the SFT online-eval launcher and evaluator
mikasenghaas 2ee97d6
Add multi-node SFT online evals with decoupled SLURM jobs
mikasenghaas 1ad3fef
Make the trainer own the shared W&B run
mikasenghaas be468ec
Add an SFT-flavored W&B overview view
mikasenghaas 5291f5e
Merge remote-tracking branch 'origin/main' into feat/sft-online-eval
mikasenghaas 2649d5b
address online-eval review findings
mikasenghaas a9e98eb
address pr review comments
mikasenghaas a43aa3b
Merge remote-tracking branch 'origin/main' into feat/sft-online-eval
mikasenghaas 55c9b8c
address self-review comments
mikasenghaas 711f970
bring back the evaluator weights_dir field
mikasenghaas 45d8c3a
fix eval with redirected checkpoint dir and final-eval retrigger
mikasenghaas cd8379d
alias num_eval_gpus/num_eval_nodes for the infer deployment knobs
mikasenghaas 435bd37
fix alias precedence via pydantic-config bump
mikasenghaas c7299df
bump pydantic-config to v0.4.3 (merged alias fix)
mikasenghaas e8b5e18
floor prime-pydantic-config at 0.4.3
mikasenghaas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule pydantic-config
updated
2 files
| +44 −12 | src/pydantic_config/cli.py | |
| +93 −0 | tests/test_cli.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
packages/prime-rl-configs/src/prime_rl/configs/evaluator.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| from pathlib import Path | ||
|
|
||
| from pydantic import Field, model_validator | ||
|
|
||
| from prime_rl.configs.monitors import MonitorsConfig | ||
| from prime_rl.configs.orchestrator import EvalConfig | ||
| from prime_rl.configs.shared import ClientConfig, LogConfig | ||
| from prime_rl.utils.config import BaseConfig | ||
|
|
||
|
|
||
| class OnlineEvalConfig(EvalConfig): | ||
| """Online evals against a live inference server, driven by weight checkpoints | ||
| on disk. Extends the orchestrator ``EvalConfig`` (sources, sampling, intervals) | ||
| with the client of the inference deployment and evaluator-side knobs.""" | ||
|
|
||
| client: ClientConfig = ClientConfig() | ||
| """Client of the inference server evals run against. Auto-wired from the | ||
| ``[inference]`` block when the launcher manages the server.""" | ||
|
|
||
| env_server_base_port: int = Field(5000, ge=1, le=65535) | ||
| """First port of the env-server port range: the eval source at position ``i`` is | ||
| served at ``tcp://127.0.0.1:<base + i>``. Sources with an explicit ``serve.address`` | ||
| keep it instead, without shifting the other sources' ports.""" | ||
|
|
||
| max_inflight_episodes: int = Field(128, ge=1) | ||
| """Maximum eval episodes in flight — one episode is one agent run against an env server.""" | ||
|
|
||
| @property | ||
| def env_addresses(self) -> dict[tuple[str, str], str]: | ||
| """Where each eval source's env server lives, keyed by ``("eval", resolved_name)``. | ||
| Same contract as ``OrchestratorConfig.env_addresses``: the launcher binds env | ||
| servers at exactly these addresses and the evaluator connects to them.""" | ||
| return { | ||
| ("eval", source.resolved_name): source.serve.address | ||
| or f"tcp://127.0.0.1:{self.env_server_base_port + index}" | ||
| for index, source in enumerate(self.source) | ||
| } | ||
|
|
||
|
|
||
| class EvaluatorConfig(BaseConfig): | ||
| """``uv run evaluator``: watch a weights directory for new HF checkpoints, point | ||
| the inference server at each one (``/update_weights`` from disk), and run the | ||
| configured evals against the updated weights. The ``sft`` launcher writes this | ||
| config; it can also be run standalone against any trainer that writes | ||
| ``weights/step_{n}`` HF checkpoints with ``STABLE`` markers.""" | ||
|
|
||
| model: str = "Qwen/Qwen3-0.6B" | ||
| """Name the inference server serves the model under — the ``model`` field of every | ||
| eval request and the startup model check. Auto-filled from ``model.name`` by the | ||
| ``sft`` launcher; the name stays fixed across checkpoint reloads (weights are | ||
| swapped in place), so per-step results are told apart by ``eval/{env}/policy_version``.""" | ||
|
|
||
| eval: OnlineEvalConfig | ||
| """Eval sources, sampling, intervals, and the inference client.""" | ||
|
|
||
| weights_dir: Path | None = None | ||
| """Directory to watch for ``step_{n}`` HF weight checkpoints. The ``sft`` launcher | ||
| fills it from ``ckpt.output_dir`` when checkpoints are redirected to another volume; | ||
| defaults to ``<output_dir>/weights``.""" | ||
|
|
||
| output_dir: Path = Path("outputs") | ||
| """Directory to write outputs to — rollout traces and logs are written as | ||
| subdirectories. Shared with the trainer.""" | ||
|
|
||
| max_steps: int | None = None | ||
| """Trainer step at which the run ends. The final checkpoint always fires every | ||
| eval env, and the evaluator exits after processing it. If None, the evaluator | ||
| runs until terminated.""" | ||
|
|
||
| resume_step: int | None = None | ||
| """Trainer step the run resumed from. When set, the startup (base-model) eval is | ||
| skipped; set ``eval.retrigger_on_resume`` to re-fire interval-aligned evals at | ||
| this step.""" | ||
|
|
||
| log: LogConfig = LogConfig() | ||
|
|
||
| monitors: MonitorsConfig = MonitorsConfig() | ||
| """Metric monitors (``monitors.wandb``, ``monitors.file``).""" | ||
|
|
||
| @model_validator(mode="after") | ||
| def auto_setup_weights_dir(self): | ||
| if self.weights_dir is None: | ||
| self.weights_dir = self.output_dir / "weights" | ||
| return self |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.