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

how to train model by lion optimizer with fp16? #1192

Open
Geek-lixiang opened this issue Apr 17, 2023 · 1 comment
Open

how to train model by lion optimizer with fp16? #1192

Geek-lixiang opened this issue Apr 17, 2023 · 1 comment

Comments

@Geek-lixiang
Copy link

It says "Additional, Lion still requires momentum tracking in bfloat16, which can be expensive for training giant models. One potential solution is to factorize the momentum to save memory.", how to complete the "momentum tracking"?
Thank you very much!

@xiangning-chen
Copy link
Contributor

For momentum tracking with bfloat16, you can just cast the type of momentum into bfloat16, see the example here: https://github.com/deepmind/optax/blob/master/optax/_src/transform.py#L461.

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

2 participants