-
Notifications
You must be signed in to change notification settings - Fork 177
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
support exlusion of params when using low bit optim #1225
base: main
Are you sure you want to change the base?
support exlusion of params when using low bit optim #1225
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1225
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @nighting0le01! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! Left some small comments.
self.exclude_low_bit_optim_params_ids = set( | ||
id(p) for p in exclude_low_bit_optim_params | ||
) if exclude_low_bit_optim_params else set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can hash tensor directly (it will use object id internally). PyTorch optimizer already hashes tensors when it uses params as keys in self.state
.
@gau-nernst shall i also add configurable min_8bit_size like https://github.com/bitsandbytes-foundation/bitsandbytes/blob/9568735b21b9325e4789d6a5004517f2287f47c8/bitsandbytes/optim/optimizer.py#L603 over here :
|
@nighting0le01 Adding something like Do you mind rebase/merge from main and make sure the tests pass? |
Ruff format and lint on some high traffic files
Update pre-commit to match CI/CD
stack-info: PR: pytorch#1228, branch: drisspg/stack/19
hi @gau-nernst !
|
|
stack-info: PR: pytorch#1228, branch: drisspg/stack/19
stack-info: PR: pytorch#1228, branch: drisspg/stack/19
This PR allows, exclusion and inclusion of params layerwise when using low bit optimizers. this will allow for improving stability by running certain layers with 32 bit adam. https://huggingface.co/docs/bitsandbytes/main/en/optimizers