DeepSpeed
215f5aa9 - Remove elastic training (#8563)

Commit
38 days ago
Remove elastic training (#8563) ## Summary - Remove elastic training: the `elasticity` configuration block, the batch-size solver, the `DSElasticAgent` rendezvous agent, and the `--elastic_training` launcher surface. - Reject a leftover `elasticity` block with `DeepSpeedConfigError` instead of silently training without it. - Tracking: #8489 ### What it did Elastic training let a job declare a GPU range and a set of acceptable micro batch sizes: ```json "elasticity": { "enabled": true, "max_train_batch_size": 2000, "micro_batch_sizes": [2, 4, 6], "min_gpus": 1, "max_gpus": 10000, "version": 0.2 } ``` `compute_elastic_config` then searched for a global batch size that factors correctly at **every** GPU count in that range, so the same job kept an identical effective batch size on 8 GPUs or 512, and wrote the result over `train_batch_size`, `train_micro_batch_size_per_gpu` and `gradient_accumulation_steps`. Separately, `deepspeed --elastic_training` replaced the normal worker spawn with `DSElasticAgent`, a subclass of PyTorch's `LocalElasticAgent` doing c10d rendezvous. ### Why remove it The GitHub usage scan in #8489 found **zero** issues outside the DeepSpeed org for the `"max_train_batch_size"` + `"micro_batch_sizes"` pair, the lowest score of any candidate in that table. It was also incompatible with most DeepSpeed workloads. `DeepSpeedEngine` asserted against model parallelism and `PipelineEngine` asserted against pipeline parallelism, in both cases unless GPUs-per-node divided evenly by the elastic model-parallel size. ### Removed | Path | Lines | |---|---:| | `deepspeed/elasticity/` (6 files) | 806 | | `tests/unit/elasticity/test_elastic.py` | 289 | | `bin/ds_elastic` | 40 | | docs section in `config-json.md` | 31 | Plus the wiring: config parsing and the batch-size override in `runtime/config.py`, the two compatibility gates in `runtime/engine.py` and `runtime/pipe/engine.py`, the `--elastic_training` / `--min_elastic_nodes` / `--max_elastic_nodes` surface across `launch.py`, `runner.py` and `multinode_runner.py`, the `setup.py` scripts entry, the HPU CI selector, the `CODEOWNERS` entry, and the pre-commit exclude. ### Explicitly NOT touched - **`zero_optimization.elastic_checkpoint`** is a different feature. #8099 already removed it for ZeRO-3; ZeRO-1/2 keep it. Nothing in `deepspeed/runtime/zero/` changes here. - **The autotuning `max_train_batch_size` key** is a homonym of the elasticity one. This is why #8489 scores the pair `"max_train_batch_size" "micro_batch_sizes"` rather than either key alone. `deepspeed/autotuning/` is untouched. ### Notes for review **The launcher change is structural, not a deletion.** In `launch.py` the normal spawn path lived inside `if not args.enable_elastic_training:` with the agent in the `else`. Removing the `else` required de-indenting the normal path back to function level: 49 lines, of which 40 are non-blank and so appear in the diff. That hunk is the one worth reading closely; everything else is a straight removal. **Three things became orphaned and are removed with it.** `typing.Dict` in `launch.py` and `__version__` in `runtime/config.py` were each used only by elastic code, both flagged by flake8 as F401. `is_elastic_model_parallel_supported` in the engine lost its only caller. **`parse_num_nodes` in `runner.py` was already dead before this PR.** It existed for the `MIN:MAX` node format that only elastic training accepted, and nothing called it. **One test rename.** `test_moq_config_is_rejected` becomes `test_removed_config_keys_are_rejected`, since it now covers `quantize_training`, `eigenvalue` and `elasticity`. It already parametrizes over `None`, `{}`, `False` and `"auto"`, so the new key is covered at all four shapes. No CI selector referenced the old name. ## Test plan - [ ] `tests/unit/runtime/test_ds_config_dict.py` — the rejection test at all four values, plus the rest of the file as a regression check on `config.py` - [ ] `deepspeed --help` and a single-node `deepspeed` launch, covering the de-indented `launch.py` path - [ ] A short ZeRO training step, confirming the batch-size path still resolves with the elasticity override gone - [ ] CI unit / accelerator workflows on this PR ## Diffstat ``` 21 files changed, 48 insertions(+), 1475 deletions(-) ``` --------- Signed-off-by: pengdurice <pengduhit@gmail.com>
Author
Parents
Loading