-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Fix quantization w/ DeepSpeed not working #32640
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This fixed the issue with finetuning I reported here, 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.
Thanks for fixing this ! Left a comment
if ( | ||
not (hasattr(model, "hf_quantizer") and model.hf_quantizer.is_trainable) | ||
and is_deepspeed_zero3_enabled() | ||
and not getattr(model, "_transformers_zero3_init_used", True) | ||
): |
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.
What's the difference when the model is quantized vs no quantized ?
For my own understanding - why doesn't the user need to create the model after TrainingArguments in the quantized case but does in the unquantized case? |
Quantized weights aren't thrown into the |
Closing since we're doing a full revert |
What does this PR do?
This PR tweaks the logic check introduced in #32299 to specifically exclude when Zero-3 is enabled and we're using a quantization method (which skips this chunk of the zero3 init use)
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@SunMarc can you check if what I've done here makes sense given the comment we're trying to fix?
#32299 (comment)
I believe so and I think the test makes sense, but you're quant eyes would be appreciated :)