Repository navigation
The default DeepSpeed preset zero2.json sets allgather_bucket_size: "auto", which neither transformers nor accelerate fills, so ZeRO-2 aborts (CR-A16-007) #410
Description
Wave 1 · theme D1-5: Training, merging and export correctness · highest severity High · 1 finding(s) · effort trivial
Summary
An operator enables DeepSpeed with the default preset, and training aborts during accelerator.prepare with a ValueError after model load, on every GPU node.
Primary finding
CR-A16-007 — The default DeepSpeed preset zero2.json sets allgather_bucket_size: "auto", which neither transformers nor accelerate fills, so ZeRO-2 aborts
severity High · reachability default · intent contract-violation · confidence confirmed · independently confirmed · reproduced with stubs
What happens. configs/deepspeed/zero2.json:36 sets "allgather_bucket_size": "auto". transformers' HfTrainerDeepSpeedConfig.trainer_config_finalize fills only reduce_bucket_size, stage3_prefetch_bucket_size and stage3_param_persistence_threshold. accelerate's DeepSpeedPlugin.fill_match raises ValueError for any remaining 'auto' key that is not in its kwargs. zero2 is also the preset used when distributed.deepspeed_config is unset (trainer.py:638-639), so distributed.strategy: deepspeed fails by default. zero3.json and zero3_offload.json resolve fully.
Where.
configs/deepspeed/zero2.json:36forgelm/trainer.py:639forgelm/trainer.py:633forgelm/trainer.py:596tests/test_distributed.py:147-178forgelm/trainer.py:530-533docs/reference/distributed_training.md:17-23
Evidence.
- Script w/ds_repro.py runs each preset through transformers' trainer_config_process/finalize (real code; deepspeed is absent, so a subclass is grafted onto accelerate's HfDeepSpeedConfig), then through accelerate's DeepSpeedPlugin.deepspeed_config_process(must_match=False, **kwargs as built in accelerator._prepare_deepspeed). Results for lower (transformers 5.3.0, accelerate 1.4.0), extras (5.13.0/1.14.0) and latest (5.18.0/1.15.0): zero2 leaves 'auto' in zero_optimization.allgather_bucket_size,…
Recommended fix. Replace 'auto' with an integer (for example 5e8) or remove the key from zero2.json. Add a test that runs the presets through the transformers/accelerate auto-fill.
Acceptance criteria
- A regression test reproduces the failure scenario and asserts the corrected behaviour.
- Documentation listed above is corrected in English and in its Turkish mirror in the same PR.
- Every finding in this issue is resolved or explicitly closed with a reason.
Found by the October 2026 ForgeLM code and documentation review against commit cab2947. Code links point at that commit; line numbers may have moved since. Finding IDs (CR-…, DOC-…, TECH-…) are stable references for this backlog.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
docs: webhooks, DeepSpeed presets, first-run output tree and --offlin…
cemililik commentedon Oct 22, 2026
Where to start
Thanks for taking a look. Claim it by starting a comment with
/assignso nobody duplicates the work.The bug.
configs/deepspeed/zero2.jsonsets"allgather_bucket_size": "auto"(line 36). transformers fills onlyreduce_bucket_size,stage3_prefetch_bucket_sizeandstage3_param_persistence_threshold, and accelerate raises aValueErrorfor any other"auto"left in the config.zero2is also the default preset (_resolve_deepspeed_configinforgelm/trainer.py), sodistributed.strategy: deepspeedaborts by default.zero3.jsonandzero3_offload.jsonare fine.What to change (decided).
zero2.json, set"allgather_bucket_size": 500000000. That is DeepSpeed's own default; keep the key.TestDeepSpeedConfigResolutionintests/test_distributed.py, next totest_all_presets_use_auto_values.zero2,zero3andzero3_offload."auto"value in the JSON, and assert that the set is a subset of the keys transformers and accelerate fill. Take that allowlist fromHfTrainerDeepSpeedConfig.trainer_config_process/trainer_config_finalizeintransformers/integrations/deepspeed.py:train_batch_size,train_micro_batch_size_per_gpu,gradient_accumulation_steps,gradient_clipping;fp16.enabled,bf16.enabled;optimizer.params.{lr,betas,eps,weight_decay};scheduler.params.{warmup_min_lr,warmup_max_lr,warmup_num_steps,total_num_steps};zero_optimization.reduce_bucket_size,zero_optimization.stage3_prefetch_bucket_size,zero_optimization.stage3_param_persistence_threshold.development(it should reportzero_optimization.allgather_bucket_sizeforzero2) and passes after your change.allgather_bucket_size: "auto", which neither transformers nor accelerate fills, so ZeRO-2 aborts (CR-A16-007) #410)" paragraph fromdocs/reference/distributed_training.md(about line 60) and the matching "Bilinen sorun" paragraph fromdocs/reference/distributed_training-tr.md;zero2preset broken from line 98 ofdocs/usermanuals/en/training/distributed.mdand ofdocs/usermanuals/tr/training/distributed.md.### Fixedline under## [Unreleased]inCHANGELOG.md: the defaultzero2preset no longer aborts ZeRO-2 start-up.Not in scope: shipping the presets in the wheel. That belongs to a Phase 16 step; please do not link it from the PR. A real ZeRO-2 run needs GPUs, which you do not need here: say in the PR that you verified the config contract on CPU.
Open the PR against
developmentwithFixes #410(findingCR-A16-007).