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

add basic support for the optimi adamw optimizer #1727

Merged
merged 7 commits into from
Jul 14, 2024
Merged

Conversation

winglian
Copy link
Collaborator

@winglian winglian commented Jul 5, 2024

https://optimi.benjaminwarner.dev/kahan_summation/

Kahan Summation

Kahan summation2 is a technique to reduce the numerical error of adding multiple low precision numbers by accumulating errors in a separate compensation buffer. The addition of the compensation buffer increases the effective summation precision by the precision of the compensation buffer.

Using Kahan summation to improve low precision model training was first introduced by Zamirai et al in Revisiting BFloat16 Training. Zamirai et al discovered the primary source of numerical error from low precision training is during the optimizer’s model weight update step. They add Kahan summation to the SGD & AdamW weight update steps to reduce the update’s numerical inaccuracy, increasing low precision training to the equivalent of full precision training across tested models.

@winglian winglian force-pushed the optimi-optimizer branch 3 times, most recently from dfb58f9 to 5c36692 Compare July 13, 2024 01:24
@winglian winglian merged commit 78e12f8 into main Jul 14, 2024
8 checks passed
@winglian winglian deleted the optimi-optimizer branch July 14, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant