test: deduplicate suites and prune low-value cases

- extract shared helpers for dataset writers, scheduler construction, thread interleaving, hf roundtrips, and moe configs
- remove about 20 cases whose only assertions were format checks, restated declarations, fake-taxonomy duplicates, or test-local scaffolding
- strengthen weak cases into exact reference comparisons, positional mask checks, and deterministic outcomes
- replace two schedule factory smoke tests with cosine/sgdr formula assertions
- delete root-level CLI tests whose merge-priority facts are covered by tests/config/test_cli.py
- suite shrinks from 857 to 826 items; ruff format, import order, and pytest all green
This commit is contained in:
2026-09-03 21:54:14 +08:00
parent 28d11f1610
commit 9d3ae76683
22 changed files with 407 additions and 1027 deletions
+3 -1
View File
@@ -369,7 +369,9 @@ def test_moe_component_forward_returns_ffn_output():
output = moe(torch.randn(2, 8, 8))
assert output["hidden_states"].shape == (2, 8, 8)
assert output["aux_loss"] is not None
assert output["aux_loss"].ndim == 0
assert output["aux_loss"].requires_grad
assert torch.isfinite(output["aux_loss"])
@pytest.mark.parametrize("decoder_sparse_step", [0, -1])
+3 -1
View File
@@ -332,4 +332,6 @@ def test_collect_lora_info():
info = _collect_lora_info(model)
assert "q_proj" in info
assert "o_proj" in info
assert "q_proj" in info # each layer has one
# every decoder layer contributes one of each attention projection
assert len(info["q_proj"]) == len(info["o_proj"]) == 2
assert all(name.endswith("attention.q_proj") for name in info["q_proj"])