Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretraining loss explosion #554

Open
mattgorb opened this issue Sep 13, 2024 · 2 comments
Open

Pretraining loss explosion #554

mattgorb opened this issue Sep 13, 2024 · 2 comments

Comments

@mattgorb
Copy link

mattgorb commented Sep 13, 2024

I have been trying to get this repo working for several months, but my loss keeps exploding between 30k and 100k iterations.

I have tried many things:
Turn flash attention off ( based on this issue: #524)
Using fp16 (based in this: #468)
Using GPT-4 tokenizer (based on #468)

At first the loss was going back up to about 8-10, now it is just going to NaN with fp16.

I have also tinkered with other setting such as gradient clipping, learning rate, etc. I keep my configuration at roughly 500k batch size.

I am lost on what to try next. Did anyone else fix this issue?

I have gotten GPT-2 Small down to about 3.0 loss.

@HarrisonUnifyAI
Copy link

My loss also exploded on an initial attempt with 8 A100 instance. I disabled flash attention and that seems to have fixed it, though it is much slower.

@beeeai
Copy link

beeeai commented Dec 3, 2024

@mattgorb @HarrisonUnifyAI I have not changed the default settings, other than the seed. (doing ddp on 8GPUs)
I get this explosion which starts around 30k as well. Do you think flash attention is the reason?
(The purple one is all default values, with the seed set to 1337. The blue one is another seed.)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants