add Optimi(more fused_background_optimizer and new function) #1381
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://optimi.benjaminwarner.dev/
New optimizer:
adamw、lion、ranger and stableadamw from Optimi
New function:
![image](https://private-user-images.githubusercontent.com/8085926/342178323-44bd66eb-bcad-45f9-b985-060cd36916d6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzQ1NTQ3MTgsIm5iZiI6MTczNDU1NDQxOCwicGF0aCI6Ii84MDg1OTI2LzM0MjE3ODMyMy00NGJkNjZlYi1iY2FkLTQ1ZjktYjk4NS0wNjBjZDM2OTE2ZDYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MTIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDEyMThUMjA0MDE4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzkzMzMzMjZkYjgyZWViMzk0MGI0Nzc4Mzg5ZjYwNGVjYmJmZmI3MTkwMDQ1YjNhNDU4OTBhODk4NzgxNmRjNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.NuGviwKW09EkiacyI77hCYdEi0zsdTY6yz1Qg9IrvLo)
Low Precision Training with Kahan Summation(auto use when use above optimizers)
Gradient Release(same as fused background pass)
Auto use when use above optimizers.
Fully Decoupled Weight Decay(looks like decoupled lr)
Optimizer Accumulation
Gradient accumulation reduces training memory by splitting a batch into micro-batches and accumulating micro-batch gradients into the larger batch. Gradient release reduces training memory by limiting gradients to one layer at any given time. Optimizer accumulation unifies these two disparate approaches by accumulating gradients directly into optimizer states while performing gradient release.