Skip to content

Drop the optim_bits entry from the RMSprop32bit docstring - #2157

Open
VenishPaneliya wants to merge 1 commit into
bitsandbytes-foundation:mainfrom
VenishPaneliya:rmsprop32bit-optim-bits-doc
Open

VenishPaneliya wants to merge 1 commit into
bitsandbytes-foundation:mainfrom
VenishPaneliya:rmsprop32bit-optim-bits-doc

Conversation

@VenishPaneliya

Copy link
Copy Markdown

RMSprop32bit.__init__ documents an optim_bits argument it does not take, so the keyword the docs tell you to pass raises TypeError. The class fixes the bit width by passing 32 to Optimizer1State positionally, which is the point of the 32bit variant.

The entry is a leftover from the base RMSprop, which really does have optim_bits=32. The sibling RMSprop8bit has the identical signature, hardcodes 8 the same way, and correctly omits the entry — so this is a slip, not house style. It is the only one: I checked all 36 __init__ docstrings under bitsandbytes/optim/ and no other documents a parameter its signature lacks.

It is published API — docs/source/reference/optim/rmsprop.mdx has [[autodoc]] bitsandbytes.optim.RMSprop32bit.

>>> bnb.optim.RMSprop32bit(params, optim_bits=32)
TypeError: RMSprop32bit.__init__() got an unexpected keyword argument 'optim_bits'
>>> bnb.optim.RMSprop(params, optim_bits=32)   # base class: fine

Docstring only, no executable statement changed. ruff, ruff-format, trailing-whitespace, end-of-file-fixer, mixed-line-ending and typos all clean on the file.

RMSprop32bit takes no optim_bits argument - it passes 32 to
Optimizer1State directly - so the documented keyword raises TypeError.
The entry is a leftover from the base RMSprop class, which does take it;
the sibling RMSprop8bit has the same signature and correctly omits it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant