-
Notifications
You must be signed in to change notification settings - Fork 28k
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
T5 fp16 forward yields nan #4287
Comments
Thanks for the detailed error description @binshengliu! I linked a PR that should fix it :-) |
Hi, there's still some chance we get
Output:
|
Sorry I just noticed you commented #4586 (comment). I can confirm the issue I encountered is caused by the same reason. |
Hi, I have the same problem. I get NAN when using fp16. And when I set fp16=False, the NAN problem is gone. |
Yeah that's still an open problem....not sure how easy it will be to solve it, see: #4586 (comment) |
Same when fine-tuning GPT Neo. |
🐛 Bug
Information
Model I am using (Bert, XLNet ...): T5
Language I am using the model on (English, Chinese ...): English
The problem arises when using:
The tasks I am working on is:
To reproduce
I use pytorch-lightning to manage fp16. This is the minimal example that reproduces the result.
output:
Expected behavior
Get non-nan values.
Environment info
transformers
version: 2.9.0The text was updated successfully, but these errors were encountered: