Repository navigation
refactor(automodel): rename the dtensor_cfg config block to automodel_cfg - #4283
Conversation
82bd87f to
e776255
Compare
|
/ok to test e776255 |
|
/ok to test d45efef |
There was a problem hiding this comment.
for reviewers:
- intended to do the below two things in order to avoid breaking all the existed megatron configs.
- first commit (2b12cc9) only changes the
dtensor_cfg->automodel_cfgeverywhere. can only see other commits for code changes.
yuki-97
left a comment
There was a problem hiding this comment.
Self-review via /review-pr-team: 4 agents (rl-expert, bug-finder, test-agent, design-reviewer) + devil's-advocate pass.
Verdict — 3 inline comments: the Megatron skip in reject_outdated_dtensor_cfg_key is wider than the intent it serves; the _v2 rejection main has today is dropped; leftover "DTensor" wording on rewritten lines. The first two change behaviour; the third is wording.
Verified clean
- The rename is complete — outside the rejection check, its tests and the both-backends message, no
dtensor_cfg,DTensorConfig*,dtensor_enable(d)or old fixture name remains innemo_rl/,tests/(incl. functional and test-suite.shoverrides),examples/,research/,docs/,skills/or.agents/. automodel_cfgasNotRequiredholds up — every remaining["automodel_cfg"]subscript sits on an Automodel-only branch or behind an enabled assert, and the teacher path guards with"automodel_cfg" in cfg, so a Megatron config without the block cannotKeyError.reject_outdated_dtensor_cfg_keyreuses_train_backend_configs, so policy, value, teacher,teachers[i]andenv.reward_modelare covered without a second traversal; all 14 training entrypoints callcheck_outdated_config, and resume never reloads the saved policy config.- The mechanical commits are purely mechanical — after normalising the renamed tokens no +/- line is left over;
validate_fp32_lm_head_confighas no stale keyword caller.
Lower-priority notes that are not inline
- The "is Automodel enabled" predicate is now spelled both
.get("automodel_cfg", {})and(x.get("automodel_cfg") or {}); left as is given the planned pydantic migration ofPolicyConfig/ValueConfig.
Generated by Claude Code
terrykong
left a comment
There was a problem hiding this comment.
Thanks for this. The rename is clean, and the way old Megatron configs are handled reads well: automodel_cfg is NotRequired, and the both-backends error tells the user about the rename. Reusing _train_backend_configs in the reject check is a good fit.
Both fixes from the earlier self-review hold at this head: _v2 is rejected under the new block name, and the rewritten lines say Automodel. No reply is needed on those threads.
Also checked, and clean:
- No
dtensor_cfgis left outside the reject check, its tests and the two both-backends error messages. That includes docs, README,research/,tools/,tests/test_suites/andtests/functional/. - Every
["automodel_cfg"]read is still guarded now that the block isNotRequired. - Checkpoint converters and resume never read the backend block, so old saved configs are not affected.
- No test was weakened by the rename.
The three inline comments are on ppo.py, test_outdated_config_checks.py and distillation_math.yaml (the last one is an optional nit).
CI: only the DCO, copyright and title checks have run on c515aa9; no unit-test or L1 job yet, since the base is a dev branch. These findings come from reading the code; the test change was checked locally on a CPU-only venv.
Generated by Claude Code
bac7aa9 to
336dbe1
Compare
…_cfg Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
…nabled Signed-off-by: Yuki Huang <[email protected]>
…bled Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
…touched Signed-off-by: Yuki Huang <[email protected]>
Signed-off-by: Yuki Huang <[email protected]>
c515aa9 to
20c2842
Compare
…tests, rename the YAML anchor Signed-off-by: Yuki Huang <[email protected]>
…omodel_cfg Signed-off-by: Yuki Huang <[email protected]>
|
/ok to test 8d7f4e9 |
What does this PR do ?
Renames
policy.dtensor_cfgtopolicy.automodel_cfg. Breaking: the old key is rejected, witha message naming the new one. Contents are unchanged. Megatron configs used the old key to disable
the other backend, so items 2 and 4 are about not breaking those.
Stacked on #4271 -- it introduces
outdated_config_checks.py, where the new check lives.What changed
1. The key, everywhere. 176 YAMLs plus every reader across
nemo_rl/,tests/,examples/and
tools/.PolicyConfig.dtensor_cfgbecomesautomodel_cfg, and its two TypedDicts follow:DTensorConfig->AutomodelConfig,DTensorConfigDisabled->AutomodelConfigDisabled.2.
reject_outdated_automodel_block. Replaces the_v2check inoutdated_config_checks.pyand covers both migrations a stale config needs: the block name, and
_v2under the new name --following the rename message must not carry the removed key across. It runs before
MasterConfigis built, so a stale key fails on its own terms rather than as a pydantic missing-field error.
Blocks that select Megatron are skipped -- see item 4.
3. The names that followed the old key.
dtensor_enabled/dtensor_enable->automodel_enabledacrosslm_policy.py,lm_value.py,policy/utils.py,distillation.pyandnccl_reshard_utils.py, plus the test fixtures that built one (create_dtensor_config,basic_dtensor_test_config).megatron_enable->megatron_enabledin the same two files: the_enablespelling was local-only, so a single call readmegatron_enabled=megatron_enable, dtensor_enabled=dtensor_enable.4. Keeping Megatron configs working. They used
dtensor_cfg.enabled: falseto disable theother backend, which the rename breaks.
automodel_cfgis nowNotRequiredlikemegatron_cfg,so such a config can drop the block entirely; if it instead inherits an enabled one,
Policy/Value.__init__names the rename in the both-backends error.🤖 Generated with Claude Code