Grad overflow on iteration occurs frequently?
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 1.5k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
Hi, Grad overflow on iteration occurs almost every step in my experiments, and the result is bad, what's going on? Thanks for your reply.
Epoch 1/20
0% 0/184 [00:00<?, ?it/s]
Grad overflow on iteration 0
Using dynamic loss scale of 65536
1% 1/184 [00:00<01:34, 1.93it/s, loss=4.215]
Grad overflow on iteration 1
Using dynamic loss scale of 32768.0
1% 2/184 [00:00<01:24, 2.15it/s, loss=4.174]
Grad overflow on iteration 2
Using dynamic loss scale of 16384.0
4% 8/184 [00:03<01:14, 2.35it/s, loss=4.251]
Grad overflow on iteration 8
Using dynamic loss scale of 8192.0
8% 14/184 [00:05<01:02, 2.72it/s, loss=3.725]
Grad overflow on iteration 14
Using dynamic loss scale of 4096.0
8% 15/184 [00:05<00:58, 2.87it/s, loss=3.562]
Grad overflow on iteration 15
Using dynamic loss scale of 2048.0
9% 16/184 [00:06<01:10, 2.38it/s, loss=3.418]
Grad overflow on iteration 16
Using dynamic loss scale of 1024.0
9% 17/184 [00:06<01:09, 2.41it/s, loss=3.292]
Grad overflow on iteration 17
Using dynamic loss scale of 512.0
10% 18/184 [00:07<01:06, 2.50it/s, loss=3.187]
Grad overflow on iteration 18
Using dynamic loss scale of 256.0
10% 19/184 [00:07<01:08, 2.40it/s, loss=3.098]
Grad overflow on iteration 19
Using dynamic loss scale of 128.0
11% 20/184 [00:08<01:07, 2.44it/s, loss=3.017]
Grad overflow on iteration 20
Using dynamic loss scale of 64.0
12% 22/184 [00:08<01:06, 2.45it/s, loss=2.866]
Grad overflow on iteration 22
Using dynamic loss scale of 32.0
12% 23/184 [00:09<01:11, 2.26it/s, loss=2.791]
Grad overflow on iteration 23
Using dynamic loss scale of 16.0
13% 24/184 [00:09<01:07, 2.37it/s, loss=2.718]
Grad overflow on iteration 24
Using dynamic loss scale of 8.0
17% 32/184 [00:13<00:59, 2.55it/s, loss=2.405]
Grad overflow on iteration 32
Using dynamic loss scale of 4.0
20% 37/184 [00:15<01:12, 2.02it/s, loss=2.350]
Grad overflow on iteration 37
Using dynamic loss scale of 2.0
21% 38/184 [00:16<01:24, 1.72it/s, loss=2.312]
Grad overflow on iteration 38
Using dynamic loss scale of 1.0
22% 40/184 [00:17<01:10, 2.05it/s, loss=2.245]
Grad overflow on iteration 40
Using dynamic loss scale of 1
22% 41/184 [00:17<01:13, 1.96it/s, loss=2.211]
Grad overflow on iteration 41
Using dynamic loss scale of 1
23% 42/184 [00:18<01:08, 2.06it/s, loss=2.175]
Grad overflow on iteration 42
Using dynamic loss scale of 1
25% 46/184 [00:19<00:57, 2.41it/s, loss=2.082]
Grad overflow on iteration 46
Using dynamic loss scale of 1
26% 48/184 [00:20<00:56, 2.41it/s, loss=2.040]
Grad overflow on iteration 48
Using dynamic loss scale of 1
27% 49/184 [00:21<00:58, 2.30it/s, loss=2.022]
Grad overflow on iteration 49
Using dynamic loss scale of 1
27% 50/184 [00:21<00:58, 2.29it/s, loss=2.002]
Grad overflow on iteration 50
Using dynamic loss scale of 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by reproducing the reported mixed-precision training run and inspect the dynamic loss-scale behavior around the logged gradient overflows; done means explaining whether the repeated overflows are expected and why they produce a bad result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100