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

Accelerated training with floating point fp16 #3

Open
milliema opened this issue Jan 10, 2021 · 2 comments
Open

Accelerated training with floating point fp16 #3

milliema opened this issue Jan 10, 2021 · 2 comments

Comments

@milliema
Copy link

Thanks for the work!
I'd like to know if the optimizer SAM is also applicable to accelerated training, i.e. using automatic mixed precision like fp16. I tried to adopt SAM in my own training codes with fp16 on Pytorch, but Nan loss happens and the computed grad norm is Nan. Regular training using SGD gives no error. So I'm wondering if it is caused by some error in the Pytorch reimplementation or is it due to the limitation of SAM?

@shuo-ouyang
Copy link

Maybe we should add a small number (such as 1e-9) to avoid divided by zero when computing errors.

@celidos
Copy link

celidos commented Aug 19, 2022

Interested in this topic too

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