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:
@@ -38,10 +38,13 @@ def test_cpu_and_training_calls_fall_back_with_gradients(monkeypatch):
|
||||
|
||||
def test_invalid_mode_warns_and_uses_auto(monkeypatch, caplog):
|
||||
monkeypatch.setenv("ASTRAI_SWIGLU", "invalid-test-mode")
|
||||
x = torch.randn(2, 8)
|
||||
up_weight = torch.randn(4, 8)
|
||||
gate_weight = torch.randn(4, 8)
|
||||
with caplog.at_level(logging.WARNING):
|
||||
actual = swiglu(torch.randn(2, 8), torch.randn(4, 8), torch.randn(4, 8))
|
||||
assert actual.shape == (2, 4)
|
||||
actual = swiglu(x, up_weight, gate_weight)
|
||||
assert "using auto" in caplog.text
|
||||
torch.testing.assert_close(actual, reference_swiglu(x, up_weight, gate_weight))
|
||||
|
||||
|
||||
def test_mlp_routes_through_swiglu_backend(monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user