Fix checkpoint config.yaml resume merge and add --config launch flag#520
Open
eugenevinitsky wants to merge 2 commits into
Open
Fix checkpoint config.yaml resume merge and add --config launch flag#520eugenevinitsky wants to merge 2 commits into
eugenevinitsky wants to merge 2 commits into
Conversation
The resume-time merge in train() looked for config.yaml next to the checkpoint instead of one level up, so it never fired and resumed runs silently rebuilt the policy from ini defaults; its key list had also diverged from _ARCH_ENV_KEYS. Route train() through _merge_checkpoint_arch (correct path, full key set) and print a notice when config.yaml is absent. Add a first-class --config flag to load_config that layers a yaml file (nested run dump or flat dotted cluster config) between ini defaults and explicit CLI flags, rejecting unknown keys. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
train(). It computedexperiment_dir = dirname(load_model_path), but checkpoints live in<run>/models/whileconfig.yamlis written to<run>/, so theos.path.existscheck always failed and the merge silently never ran. The block also carried a stale private copy of the architecture key list (missing allobs_norm_*/obs_range_*and waypoint keys). Both problems are fixed by deleting the block and routingtrain()through_merge_checkpoint_arch, which already uses the correctdirname(dirname(model_path))layout and the canonical_ARCH_ENV_KEYS._merge_checkpoint_archfinds noconfig.yaml, so a fall-back to ini/CLI policy/obs layout is visible in logs.--configflag toload_config. It accepts both a run-dumpedconfig.yaml(nested sections, including deepeval.*.*nesting) and a flat dotted cluster config (env.num_agents: 128), flattens it to dotted parser dests, validates every key against the registered argparse dests (unknown key ->ValueErrornaming it), and applies it viaparser.set_defaults. Precedence:default.ini<drive.ini<--config< explicit CLI flags. Run-dump-only keys (git,train.use_rnn,config) are dropped.tests/unit_tests/test_drive_config.pycovering nested yaml load + CLI-flag precedence, flat dotted yaml load, and unknown-key rejection.Why
Best models did not reproduce: resuming or fine-tuning from a checkpoint silently rebuilt the policy and observation layout from ini defaults because the config.yaml merge never fired, and there was no way to launch a run from a saved config file at all (run dumps, cluster configs, and CLI flags were three mutually incompatible formats). Typos in a config file must fail loudly rather than no-op.
Notes
pytest tests/unit_tests/test_drive_config.py -x -q-> 9 passed, 1 skipped;pytest tests/unit_tests -k "config or yaml" -q-> 12 passed, no regressions. End-to-end smoke:--config scripts/cluster_configs/nightly_best.yamlloads correctly throughload_config(num_agents=4096, backbone_hidden_size=1024, wandb project/group, eval disables all applied). Missing-config notice verified on a nonexistent checkpoint path.ruff format --checkclean; the 50ruff checkfindings in pufferl.py are identical on the base commit (pre-existing).train --load-model-pathnow also adoptspolicy_name/rnn_name(and derivedtrain.use_rnn) plus the full_ARCH_ENV_KEYSset from the checkpoint's config.yaml — previously it adopted nothing at all due to the path bug, so any resumed run that relied on CLI flags to re-specify the architecture will now get it from the checkpoint automatically (this is the intended semantics: the net must match the weights).ValueErrorwhen passed via--config(fail-fast by design); remove the stale keys from the file to launch.🤖 Generated with Claude Code
🤖 Generated with Claude Code