Skip to content

feat: remove config fields the launchers always fill - #4910

Closed
mikasenghaas wants to merge 6 commits into
fix/config-overridesfrom
feat/narrow-public-configs
Closed

mikasenghaas wants to merge 6 commits into
fix/config-overridesfrom
feat/narrow-public-configs

Conversation

@mikasenghaas

@mikasenghaas mikasenghaas commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Why. Some public config keys look settable, but the launcher always overwrites them or no process reads them. A user who sets them gets no error and no effect. For example, [eval] max_steps in an sft config is replaced with the trainer's value, and [orchestrator.log] log_data is never read.

Idea. Remove these keys from the public schema, so that setting one fails as an unknown key. Each process keeps its complete config. The public block is a narrower base class that the complete config extends.

sft [eval]        SFTOnlineEvalSection                # what the user sets
                  SFTOnlineEvalConfig(Section, ...)   # + model, weight_broadcast, broadcasts_dir,
                                                      #   max_steps, resume_step, output_dir, log, monitors
log blocks        LogConfig                    level, json_logging
                  PeriodicLogConfig(LogConfig) + interval     (orchestrator, eval, online eval)
                  TrainerLogConfig(LogConfig)  + ranks_filter
                  SupervisedLogConfig(Trainer…) + log_data    (sft trainer)
  • inference.backend_port defaults to None and follows server.port + 100. An explicit value still wins. Before, a custom server.port kept the backend on 8100.
  • Docstring fixes: rl log, seq_len, weight_broadcast, rollout_transport, deployment; trainer and env worker pool output_dir; P/D vLLM overrides; nixl_nic_affinity; router_ttl_s. A dead W&B check is removed.
  • Out of scope: placement moves (for example TokenizerConfig into shared blocks) and deduplication of the Shared* blocks. Later PRs in the stack handle them.

Breaking

Each key below now fails as an unknown key. Delete it from the config. No key had an effect before.

Key Why it had no effect
sft [eval] model, weight_broadcast, broadcasts_dir, max_steps, resume_step, output_dir, log, monitors The sft launcher fills them from the trainer config.
log.interval on the trainer, sft trainer, inference and env worker pool blocks Only the orchestrator, eval and online eval loops read it.
log.log_data outside [trainer.log] of sft Only the sft trainer reads it.
rl [wandb] offline No component read the shared value. Set trainer.wandb.offline / orchestrator.wandb.offline.

inference.backend_port is not removed. Its default changes from 8100 to server.port + 100, which is the same value for the default port.

Verification

