Repository navigation
[tests] Remove redundant test snapshots and clarify review guidance - #5786
Conversation
9e1b76c to
9c87bbb
Compare
|
@claude review |
There was a problem hiding this comment.
Verdict: Approve -- please address the items below before merging. The deleted tests check config values, class identity, or method ownership rather than behavior, and I spot-checked several of the "still covered by" claims; they hold. The one real problem is the new review-guidance section, which repeats rules/tests.md in the wrong file.
What this PR does. It deletes 65 test functions, deletes the features / 3d 8-GPU integration entry along with its config factory, and cleans up imports and helpers left unused by those deletions. It also adds a "Deciding Whether a PR Needs Tests" section to the pr-review skill. No production code, recipe, golden file, or CI workflow is changed.
Example. The integration deletion, in tests/integration_tests/features.py:
before: "3d" -> llama3_debugmodel_fsdp2_tp2_pp2 (FSDP2 x TP2 x PP2, 8 microbatches, 8 GPUs)
"pp_dp_tp" -> llama3_debugmodel_fsdp2_tp2_pp2_{save,load} (same parallelism, + checkpoint every 10 steps, resume to step 20)
after: only "pp_dp_tp"
I checked that _save sets the same degrees, microbatch count, token count, and type-checking setting as the removed factory; the only additions are the checkpointer and the resume step. So no parallelism combination loses coverage. The same is true for test_vllm_uneven_decode_tp_padding: a copy remains at tests/rl/unit_tests/gpu/test_generator_uneven_decode.py, and unit_test_gpu_rl.yaml runs it.
Must fix
.claude/skills/pr-review/SKILL.md:106-120-- the new section repeatsrules/tests.md,review-checklist.mdsection 6, and CLAUDE.md PR Expectation 4. It is also in a file that authors never load. Delete it and move the ~2 genuinely new bullets intorules/tests.md.tests/rl/unit_tests/cpu/test_metrics.py:540-542-- the# Backend identitysection banner is left empty after the deletion; remove it.
Should consider
tests/unit_tests/gpu/recipes/test_fused_swiglu.py:10-- the remaining tests in this file look CPU-runnable but sit in the GPU suite, so they use GPU runner time. Consider moving them totests/unit_tests/cpu/recipes/.
Details
- Gate: the problem is real (tests that pin config defaults,
isinstance/issubclassresults,vars(cls)membership, or README strings, and that fail on valid refactors). Tests are the right layer, and I found no overlapping open PR. The net change is -970 LoC. - Claims I verified at HEAD:
test_context_manager_step_is_noopchecks that both profiler handles areNoneand callsstep()twice, which covers the five disabled-path profiler tests that were deleted.- Every debug recipe factory takes its
seq_lendefault fromDEFAULT_DEBUG_MODEL_SEQ_LENrather than a literal, so the deletedtest_debug_config_defaults.pycould only catch someone hard-coding a different value in one factory. That is low value.
- One borderline deletion:
test_parallelism_config_default_schedule/_default_load_balancerare default snapshots. That is consistent with the rest of the PR, but note thatTestProfilerConfig.test_default_field_values(also a default snapshot) is deliberately kept as the output-path guard. The description explains why, which is enough.
Not verified: the GPU and integration suites were not rerun here. I also did not check that each deleted test's import cleanup leaves no unused or missing imports; lint covers that.
| ## Deciding Whether a PR Needs Tests | ||
|
|
||
| When authoring or reviewing a PR, do not add a test automatically for every fix. | ||
|
|
||
| - **Identify the gap.** Name the behavior existing tests miss; cite existing | ||
| coverage when it is sufficient. | ||
| - **Extend before adding.** Prefer an existing test or integration configuration | ||
| over another fixture, file, or model/flag permutation. | ||
| - **Check behavior independently.** Avoid config echoes, source/README greps, | ||
| private-layout snapshots, and assertions that only repeat mock calls. | ||
| - **Keep meaningful regressions.** A specific combination can protect numerics, | ||
| gradients, checkpoints, collectives, or demonstrated performance requirements. | ||
| Delete redundant cases only after identifying the coverage that remains. | ||
| - **Control cost.** Use the smallest necessary hardware, put GPU tests in the GPU | ||
| suite, and report what actually ran and what was skipped. |
There was a problem hiding this comment.
This section mostly repeats guidance that already exists in three places: .claude/rules/tests.md ("When to Add a Test", "Prefer Extending Existing Coverage", cheapest hardware, "Verify that the intended test actually ran"), review-checklist.md section 6, and CLAUDE.md PR Expectation 4. It also says "When authoring or reviewing", but authors never load the pr-review skill, so the authoring half doesn't reach them from here. Keeping four copies means they will drift apart.
Smallest fix: delete this section. Put the few points that are actually new into .claude/rules/tests.md, which applies to both authors and reviewers by glob. I count about 2 bullets of new content:
- under "When to Add a Test", add "no private-layout snapshots, and no assertions that only repeat mock calls";
- under "Prefer Extending Existing Coverage", add "delete a redundant test only after naming the retained test that covers it".
This also keeps the PR to one concern (test cleanup) plus a rule tweak that directly backs it.
| @@ -542,10 +542,6 @@ def test_fmt_metric_value(value, expected) -> None: | |||
| # --------------------------------------------------------------------------- | |||
There was a problem hiding this comment.
After test_metric_backend_is_base_logger is removed, the # Backend identity banner (lines 540-542) has nothing under it, so it is followed directly by the MetricsProcessor fan-out + build banner. Please delete the three banner lines and the blank lines after them.
| @@ -9,24 +9,18 @@ | |||
| The override replaces ``DenseFeedForward.activation_fn`` while preserving the module | |||
| and its physical ``w13`` projection. These tests run on CPU unless marked CUDA. | |||
There was a problem hiding this comment.
(Should consider, follow-up is fine.) The docstring says "These tests run on CPU unless marked CUDA". The remaining tests in this file (test_saves_native_layout_without_copy, test_fused_roundtrip, test_hf_adapter_roundtrip, TestFusedSwiGLUDistGemmComposition) look CPU-runnable, but they live under tests/unit_tests/gpu/, so they use GPU runner time. tests.md asks for the cheapest hardware that exercises the code. Since this PR already cleans up this file, consider moving the CPU-runnable classes to tests/unit_tests/cpu/recipes/ and keeping only the accelerator-gated ones here. Unverified that every one of them runs without a device.
tianyu-l
left a comment
There was a problem hiding this comment.
Please fix this
.claude/skills/pr-review/SKILL.md:106-120 -- the new section repeats rules/tests.md, review-checklist.md section 6, and CLAUDE.md PR Expectation 4. It is also in a file that authors never load. Delete it and move the ~2 genuinely new bullets into rules/tests.md.
and other inline comments
|
@claude review latest changes |
|
Claude finished @acisseJZhong's task in 1m 15s —— View job Approve: all three earlier review items are fixed in |
There was a problem hiding this comment.
Verdict: Approve -- please address the item below before merging. Commit 1ba63a5 resolves all three items from the previous review, and it adds no new problems.
What changed since the last review. The pr-review skill section was deleted and its two new rules were moved into rules/tests.md. The empty test_metrics.py banner was removed. The four fused-SwiGLU tests that can run on CPU were moved into the CPU suite.
Example. Where each fused-SwiGLU test runs now:
before: tests/unit_tests/gpu/recipes/test_fused_swiglu.py (GPU runner)
test_saves_native_layout_without_copy, test_fused_roundtrip,
TestFusedSwiGLUDistGemmComposition, TestFusedSwiGLUHFAdapter,
test_triton_checkpoint_loads_into_native, test_native_checkpoint_loads_into_triton
after: tests/unit_tests/cpu/recipes/test_fused_swiglu.py (picked up by `pytest tests/unit_tests/cpu`)
the first four, unchanged
tests/unit_tests/gpu/recipes/test_fused_swiglu.py
only the two tests gated by `skipUnless(_HAS_OP_DEVICE)`
Previous items
.claude/skills/pr-review/SKILL.mdduplicate section -- resolved (tianyu-l's request). The section is deleted.rules/tests.mdnow says "snapshot private layouts, repeat mock calls" under "When to Add a Test" and "Delete a redundant test only after naming the retained test that covers it" under "Prefer Extending Existing Coverage", which is exactly what was asked.tests/rl/unit_tests/cpu/test_metrics.pyempty# Backend identitybanner -- resolved.- CPU-runnable fused-SwiGLU tests in the GPU suite -- resolved. I compared the moved bodies against the deleted hunks: they are unchanged. The new CPU file imports
tritonthrough the override module. The CPU suite already does the same intest_fused_mla_override.py, so this adds no new dependency to the CPU suite.
Must fix
- PR description -- "Summary (human-written)" is still empty. Per CLAUDE.md PR Expectation 2, the author fills this in, not an agent. The earlier review missed this.
Not verified: I did not run the moved CPU tests in this job. The author reports that 81 passed with CUDA hidden.
## Summary (human-written)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
this approach, and what you checked yourself. -->
## Why
The Real PG integration suite (`8 GPU Integration (Real PG - full suite
- features)`) and the ROCm integration suite have failed the `sft` loss
check on main since #5757 (`899480301`; `a87db08ea` before it passed):
```
[sft] AssertionError: 7.889825820922852 != 7.887711524963379 : loss mismatch at step 1 # A10G
[sft] AssertionError: 7.890093803405762 != 7.887524604797363 : loss mismatch at step 1 # MI350X
```
#5757 renders `bos_token`/`eos_token` in Hugging Face chat templates, an
intended change to the SFT token stream. It regenerated
`tests/assets/losses/fake_pg/a10g/sft.txt` but not the real-PG A10G and
MI350X goldens.
## What changed
- `tests/assets/losses/real_pg/a10g/sft.txt` and
`tests/assets/losses/real_pg/mi350x/sft.txt`: steps 1-10 regenerated;
headers unchanged.
## Numerics
The new values are the full-precision TensorBoard metrics of the failing
main runs' baseline training (the same values `loss_compare.py
--export-result` writes), read with `scripts/loss_compare.py`'s own
extraction from the uploaded `integration-8gpu-features-outputs`
artifacts:
- A10G: run 41746280593 (`e6ca6d861`). Step 1 matches the log's baseline
(7.889825820922852, grad_norm 4.189799785614014).
- MI350X: the ROCm run on `73c4ebdac`. Step 1 matches the log's baseline
(7.890093803405762, grad_norm 4.189815998077393).
The commits between #5757 and those runs (#5572, #5787, #5776, #5774,
#5779, #5741, #5786) do not change SFT numerics.
## Testing
- CI: Real PG (`ciflow/real-pg`) and ROCm (`ciflow/rocm`) integration
suites.
- A manual `export_results` run of the integration workflow for `sft` on
main (run 41760303504) exported a real-PG A10G golden identical to this
one.
- `Multi-GPU Unit Tests` fails here with the `_VisionEncoder ...
named_preserve_dtype_params` error that is also on main; #5795 fixes it.
This PR was AI-assisted.
Summary (human-written)
Why
Reduce test maintenance by removing redundant coverage and checks that unnecessarily lock in implementation details, while preserving meaningful regression tests.
What changed
featuresintegration entry,3d, and its now-unused config factory. Keeppp_dp_tp, which runs the same training configuration with checkpoint save/load..claude/rules/tests.mdguidance to reject private-layout snapshots and assertions that only repeat mock calls, and require naming retained coverage before deleting a redundant test. The PR-review skill already references this rule file.tests/unit_tests/cpu/recipes/test_fused_swiglu.py; retain the two accelerator forward-parity tests in the GPU suite. Test bodies and decorators are unchanged. Existing CI discovers both directories, so no workflow edit is needed.8e3da8b50b).Production code, recipes, numerical goldens and CI workflow files are unchanged. In particular, these semantic RL guards remain:
tests/rl/unit_tests/cpu/test_rl_dist_moe_recipe.py::test_rl_integration_recipe_runs_dist_moe_on_both_rolestests/rl/unit_tests/cpu/test_model_defaults.py::test_rl_recipes_get_model_defaults(LM-head precision and frozen routing across recipes)The B200 integration and CPU RL workflows still invoke those checks. Compiler-lowering checks, model/dataset geometry checks, numerical/gradient comparisons and real-collective coverage also remain. The MoE backend-selection, Qwen 27B full-rematerialization, DAPO thinking-mode, 671B precision/fusion, dataset absolute-path and Generator finalizer and profiler output-directory guards are retained.
The four moved tests are retained and are not included in the deletion count:
TestFusedSwiGLU.test_saves_native_layout_without_copyTestFusedSwiGLU.test_fused_roundtripTestFusedSwiGLUDistGemmComposition.test_overlapping_variant_keeps_w13_checkpoint_layoutTestFusedSwiGLUHFAdapter.test_hf_adapter_roundtripDeleted tests and reasons
Each entry explains why the test is being removed. References to existing coverage identify retained tests.
Core CPU: 43 test functions
tests/unit_tests/cpu/components/checkpointer/test_checkpoint.pyTestCheckpointManager.test_checkpointer_package_import_path: Remove because retained fresh-process checks exercise the public CheckpointManager import, and retained ModelWrapper/optimizer tests use the public exports. The extra assertion fixes re-export identity with the implementation modules; it does not exercise additional checkpoint behavior.TestCheckpointManager.test_legacy_import_path: Remove because the public CheckpointManager import is covered by retained fresh-process tests and public ModelWrapper is exercised by state-dict and export tests. This test adds only exact identity with their implementation-module classes.TestCheckpointManager.test_trainer_uses_optional_checkpointer_interface: Remove because ConfigLoader does not use this annotation to parse configuration, and in-repo recipes explicitly select their checkpointer. The exact DCP type/default snapshot does not exercise the runtime None/build branches.TestConfigPostInit.test_legacy_config_only_adds_dcp_specific_fields: Remove because it fixes which fields are declared locally on a subclass; redeclaring an inherited field unchanged would fail it. Retained config validation and save/load tests check the effective configuration.TestSharedDiscoveryAndRetention.test_bodies_are_defined_on_the_base: Remove because moving methods between base and derived classes need not change their results; the retained TestSharedDiscoveryAndRetention cases check discovery and retention decisions directly.TestShouldPurge.test_defined_on_the_base_not_the_dcp_manager: Remove because method ownership is not the purge contract; the remaining TestShouldPurge cases check rank, retention and folder conditions regardless of where the method lives.tests/unit_tests/cpu/components/checkpointer/test_state_dict_keys.pyTestStateDictKeys.test_model_structure_anchors: Remove because fixed debug-model parameter names add no checkpoint roundtrip coverage. Retained tests compare every actual parameter key and optimizer-state value, allowing supported native-layout changes.tests/unit_tests/cpu/components/checkpointer/test_torch_checkpointing.pyTorchCheckpointingManagerTest.test_config_adds_no_checkpoint_options: Remove because valid backend-specific options would fail an exact match with the base field set; serialization and backend-configuration behavior have separate retained tests.TorchCheckpointingManagerTest.test_legacy_config_has_no_backend_selector: Remove because absence of two old attribute names does not establish correct backend selection. Retained test_config_builds_independent_manager and save/load tests check which manager actually runs.tests/unit_tests/cpu/components/data/test_grain_data.pytest_hf_lineage_fields_are_serialized: Remove because both sources use the unchanged generic serializer: nested-config serialization tests cover that mechanism, and test_hf_explicit_fields_are_passed_to_load_dataset checks all four HF fields for both sources.tests/unit_tests/cpu/components/data/test_mm_dataset_preprocessing.pyTestProcessMmSampleTemporalPatchSize.test_process_mm_sample_forwards_configured_temporal_patch_size: Remove because correct preprocessing may inline or replace this helper; test_image_placeholders_match_across_temporal_patch_sizes checks the resulting placeholders without requiring that call structure.tests/unit_tests/cpu/components/data/test_qwen_multimodal_data.pytest_multimodal_registry_does_not_enable_packing: Remove because test_qwen_recipe_geometry_matches_dataset_processor already reads every registered processor, including cc12m, and catches an incompatible packing wrapper. Requiring one concrete config class adds no independent usable-registry check.tests/unit_tests/cpu/components/optim/test_lr_scheduler.pyTestLRScheduler.test_optimizer_package_import_path: Remove because retained mixed-optimizer scheduler tests import LRSchedulersContainer from the public package, build it and verify learning-rate behavior; fresh-process tests cover its import order. The extra assertion only fixes identity with the leaf-module class.tests/unit_tests/cpu/components/optim/test_optimizer_param_groups.pyTestOptimizersContainerWithParamGroups.test_build_optimizer_default_groups: Remove because TestOptimizerConfig.test_catch_all_optimizer already checks the same group count plus parameter selection and hyperparameters, so this weaker case adds no coverage.tests/unit_tests/cpu/components/test_renderer.pytest_from_renderers_returns_adapter: Remove because test_custom_renderer_builds_the_same_renderer_from_its_serialized_config calls the factory and uses its result; an additional wrapper-type/input-identity assertion unnecessarily fixes its representation.tests/unit_tests/cpu/config/test_parallelism_config.pytest_parallelism_config_default_load_balancer: Remove because a different valid default load balancer should not fail a None-value snapshot; TestDecoderCpSharding checks configured balancing and metadata handling.test_parallelism_config_default_schedule: Remove because selecting another supported default schedule is legitimate; retained schedule-validation tests and pipeline integrations cover supported choices without fixing the default string.test_parallelism_config_disables_fsdp_symm_mem_by_default: Remove because enabling this CUDA-only option by default already breaks retained CPU config construction. test_enable_fsdp_symm_mem_scope also checks that scope=None leaves symmetric communication disabled.test_parallelism_config_rejects_unknown_schedule_when_pp_disabled: Remove because test_parallelism_config_rejects_invalid_schedule already rejects invalid schedules with the default PP=1, making this another copy of the same case.tests/unit_tests/cpu/config/test_transforms.pyTestPublicApi.test_relation_graph_is_not_caller_configurable: Remove because adding a valid optional argument need not change transform behavior; ordering and composition tests should determine correctness, not the permanent absence of a parameter name.tests/unit_tests/cpu/models/common/test_cp_attention.pyTestCpGroup.test_cp_attention_holds_no_mesh_state: Remove because it checks only that CPInnerAttention.dict lacks the name cp_group; it cannot detect group state stored on an instance or under another name. Retained mesh-lookup and no-active-group tests check observable group behavior.TestUlysses.test_is_still_a_flex_kernel: Remove because the retained Ulysses redistribution test builds the same concrete kernel and executes its Flex-dispatch path; this additional config-inheritance check adds no numerical or dispatch coverage.TestUlysses.test_shared_base_is_a_cp_attention: Remove because test_ptrr_prefers_ulysses_full_metadata reaches Decoder._cp_shard, which requires the selected Ulysses kernel to implement CPInnerAttention. That retained consumer check guards the CP capability; redistribution alone would not establish it.TestUlyssesVarlen.test_is_still_a_varlen_kernel: Remove because test_dispatches_to_varlen_inner_attention executes the concrete Ulysses Varlen wrapper and checks its exact backend call and metadata. The additional config-inheritance assertions are weaker than that dispatch check.tests/unit_tests/cpu/models/flux/test_flux_mxfp8_readme.pytest_flux_mxfp8_readme_custom_example_uses_converters: Remove because harmless documentation rewrites can fail its string checks, while an invalid Python example can still pass. It neither executes the example nor verifies converter behavior.tests/unit_tests/cpu/observability/test_profiler.pyTestProfilerConfig.test_build_returns_profiler_instance: Remove because Configurable tests already cover the inherited build mechanism, while enabled-profiler tests check actual handles; a separate owner-type assertion adds no profiler-specific behavior.TestProfilerConfig.test_custom_field_values: Remove because it sets dataclass fields and reads the same values without using the profiler. Retained tests exercise enabled handles and memory-frequency selection; the removed assertions do not check schedule-option forwarding.TestProfilerDisabledPaths.test_build_memory_profiler_disabled_returns_none: Remove because test_context_manager_step_is_noop already enters the disabled path, checks both handles are None and calls step, covering this weaker assertion.TestProfilerDisabledPaths.test_build_torch_profiler_disabled_returns_none: Remove because test_context_manager_step_is_noop already checks the disabled torch-profiler handle while exercising context entry and stepping.TestProfilerDisabledPaths.test_default_args_context_manager: Remove because test_context_manager_step_is_noop executes the same context-manager path and adds handle/identity assertions.TestProfilerDisabledPaths.test_exit_resets_profiler_attrs: Remove because both handles start as None, so a broken cleanup implementation could still pass; the disabled context path is already covered.TestProfilerDisabledPaths.test_step_noop_when_both_profilers_none: Remove because test_context_manager_step_is_noop already calls step twice with both profilers disabled.TestProfilerInit.test_default_runtime_attrs: Remove because test_active_updates_runtime_args already asserts the initial step and folder values, while the default-context test checks usable disabled handles. Production starts the profiler by building and immediately entering it, so this additional pre-entry field snapshot adds no exercised caller behavior.tests/unit_tests/cpu/observability/test_structured_logging.pyTestStepTags.test_step_tags_are_tuples: Remove because the retained add-tag and multiple-tag tests already assert exact tuple results, and the concurrent-task test checks isolation. A shared mutable list would fail those existing assertions.tests/unit_tests/cpu/recipes/test_debug_config_defaults.pytest_debug_config_default_seq_len: Remove the duplicated list of debug-factory signature defaults. It does not construct a model or enforce a resource bound, and changing the shared constant would pass every assertion.test_graph_trainer_debug_config_default_seq_len: Remove because it requires every graph recipe to repeat the shared debug-length constant; it neither imposes a context limit nor exercises training, and valid per-model defaults would fail it.tests/unit_tests/cpu/recipes/test_inference_moe.pyTestInferenceMoEComposition.test_grouped_linears_and_dispatcher_are_siblings: Remove because this case rechecks grouped projections created by its own fixture and the dispatcher class explicitly passed to the transform. Retained composition tests execute that transform and verify the fused activation and generator/trainer dispatch modes.tests/unit_tests/cpu/test_gc_freq.pytest_training_engine_owns_garbage_collector_defaults: Remove because it snapshots GC field ownership and the default interval rather than running collection. Retained tests validate frequencies, build the collector and verify debug collection and freeze behavior.tests/unit_tests/cpu/test_integration_test_definitions.pytest_b200_tests_are_registered_in_separate_suite: Remove the exact suite-name inventory: adding a valid B200 case fails it, while changing a case to the wrong backend can still pass. The actual B200 jobs remain; this deletion stops pinning the complete name list.test_flux_fake_pg_filters_real_collective_cases: Remove because the runner rejects fake-PG checkpoint jobs, which covers the current Flux entry; requiring every future Flux case to stay outside fake PG is broader than that constraint.test_h100_tests_are_registered_in_separate_suite: Remove the exact suite-name inventory and obsolete-attribute checklist. They pin registration layout without verifying the advertised backends; the H100 jobs and their backend-specific execution remain.test_llama3_debug_config_defaults_to_short_context: Remove because integration recipes explicitly select their context lengths; this additional 2048 snapshot checks no model output or resource bound.test_llama3_pp_numerics_has_one_microbatch_per_stage: Remove because the retained models-suite PP numerical job uses this exact recipe, and Schedule1F1B rejects fewer microbatches than stages. The standalone inequality adds no extra validity check.Core GPU: 11 test functions
tests/unit_tests/gpu/models/common/test_async_linear.pyTestAsyncTensorParallelConfig.test_projection_boundaries_survive_lora_config_wrappers: Remove because retained CPU LoRA tests check adapter redistribution and execute a real TP forward/backward with and without sequence parallelism. This extra case applies only LoRA and snapshots outer None fields; it does not exercise async TP or additional communication.TestAsyncTensorParallelConfig.test_sharding_setup_declares_common_communication_contracts: Remove because the enabled dist_gemm integration builds and parallelizes the actual async recipe, while CPU transform tests assert the selected Async projection types. The removed None-field checklist is not a collective count; equal-layout metadata emits no collective.TestAsyncTensorParallelSharding.test_parallelize_keeps_async_collectives_in_projection_leaves: Remove because the enabled H100 dist_gemm job uses this exact recipe and real parallelization. The old test only pins metadata to None and would still pass if the recipe selected synchronous projections; CPU transform tests separately guard Async type selection.TestAsyncTensorParallelSharding.test_w13_tp_shards_the_matrix_row_dimension: Remove because test_stacked_w13_typechecks builds the same FFN, runs real _parallelize, and executes forward/backward on its two-rank CPU fallback. The retained GPU numerical test additionally checks exact weight-gradient slices when explicitly run on two GPUs.tests/unit_tests/gpu/models/kimi_k3/test_kimi_k3.pyTestKimiK3.test_varlen_config_uses_mla_backend: Remove because retained CPU builder tests require Kimi MLA/default Varlen, and test_flex_attention_mask builds the explicit Flex branch and requires actual BlockMask metadata. These checks exercise both backend selections without another config-only permutation.tests/unit_tests/gpu/recipes/test_fused_swiglu.pyTestFusedSwiGLU.test_gate_up_projection_is_linear: Remove because the fixture itself selects Linear.Config, while retained state-dict tests already build the expected physical W13 shape and check both parameter keys and storage aliasing. The extra projection-class assertion adds no fused-activation behavior.TestFusedSwiGLU.test_preserves_converted_linear_config: Remove because fused_swiglu receives only the activation config and cannot replace the sibling projection. The test explicitly installs its converted Linear config itself, so it does not exercise a converter-preservation path.TestFusedSwiGLU.test_replaces_only_activation: Remove because test_hf_adapter_roundtrip invokes the same factory, builds the model, and explicitly asserts FusedSwiGLU before checking checkpoint conversion; this standalone return-type assertion is duplicated.TestFusedSwiGLU.test_strict_load_reports_missing: Remove because missing-key rejection comes from inherited PyTorch load_state_dict; neither the FFN nor fused activation implements special loading. Retained tests cover the TorchTitan-specific native/fused checkpoint layout.TestFusedSwiGLUDistGemmComposition.test_dist_gemm_config_keeps_overlap: Remove because CPU transform tests already require AsyncColumn/Row configs, and the HF-adapter test checks the fused activation type. The activation factory cannot modify sibling projections; the extra combination adds no independent conversion path.tests/unit_tests/gpu/recipes/test_fused_swiglu_override.pyTestFusedSwiGLUOverride.test_swiglu_config_is_replaced: Remove because test_hf_adapter_roundtrip invokes the same factory, builds the model, and explicitly asserts FusedSwiGLU before checking checkpoint conversion; this standalone return-type assertion is duplicated.RL CPU: 8 test functions
tests/rl/unit_tests/cpu/test_bin_scheduler.pytest_greedy_can_have_a_higher_maximum_than_zigzag: Remove because it requires a known worse partition and would reject a balancing improvement; test_three_pp_microbatches_balance_accumulated_cost retains the useful balancing check.tests/rl/unit_tests/cpu/test_generator.pytest_generator_defaults_to_the_vllm_engine: Remove because retained recipe-construction and RL integration tests already require a usable default engine. The class-identity snapshot adds no independent execution check.test_vllm_uneven_decode_tp_padding: Remove the CPU-suite copy: the same token-count and finite-logprob assertions remain in the GPU suite, with an explicit four-GPU workflow launch.tests/rl/unit_tests/cpu/test_metrics.pyTestMetricsProcessorBuild.test_console_log_keys_round_trip: Remove because TestIsValidationSwitch checks actual console selection from both allow lists, while test_default_builds_no_backends already covers the empty-backend assertion.test_metric_backend_is_base_logger: Remove the alias-identity assertion; TestMetricsProcessorFanOut retains observable dispatch and failure-isolation checks without fixing the backend to one class object.tests/rl/unit_tests/cpu/test_trainer.pytest_rl_trainer_accepts_core_sdc_replay_config: Remove because it only assigns a replay config and reads back its type; it cannot detect whether the RL trainer ever runs replay for that model/debug/graph combination.test_rl_trainer_uses_training_engine_config_defaults: Remove because it repeats TrainingEngine's inherited boolean default using a mock model; RL supplies no separate defaulting behavior. The test does not exercise graph capture.test_trainer_has_thin_actor_adapter: Remove the inheritance-tree checklist; retained forward/backward, state-restoration and close tests check contracts that remain meaningful across equivalent implementations.Experiments: 3 test functions
torchtitan/experiments/graph_trainer/tests/test_autoparallel.pytest_autoparallel_integration_matrix: Remove because it fixes only two job names and GPU counts and passes while both jobs are disabled. Retained pass/policy tests inspect AutoParallel behavior; this list snapshot does not establish execution.torchtitan/experiments/graph_trainer/tests/test_chunked_loss.pyTestChunkedLossWrapperWithParamGrads.test_config_builds_param_grads_loss: Remove because the enabled dense-Llama GraphTrainer numerical test loads the real recipe, builds its specialized chunked loss, binds lm_head, and computes explicit parameter gradients before comparing 20 training steps. A Config owner falling back to the base wrapper fails that execution path.torchtitan/experiments/torchft/tests/test_torchft_trainer.pytest_ft_trainer_composes_specialized_training_engine: Remove because test_ft_applies_ffn_lora_override_before_model_build enters the real FaultTolerantTrainer-to-engine initialization path, while retained tests check the FT all-reduce hook and replica-loss behavior. The two inheritance assertions add no engine-selection check.Integration task (8 GPUs)
features / 3dintests/integration_tests/features.py: remove becausepp_dp_tpruns the same FSDP=2/TP=2/PP=2 training configuration and additionally checks save/resume; another 8-GPU run adds no distinct coverage. Its unused factoryllama3_debugmodel_fsdp2_tp2_pp2is also removed.Numerics / performance
This change removes redundant test definitions, moves CPU-runnable tests, and updates test guidance; it does not modify a training implementation or numerical golden. Retained GPU forward/backward and checkpoint parity tests were exercised as described below. No before/after training-loss comparison, full integration matrix or end-to-end performance measurement was run. No measured runtime saving is claimed.
Testing
8e3da8b50b: conflict-related CPU testsff96670a26ff96670a26SKIP=pyrefly-check pre-commit run --all-filespassed; full pre-commit was attempted, but Pyrefly failed while traversing local virtualenv/dependency treesgit diff --check; Python AST comparison verifies all retained test bodies/decorators are unchangedExact commands for the review-feedback changes, after activating the workspace runtime:
CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=1 pytest tests/unit_tests/cpu/recipes/test_fused_swiglu.py tests/rl/unit_tests/cpu/test_metrics.py -q --tb=short CUDA_VISIBLE_DEVICES=0 OMP_NUM_THREADS=1 pytest tests/unit_tests/gpu/recipes/test_fused_swiglu.py -q --tb=short SKIP=pyrefly-check pre-commit run --all-filesEarlier representative commands:
pytest tests/unit_tests/cpu/components/checkpointer/test_checkpoint.py::TestCheckpointManagerEMAResumeFlexibility tests/unit_tests/cpu/models/common/test_cp_attention.py::TestAllGatherCollective -q --tb=short CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=1 pytest \ tests/unit_tests/gpu/models/common/test_async_linear.py \ tests/unit_tests/gpu/models/kimi_k3/test_kimi_k3.py \ tests/unit_tests/gpu/recipes/test_fused_swiglu.py \ tests/unit_tests/gpu/recipes/test_fused_swiglu_override.py -q --tb=short CUDA_VISIBLE_DEVICES='' OMP_NUM_THREADS=1 pytest \ tests/rl/unit_tests/cpu/test_model_defaults.py \ tests/rl/unit_tests/cpu/test_rl_dist_moe_recipe.py -q --tb=short SKIP=pyrefly-check pre-commit run --all-filesCoverage limits
multi_gpumarker: current single-GPU CI skips them and multi-GPU CI deselects them. Collection with the current multi-GPU filter confirmed zero selected cases in the two relevant files. They remain available for explicit developer runs; the deletion reasons cite enabled CPU/Gloo checks and the H100dist_gemmintegration where applicable.Existing environment failures
renderers.CustomRendererConfigandattn_gym.sparse.gather_attnAPIs. These affect four files in the reduced CPU sweep.CustomRendererConfig; two autoparallel cases fail becauseautoparallelis not installed; the Dist-MoE graph registration case needs a GPU. All five fail onff96670a26as well; the GPU rerun of registration passes.TypeError: l2norm() got an unexpected keyword argument 'autotune', identically on the base commit.CustomRendererConfigimport. That test file and the imported recipe are unchanged from the base commit. The optionaldist_moemodule is unavailable, so its recipe guard is skipped locally.