Skip to content

fix: pass shared [monitors.file] settings to trainer and orchestrator - #4901

Open
mikasenghaas wants to merge 1 commit into
mainfrom
fix/shared-file-monitor
Open

mikasenghaas wants to merge 1 commit into
mainfrom
fix/shared-file-monitor

Conversation

@mikasenghaas

@mikasenghaas mikasenghaas commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Why. Under uv run rl, a shared [monitors.file] block passes only path to the trainer and the orchestrator. Its other settings (trace_sample, live, chunk_bytes, compress, float_decimals) are dropped without a warning, and both components keep their defaults. So [monitors.file] trace_sample = 0.1 still writes every trace.

Idea. Propagate every FileMonitorConfig field, not a hand-kept list. This exposed a second bug. A resolved rl.json dumps every shared leaf, defaults included. On re-load (uv run rl @ rl.json, as single-node SLURM does), the propagation reads those defaults as user values. So they conflict with a value set on one component. This already breaks [ckpt] with [orchestrator.ckpt] rollouts = true, and the file monitor fields would break the same way. So a shared value that equals its class default now never conflicts:

value = get(shared_path)
if value != field_default(shared, shared_path):   # e.g. RLConfig → monitors.file.trace_sample → 1.0
    ...record conflicts with differing sub-config values...
fill targets (if absent)
  • propagate_shared_fields now takes the config class that holds the shared fields (RLConfig), to look up the defaults.
  • The rule is slightly more lenient: an explicit shared value equal to its default, set together with a different component value, no longer raises. The component value wins.

Verification

The repro and the mutation table ran on 126a6f4 on macOS, before the rebase onto main. The env has no torch. On c12e608 (on main at 9d0453a), tests/unit gives 777 passed, 50 failed, 111 collection errors in 10 s. Every failure and error is a module my env lacks.

Repro: resolve a config, read the components, and re-load its dumped JSON.

Case Before (ecf9024) After (126a6f4)
[monitors.file] trace_sample = 0.1, live = false orchestrator and trainer: trace_sample = 1.0, live = true both: 0.1, false
[ckpt] + [orchestrator.ckpt] rollouts = true, re-load rl.json ['ckpt.rollouts'] is set, but ['orchestrator.ckpt.rollouts'] is also set re-loads to an equal config
[monitors.file] + [orchestrator.monitors.file] trace_sample = 0.5, re-load re-loads (the field did not propagate) re-loads to an equal config
  • Unit tests against the base branch. Every failure and error is a module my env lacks (torch, vllm, wandb_gql, env tasksets), and each occurs on the base branch too.
  • The new tests can fail:
Change removed Result
File monitor leaves loop (back to path only) test_shared_file_monitor_settings_reach_both_components fails
Default check (every shared value can conflict) both cases of test_resolved_json_with_shared_defaults_roundtrips fail with the conflict error

Merge order

This PR targets main and is independent of the config-layout stack (#4899 → #4905 → #4909). Whichever merges second rebases; #4899 moves configs/rl.py to configs/entrypoints/rl.py.

🤖 Generated with Claude Code


Note

Low Risk
Scoped to RL config propagation and validation; behavior changes are bug fixes with new unit tests, with no auth or data-path impact.

Overview
Fixes shared [monitors.file] on the rl entrypoint so all FileMonitorConfig fields (e.g. trace_sample, live, chunk_bytes) propagate to trainer and orchestrator, not only path.

propagate_shared_fields now receives the RL config class and uses new field_default helpers to compare shared values against Pydantic defaults. Shared leaves that are just defaults no longer trigger mutex conflicts when a component sets a different explicit value—so resolved rl.json files round-trip via @ without false positives (notably ckpt.rollouts vs orchestrator.ckpt.rollouts).

Also updates scripts/mini_moe.py to import Qwen3_5ForCausalLM from qwen3_5 instead of the old qwen3_5_moe module. Unit tests cover file-monitor propagation and default round-trip cases.

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

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>
@mikasenghaas
mikasenghaas force-pushed the fix/shared-file-monitor branch from 574a254 to c12e608 Compare December 2, 2026 22:37
@mikasenghaas
mikasenghaas removed this pull request from stack #4902 December 2, 2026 22:44
@mikasenghaas
mikasenghaas changed the base branch from feat/public-internal-configs to main December 2, 2026 22:44

This branch has not been deployed

No deployments
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