DeepSpeed
54ebdec6 - Add input validation for save_checkpoint and warmup LR schedulers (#8126)

Commit
1 day ago
Add input validation for save_checkpoint and warmup LR schedulers (#8126) ## Summary Fixes #8097. Some public-facing functions silently accept invalid input (None, empty string, negative numbers) leading to confusing downstream errors or hangs. This PR adds explicit validation in two places: - `DeepSpeedEngine.save_checkpoint`: raises `ValueError` if `save_dir` is None/empty, before any rank-synchronization logic runs (prevents multi-GPU hang from partial-rank failure). - `WarmupLR.__init__` / `WarmupCosineLR.__init__`: raises `ValueError` if `warmup_num_steps` isn't a positive int. `WarmupDecayLR` inherits the check via `WarmupLR`. ## Test plan - [x] `pytest tests/unit/runtime/test_lr_schedulers.py -k warmup` — new parametrized test passes for all 3 scheduler classes - [x] `pytest --forked tests/unit/checkpoint/test_tag_validation.py` — new test added; skips locally (needs 2 GPUs, unavailable on this machine), expected to run in CI - [x] `pre-commit run` on all changed files — clean Signed-off-by: Jahnavi Yelamanchi <jahnaviyelamanchi03@gmail.com>
Parents
Loading