Repository navigation
test(automodel): rename the dtensor-named tests and merge the two worker files - #4703
Conversation
|
/ok to test 45605a1 |
yuki-97
left a comment
There was a problem hiding this comment.
Self-review via /review-pr-team: 3 agents (rl-expert, bug-finder, test-agent) + devil's-advocate pass.
Verdict — 1 inline comment: the docstring edit at test_config_validation.py:311 contradicts the PR body and conflicts with #4277; not blocking.
Verified clean
- The merged
test_automodel_worker.pyhas 35 tests = 10 + 25 from the two base files: none missing, none added, no marker changed, no duplicate names, and each test keeps the same Lfast / L0 tier set. lora_cfgis the real schema key (nemo_rl/models/policy/__init__.py:215) read by all three consumers; base wrote the dead"lora"key, and the tests now supply every requiredLoRAConfigfield.- No reference to
test_dtensor_worker,models/dtensor, the old test names orgrpo_trtllm_fsdp2_colocatedremains anywhere (incl..github/, docs,pyrefly.toml). - Shard-script edits are comment-only, so no pytest argument or path changed.
Lower-priority notes that are not inline
- The LoRA fixtures skip rather than fail when
Policy(...)construction raises (_base_setup_impl, pre-existingexcept Exception: pytest.skip), so a green L0/L1 does not prove LoRA constructed; the skip count for the 8 LoRA cases is worth reading. test_lm_policy_init[enable_loras=True]is a third path that now exercises real LoRA. It buildsPolicywithout the skip wrapper, so a failure there is a hard failure; the body names only the two worker tests.excluded_unit_tests.sh:89,129deselect two ids that do not exist (identical at base).- The "Deliberately not changed" list skips item 5.
Generated by Claude Code
1c4389e to
6c2e476
Compare
terrykong
left a comment
There was a problem hiding this comment.
Thanks for doing this rename and merge. Overall it is in good shape, with one blocker.
Blocker: the merge breaks the L0 Automodel policy shards, and this PR's own CI shows it. The module-scoped cluster now holds both GPUs until the merged file ends, so the class-scoped clusters later in the file time out after 180 s. In Automodel_Policy_1 that shows up as a green job with 21 skips; _2 and _3 fail. Fix: make the fixture function-scoped. The PR body says the lora_cfg fix "is the one change that can newly fail"; the merge newly fails too.
After that fix, please check the skip count in Automodel_Policy_1-3. Main skips 2 per shard. That is how you will know the LoRA tests really ran.
Unrelated to this PR: L0_Unit_Tests_Other failed test_nightly_compute_stays_below_4769_hours (4773 h). That comes from the base branch; fa1ae62 (#4704) on r0.8.0 raised the cap to 4790, so a rebase clears it.
What is good here:
- Catching the dead
lorakey and switching tolora_cfgis a real bug fix. - The merged
create_test_configkeeps every default the old dtensor tests used. - The comment explaining why the file is listed test by test instead of
--ignored is the right one to leave. - Your self-review note about
_base_setup_implturning setup errors into skips was right. The comment on L1066 is that note plus a fix.
Checked and clean: the error messages and their match= strings; no old names left anywhere; all 38 deselects resolve, and Lfast keeps the same 12 test ids; the sft_resume_diamond labels; the converter print.
Generated by Claude Code
…t backend prefix Signed-off-by: Yuki Huang <[email protected]>
…ker.py Signed-off-by: Yuki Huang <[email protected]>
…lpers above the tests 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]>
6c2e476 to
6d07068
Compare
…run test_lora.py in the automodel lane, assert LoRA is applied Signed-off-by: Yuki Huang <[email protected]>
…uding the sub-second tests from Lfast Signed-off-by: Yuki Huang <[email protected]>
|
/ok to test 5bbd18b |
…ts (#4742) Signed-off-by: Yuki Huang <[email protected]>
What does this PR do ?
Renames the backend to Automodel across the unit and functional tests, and merges the two
policy-worker test files into one. Tests only, except three production error messages the tests
assert on -- and one real bug, below.
What changed
1. Merge
test_dtensor_worker.pyintotest_automodel_worker.py. 25 + 10 tests, all 35 presentafterwards. The two files each had a
create_test_config; the merged one is their union --precisionandsequence_packing_enabledalready defaulted to what the other hardcoded, andsingle_rank_consolidation/consolidation_timeout_minutesare required keys the dtensor copy wasmissing.
excluded_unit_tests.shhad--ignore'd the whole automodel file while keeping threecorrectness checks from the dtensor one; keeping
--ignorewould have dropped those three fromLfast, so it is now 32 explicit
--deselects plus the 6 llama logprob variants, each verified toresolve against a real test.
2. The LoRA worker tests never enabled LoRA. They wrote
automodel_cfg["lora"], but the schema,every shipped YAML and all three readers use
lora_cfg; nothing readslora, and there is nocompat shim.
enabled: Truelanded on a dead key, sotest_worker_training_with_loraandtest_worker_logprob_with_lorahave been exercising the plain path and passing. Both now point atlora_cfg. This is the one change that can newly fail -- it needs L0/L1, since Lfast deselectsboth.
3. Renames. 37 test functions (dropping
dtensor_v2, and theautomodeltag where the file ordirectory already says it --
test_megatron_value_worker.pyandtest_automodel_value_worker.pyalready share identical test names);
tests/unit/models/dtensor/test_lora.py->models/automodel/(pure move:conftest.pyfilters on the marker, never on path, and that filecarries none);
grpo_trtllm_fsdp2_colocated.sh->grpo_trtllm_automodel_colocated.sh; the labelsinside
sft_resume_diamond.sh; 11 shard-script comments, two of which named shards that no longerexist.
4. Three production error messages.
grpo.py,ppo.pyandpolicy/utils.pysaid "DTensorbackend"/"DTensor has no matching" in asserts guarded by
automodel_cfg.enabled. Changed with thematch=strings that assert on them -- they cannot move separately.Also fixed:
test_converter_roundtrip.pyprinted that "Dtensor V1 and Dtensor V2 DCP andMegatron roundtrip checkpoints are identical", but the test builds one DCP checkpoint (STEP 2) and
converts it once (STEP 4). There is no second DCP path.
Deliberately not changed
convert.py's "DTensor v1 layout" and itsmatch="DTensor v1". That layout really was DTensorv1 (v0.7 and older); Automodel would be the wrong name for it.
dtensor_cfgwherever it names the legacy config key -- that is the migration check itself.FSDP2Config,use_torch_fsdp2,DTensor.redistribute,get_dst_dtensor,MockFSDPWorker:mechanism names, still what the code operates on.
tests/unit/reference_configs/*.yaml(5 comment lines). They are byte-mirrors ofexamples/configs/*.yaml, whichtests/unit/test_config_v2.pydiffs against, so they have tomove with the originals -- and the originals are the third PR's. Same for
test_config_validation.py:311-312, whose docstring quotes the same prose and linksdtensor-tp-accuracy.html, a doc that PR renames.DTensor v2prose innemo_rl/,examples/anddocs/-- that is the third PRin this split.
Reading the diff: git pairs the deleted
test_dtensor_worker.pywith the growntest_automodel_worker.pyas a 57%-similar rename, so commitfb7b3bc93renders as if theautomodel file were replaced.
git show --no-renamesshows the real shape.🤖 Generated with Claude Code