Unit suite on 2768cbe (rebased onto the section split in #4909): 823 passed, 50 failed, 111 errors. The failures and errors are the same set as on the base fix/config-overrides. They need GPU packages or verifiers tasksets that the macOS venv lacks. The 16 new tests all pass. The mutation table below ran again on 2768cbe.

Change removed Result
Derive backend_port only when a router is set test_backend_port_follows_the_server_port_unless_set: assert None == 9100
sft.eval typed as SFTOnlineEvalConfig again test_sft_eval_block_has_no_fields_the_launcher_fills: 6 failed, DID NOT RAISE ValidationError
TrainerLogConfig extends PeriodicLogConfig test_log_blocks_hold_only_the_fields_their_process_reads: 2 failed
offline back on the rl shared [wandb] test_rl_has_no_shared_wandb_offline: DID NOT RAISE ValidationError

Merge order

#4899 → #4901 → #4905 → #4909 → this PR. Each PR is stacked on the one before it. Merge in order, and rebase each next PR onto main after a squash merge.

The k8s operator imports prime_rl.configs.inference. PrimeIntellect-ai/model-factory-iac#3889 makes it read both paths. Merge it after this stack.

🤖 Generated with Claude Code


Note

Medium Risk
Breaking change for configs that set formerly ignored keys; runtime behavior is unchanged when users only set supported fields, but validation errors will surface on upgrade.

Overview
Public schemas no longer expose config keys that launchers always fill or no process reads, so mistyped settings fail validation instead of being silently ignored.

SFT online eval splits into SFTOnlineEvalSection (user [eval] block) and SFTOnlineEvalConfig (launcher-spawned process). Fields like model, weight_broadcast, broadcasts_dir, max_steps, resume_step, output_dir, log, and monitors are only on the latter; the launcher builds that config explicitly in build_online_eval_config.

Logging uses a narrower hierarchy: base LogConfig (level, json_logging); PeriodicLogConfig adds interval for orchestrator, eval, and online eval; SupervisedLogConfig adds log_data for the SFT trainer only. Trainer, engine, and env worker pool log blocks no longer accept interval or misplaced log_data.

RL shared W&B drops monitors.wandb.offline from SharedWandbConfig and removes propagation of offline; docs note shared mode needs a live W&B server.

Inference sets backend_port default to None and derives server.port + 100 whenever unset (including bare-engine / no-router), not only when a router is present.

Docstrings and docs are aligned (backend port wording, W&B offline, router TTL with spill, P/D overrides scope, seq_len / weight_broadcast propagation, env pool output_dir). 16 new unit tests lock in backend port derivation, eval field rejection, log block shapes, and missing shared wandb.offline.

Reviewed by Cursor Bugbot for commit 478ed50. Bugbot is set up for automated code reviews on this repo. Configure here.

mikasenghaas and others added 4 commits December 2, 2026 14:02
A shared [monitors.file] block passed only its path down. Its other
settings (trace_sample, live, chunk_bytes, ...) never reached the
trainer or the orchestrator, which kept their defaults without a
warning. Propagate every FileMonitorConfig field.

A resolved rl.json dumps every shared leaf, defaults included, so a
re-load saw those defaults as values that conflict with a component's
own setting. [ckpt] with [orchestrator.ckpt] rollouts = true already
failed to re-load this way, and the file monitor fields would have
too. A shared value equal to its class default now never conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uv run inference was both the public entrypoint (a router plus an
engine, or a SLURM job) and the bare engine that each SLURM rank runs.
EngineConfig now holds the fields that one engine process reads, and
InferenceConfig extends it with the router, deployment and SLURM
fields. The new `engine` script serves one EngineConfig without a
router, and the per-rank SLURM launches use it.

EngineConfig ignores unknown keys, so it reads any inference config,
including the existing per-rank and P/D role JSON. InferenceConfig
still rejects unknown keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SLURM writers now keep only the engine fields in the per-rank and
P/D role files that `engine` reads. EngineConfig then rejects unknown
keys and CLI flags like every other config. dump_rl_components and
dump_pd_components are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The config audit found values that rl and sft drop or overwrite
without a word. Each now fails, is honored, or is derived:

- rl: a single-node orchestrator.env_worker_pool_replicas hung the
  run (the local launcher starts one pool per source); a multi-node
  value that differs from the inference node count was replaced.
- rl, sft: inference.weight_broadcast was overwritten by the shared
  transport; an explicit inference.vllm.data_parallel_size that does
  not fill the inference GPUs was replaced; a larger max_lora_rank
  was lowered to the LoRA rank.
- sft: inference.deployment, slurm and dry_run were ignored.
- rl: resume set only on trainer and orchestrator left the launcher
  treating the run as fresh, which deleted its rollouts. The shared
  resume now derives from the trainer's, and the launcher reads the
  trainer's checkpoint directory.
- Frozen models sent the run's admin token to external endpoints.
- Eval sources dropped sampling.logprobs.
- The SFT online-eval control API shared port 8040 with the trainer.
- Multi-node SFT online evals could not set inference_metrics_roles.
- Full optimizer offload warned about a max_norm the user never set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mikasenghaas
mikasenghaas force-pushed the feat/narrow-public-configs branch from 478ed50 to 9aca55b Compare December 2, 2026 22:05
@mikasenghaas
mikasenghaas added this pull request to stack #4902 December 2, 2026 22:09
mikasenghaas and others added 2 commits December 2, 2026 14:19
rl and sft nested the full orchestrator and inference configs, so their
public surface held fields the launcher always fills. A user could set
them, and the launcher then rejected or replaced the value.

Each component config now extends the public section that the
entrypoint nests, and adds only the launcher-filled fields:

  EngineSection      EngineConfig(EngineSection) + weight_broadcast, pd_*
  ServingSection     sft [inference]: engine + router, backend_port
  InferenceSection   rl [inference]: + deployment
  InferenceConfig    + slurm, output_dir, dry_run (and EngineConfig)
  OrchestratorSection  OrchestratorConfig + env_worker_pool_replicas

RLConfig.orchestrator_config/inference_config and
SFTConfig.inference_config build the component configs, keeping which
fields the user set. dump_rl_components and the writers use them, so
the component JSON is unchanged. The removed keys now fail as unknown
keys instead of with a launcher-specific error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sft [eval] block accepted model, weight_broadcast, broadcasts_dir,
max_steps, output_dir, log and monitors, but the sft launcher always
overwrote them. [eval] now takes SFTOnlineEvalSection, and
SFTOnlineEvalConfig adds the launcher-filled fields.

LogConfig keeps level and json_logging. Only the processes that read
interval and log_data get them (PeriodicLogConfig, SupervisedLogConfig).
rl's shared [wandb] drops offline, which no component read.

inference.backend_port is now None by default and follows
server.port + 100 unless set.

Also fix stale docstrings and remove a dead W&B check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mikasenghaas
mikasenghaas force-pushed the feat/narrow-public-configs branch from 9aca55b to 2768cbe Compare December 2, 2026 22:19
@mikasenghaas

Copy link
Copy Markdown
Member Author

Folded into #4909, which now holds the whole public/component section split.

@mikasenghaas
mikasenghaas removed this pull request from stack #4902 December 2, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant