Feat: zero3 deprecate elastic checkpoint (#8099)
## Summary
This PR is a small follow-up to align ZeRO-3 checkpoint behavior with
the current project direction toward Universal Checkpointing (UCP).
It treats the ZeRO-3 `elastic_checkpoint` path as deprecated/unsupported
and updates user-facing messaging accordingly, without broad
refactoring.
## Changes
- Marked ZeRO-3 `elastic_checkpoint` usage as deprecated at config
level.
- Added a warning when:
- `zero_optimization.stage == 3`
- `zero_optimization.elastic_checkpoint == true`
- Updated ZeRO-3 error messages to explicitly point users to Universal
Checkpointing.
- Updated config documentation to label `elastic_checkpoint` as
deprecated for ZeRO-3.
- Added a focused unit test that verifies the deprecation warning path.
## Scope (Intentionally Small)
This PR **does not**:
- remove the `elastic_checkpoint` config key,
- remove/refactor Stage 1/2 legacy elastic checkpoint implementation,
- introduce checkpoint format migrations,
- change non-ZeRO-3 checkpoint flows.
## Motivation
Maintainer feedback indicated that UCP is the path forward and the older
elastic checkpoint path should be deprecated.
This PR takes the minimal first step to make behavior and messaging
consistent while keeping risk low.
## Validation
- Added targeted test coverage for ZeRO-3 deprecation warning behavior.
- Kept runtime behavior changes minimal and localized to warning/error
messaging for ZeRO-3 elastic checkpoint usage.
## Follow-ups
- Evaluate full cleanup/removal strategy for legacy elastic checkpoint
paths in a separate PR.
- Add migration guidance (elastic checkpoint -> UCP) if broader
user-facing docs are needed.
## Test Result
```
root@26a3ec8d2006:/workspace/DeepSpeed_woo# pytest -q tests/unit/checkpoint/test_zero_optimizer.py -k deprecate
================================================================== test session starts ===================================================================
platform linux -- Python 3.12.3, pytest-9.1.1, pluggy-1.6.0 -- /usr/bin/python3.12
cachedir: .pytest_cache
rootdir: /workspace/DeepSpeed_woo/tests
configfile: pytest.ini
plugins: anyio-4.12.0
collected 69 items / 68 deselected / 1 selected
tests/unit/checkpoint/test_zero_optimizer.py::test_elastic_checkpoint_is_deprecated_for_zero3 PASSED [100%]
==================================================================== warnings summary ====================================================================
<string>:8
<string>:8: PytestDeprecationWarning: A private pytest class or function was used.
unit/checkpoint/test_zero_optimizer.py::test_elastic_checkpoint_is_deprecated_for_zero3
/workspace/DeepSpeed_woo/tests/conftest.py:47: UserWarning: Running test without verifying torch version, please provide an expected torch version with --torch_ver
warnings.warn(
unit/checkpoint/test_zero_optimizer.py::test_elastic_checkpoint_is_deprecated_for_zero3
/workspace/DeepSpeed_woo/tests/conftest.py:54: UserWarning: Running test without verifying cuda version, please provide an expected cuda version with --cuda_ver
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================== slowest durations ====================================================================
(3 durations < 1s hidden.)
===================================================== 1 passed, 68 deselected, 3 warnings in 25.39s ======================================================
```
cc @sfc-gh-truwase — this is the follow-up to your comment in #8031
about deprecating elastic checkpointing.
I scoped this PR to ZeRO-3, where the path is already unsupported, and
updated the warning/error/docs/test coverage to point users to Universal
Checkpointing. Stage 1/2 legacy cleanup is intentionally left for a
separate follow-up unless you’d prefer this PR to cover it too.
Signed-off-by: nathon-lee <leejianwoo@gmail.com>