fix(optim): mark unused amsgrad/optim_bits as deprecated in 8-bit Adam classes - #2063
Open
kritikagarg wants to merge 1 commit into
Open
Conversation
…bit Adam classes Replace misleading "Note:" docstring entries with proper `.. deprecated::` Sphinx directives in Adam8bit, PagedAdam8bit, AdamW8bit, and PagedAdamW8bit. These parameters exist only for signature compatibility with the base Adam/AdamW classes and will be removed in a future version. Add test coverage for the Adam8bit/AdamW8bit parameter validation guards which previously only existed for LAMB8bit and Adagrad8bit. Fixes bitsandbytes-foundation#1261
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.
Summary
.. deprecated::Sphinx directives inAdam8bit,PagedAdam8bit,AdamW8bit, andPagedAdamW8bitWhat's the problem?
The
amsgradandoptim_bitsparameters in the 8-bit Adam optimizer classes have docstrings that describe them as functional parameters with a small "Note:" afterthought. This is misleading — these params exist only for signature compatibility with the baseAdam/AdamWclasses and are completely non-functional (hardcoded to 8-bit, amsgrad raises ValueError).Changes
.. deprecated::directives that clearly communicate these params will be removed in a future versiontest_adam8bit_rejects_amsgrad,test_adam8bit_rejects_non_default_optim_bits,test_adamw8bit_rejects_amsgrad,test_adamw8bit_rejects_non_default_optim_bitsNo breaking changes — params remain in the signature for backwards compatibility.
Fixes #1261