deepspeedai / deepspeedai/DeepSpeed

[BUG] fp16 optimizers: printing log info on all ranks

Open
#1,533 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

These get printed to all ranks:

./deepspeed/runtime/fp16/unfused_optimizer.py:                            f"No Grad overflow for {self.scale_window} iterations")
./deepspeed/runtime/fp16/fused_optimizer.py:                            f"No Grad overflow for {self.scale_window} iterations")
./deepspeed/runtime/fp16/unfused_optimizer.py:                            f"Increasing dynamic loss scale from {prev_scale} to {self.cur_scale}"
./deepspeed/runtime/fp16/fused_optimizer.py:                            f"Increasing dynamic loss scale from {prev_scale} to {self.cur_scale}"

so hundreds of these get printed on a many node setup.

can we please make these print on global rank 0 only?

update: there are other places as well:

[2021-11-08 18:30:01,688] [INFO] [unfused_optimizer.py:199:step] [deepspeed] fp16 dynamic loss scale overflow! Skipping step. Attempted loss scale: 65536.0, reducing to 32768.0
[2021-11-08 18:30:01,688] [INFO] [unfused_optimizer.py:275:_update_scale] Grad overflow on iteration: 2983
[2021-11-08 18:30:01,688] [INFO] [unfused_optimizer.py:276:_update_scale] Reducing dynamic loss scale from 65536.0 to 32768.0

so it's probably in many places...

Thank you!

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 with deepspeed/runtime/fp16/unfused_optimizer.py and deepspeed/runtime/fp16/fused_optimizer.py, inspecting the listed dynamic loss-scale logging sites and nearby overflow handling. Search the fp16 optimizer code for other related log messages, then verify in distributed training that these messages are emitted only on global rank 0 while optimizer behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.