deepspeedai / deepspeedai/DeepSpeed

zero-3 always OVERFLOW!

Open
#1,235 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

when I tried my code with zero-2, everything seems ok. However, when I switched to zero-3 without changing any settings, the model always print warning info of OVERFLOW like this:
[2021-07-15 17:02:39,984] [INFO] [stage3.py:2725:_overflow_clean_up] [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 64.0, reducing to 32.0

My ds config file is :
{ "gradient_accumulation_steps": 3, "train_micro_batch_size_per_gpu": 4, "prescale_gradients": false, "zero_allow_untested_optimizer": true, "zero_optimization": { "stage":3, "contiguous_gradients": false, "allgather_bucket_size": 1.9e+08, "reduce_bucket_size": 5e+08, "overlap_comm": true, "reduce_scatter": true, "verbose": false }, "steps_per_print": 4, "gradient_clipping": 1.0, "wall_clock_breakdown": true, "optimizer": { "type": "Adam", "params": { "lr": 1e-8, "betas": [ 0.9, 0.96 ], "eps": 1.0e-8, "weight_decay": 0.01 } }, "fp16": { "enabled": true, "initial_scale_power": 8, "loss_scale_window": 100 } }

when I set the "zero_optimization": with stage=2, everything works ok. My model is about 8.3B size, and I have tried 0.4.2 and 0.4.3, but all version gives the same error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting stage3.py at _overflow_clean_up and compare the supplied ZeRO stage 2 and stage 3 configurations. Reproduce the issue with the listed gradient, bucket, optimizer, and fp16 settings; done means the repeated OVERFLOW behavior is explained and its resolution is confirmed for ZeRO stage 3.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.