Repository navigation
Description
#4282 renamed the workers themselves (DTensorPolicyWorkerV2 -> AutomodelPolicyWorker,
dtensor_policy_worker_v2.py -> automodel_policy_worker.py, the rl.backend tracing tag,
the Timer label). It deliberately left the items below, which are wording-only or file moves
and touch files the config-rename PR (#4283) also edits.
Split across two PRs so the file moves do not sit in the same diff as the prose:
- Part A — a new PR of its own: the test renames and file moves (sections 1-4).
- Part B — docs(automodel): rename the DTensor backend to Automodel #4277: the wording (section 5).
Keeping them out of #4282 and #4283 avoids conflicts in examples/configs/*.yaml and
nemo_rl/models/policy/__init__.py.
Paths and line numbers are as of #4282, i.e. after its rename lands on main.
Part A — new PR: test renames and file moves
1. Test function names (11)
tests/unit/models/policy/test_automodel_worker.py — 10 functions still named
test_dtensor_v2_*: L64, L88, L126, L138, L287, L382, L876, L892, L920, L935.
tests/unit/models/policy/test_lm_policy_collective.py:156 —
test_policy_forwards_final_checkpoint_marker_to_dtensor_v2.
Safe to rename: tests/unit/excluded_unit_tests.sh excludes the worker file with --ignore=
on the whole file, not with per-test --deselect, so no exclusion silently stops matching.
2. Shard header comments (3)
tests/unit/L0_Unit_Tests_Automodel_Policy_{1,2,3}.sh:16 all read
(test_dtensor_worker*.py, test_automodel_types.py). That glob no longer covers the renamed
test_automodel_worker.py.
3. Move the last file out of tests/unit/models/dtensor/
tests/unit/models/dtensor/test_lora.py is the only file in that directory (there is no
__init__.py), and nemo_rl/models/dtensor/ was deleted in #4198, so the directory name points
at source that no longer exists. The test itself exercises
nemo_automodel.components._peft.lora.
Move it to tests/unit/models/automodel/test_lora.py and drop models/dtensor/ from the four
tests/unit/L0_Unit_Tests_Models_{1,2,3,4}.sh:17 comments.
This is a pure rename, not a change of which shard runs it: tests/unit/conftest.py
pytest_collection_modifyitems filters on the automodel marker only, never on path, and
test_lora.py carries no marker (it uses a module-level pytest.skip on ImportError
instead). tests/unit/models/automodel/ already holds two unmarked files
(test_automodel_convert.py, test_logprob_memory.py), so an unmarked file there keeps being
collected by the base Models_* shards and keeps being excluded from --automodel-only.
While editing those four files, line 18 says models/automodel/ (all automodel) are excluded by conftest.py filtering, which is already inaccurate for the reason above. Worth correcting in
the same pass.
Nothing pins the current path: no shard script or excluded_unit_tests.sh entry references it,
and git grep models/dtensor across the repo matches only those four comment lines.
4. Merge the two worker test files
Merge tests/unit/models/policy/test_dtensor_worker.py into
tests/unit/models/policy/test_automodel_worker.py. The v1 worker is gone (#4198), so the
two files no longer describe two backends. tests/unit/excluded_unit_tests.sh has 15 lines
referencing test_dtensor_worker.py that have to move with it.
Part B — #4277: "DTensor v2" wording (31)
| File | Lines |
|---|---|
nemo_rl/models/automodel/checkpoint.py |
14, 72, 103 |
nemo_rl/models/policy/__init__.py |
42, 188 |
nemo_rl/models/value/lm_value.py |
106, 432 |
nemo_rl/algorithms/single_controller_utils/config.py |
1193 |
nemo_rl/algorithms/xtoken_off_policy_distillation.py |
28 |
nemo_rl/data/cross_tokenizer_collate.py |
69, 167 |
tests/unit/models/value/test_automodel_value_worker.py |
19, 27, 126, 258 |
tests/functional/grpo_automodel_ref_anchor_resume.sh |
2 |
tests/functional/test_converter_roundtrip.py |
475, 487, 489, 541, 558, 559, 563, 577, 673, 690 |
examples/configs/ppo_math_1B.yaml |
340 |
examples/configs/ppo_math_1B_megatron.yaml |
24 |
examples/configs/sft.yaml |
60 |
examples/configs/recipes/llm/dapo-nanov3.5-30BA3B-4n8g-automodel.yaml |
2 |
tests/unit/reference_configs/sft.yaml |
54 |
config.py:1193 and checkpoint.py:103 are user-visible error text; the rest are comments,
docstrings and test output.
test_converter_roundtrip.py:577 is factually wrong, not just old naming. It prints
"✓ Dtensor V1 and Dtensor V2 DCP and Megatron roundtrip checkpoints are identical!", but the
test builds exactly one DCP checkpoint (STEP 2) and converts it once (STEP 4); there is no
second DCP path, and the v1 one was deleted in #4273. It should name one DCP conversion plus
the Megatron one. The other nine lines in that file are plain DTensor DCP wording.
:89 in the same file is the dtensor_cfg config key and belongs to #4283 — leave it.
Out of scope — already evaluated, do not "fix" these here
dtensor_cfgas a config key, anywhere. refactor(automodel): rename the dtensor_cfg config block to automodel_cfg #4283 renames it toautomodel_cfg.- The
dtensor_enable/dtensor_enabledlocals and thevalidate_fp32_lm_head_config
keyword argument (16 sites acrosslm_policy.py,policy/utils.py,lm_value.py,
distillation.py,nccl_reshard_utils.py,test_policy_validation.py). refactor(automodel): rename the dtensor_cfg config block to automodel_cfg #4283 already
renames all of them toautomodel_enabled. reject_outdated_dtensor_v2_keyinnemo_rl/utils/outdated_config_checks.pyand its test.
The name refers to the legacydtensor_cfg._v2key, not to the backend; refactor(automodel): rename the dtensor_cfg config block to automodel_cfg #4283 renames it to
reject_outdated_automodel_block.nemo_rl/weight_sync/xferdtensor.py,xferdtensor_python.py,to_local_if_dtensorand
tests/unit/weight_sync/test_xferdtensor_python.py. These name the DTensor mechanism, which
is still what they operate on.- Recipe filenames carrying
dtensor/dtensor2tp1(5 YAMLs + 5 driver scripts). These will
be handled in the nightly refactor series, which starts at test: add per-suite weekly GPU-hour budgets and disable 39 P1 recipes #3557 — renaming them means
editingnightly.txtand breaking continuity with the existing W&B run history, so it
belongs with that work rather than with this rename series.
Activity