automl
automl copied to clipboard
how to train model by lion optimizer with fp16?
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!
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.