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:
@@ -23,9 +23,9 @@ def test_gradient_checkpointing_enable_disable(test_model):
|
||||
for layer in model.layers:
|
||||
callback._enable(layer)
|
||||
|
||||
for layer in model.layers:
|
||||
for i, layer in enumerate(model.layers):
|
||||
assert hasattr(layer, "_original_forward")
|
||||
assert layer.forward is not originals[0]
|
||||
assert layer.forward is not originals[i]
|
||||
|
||||
for layer in model.layers:
|
||||
callback._disable(layer)
|
||||
@@ -110,6 +110,10 @@ def test_gradient_checkpointing_trainer_integration(
|
||||
)
|
||||
|
||||
trainer = Trainer(train_config)
|
||||
gc_callbacks = [
|
||||
c for c in trainer.callbacks if isinstance(c, GradientCheckpointingCallback)
|
||||
]
|
||||
assert gc_callbacks and gc_callbacks[0].modules == (DecoderBlock,)
|
||||
trainer.train()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user