Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1950
Summary
Adds Schedule-Free AdamW optimizers (
AdamWScheduleFree,AdamWScheduleFree8bit, andAdamWScheduleFree32bit) tobitsandbytes.optim, implementing the algorithm from "The Road Less Scheduled" (Defazio et al., 2024).Details
zwith signeddynamicmap,exp_avg_sqwith unsignedudynamicmap) inuint8viaF.quantize_blockwise/F.dequantize_blockwisewhenoptim_bits == 8andp.numel() >= min_8bit_size, falling back tofloat32for smaller tensors oroptim_bits == 32.optimizer.train()andoptimizer.eval()to swap parameters between the interpolated training iterateyand the averaged evaluation iteratex, with a runtime guard ifstep()is called while in eval mode.Optimizer8bitsostate_dict()/load_state_dict()wrap quantization tensors under__bnb_optimizer_quant_state__.Testing
Ran
PYTHONPATH=. pytest tests/test_schedule_free.py -von CPU:uint8/absmaxstate verification,eval()/train()guard,state_dict()round-trip, and argument validation).