-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
_is_peft_model update to recognise peft submodules, allowing training quantised models with peft submodules #30884
base: main
Are you sure you want to change the base?
Conversation
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 adding the submodules support for PEFT + Trainer ! Left one suggestion - what do you think?
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. |
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 adding! Could you add a test with a dummy model that has peft submodules that behaves correctly with this change but fails on main?
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 @ambroser53 !
For the styling checks, can you try to run pip install -U ".[quality]"
and re-run make fixup
?
@younesbelkada I've just done as you asked and it ran successfully but I have no working tree changes to commit. |
Thanks ! Hmm I think something is off with our CI currently, let's wait for #30932 being merged first |
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 iterating on this.
I'm a bit confused about the intended behaviour here from the tests
What does this PR do?
Don't necessarily have peft models as the top-level wrapper for models, especially when working with custom built multi-modal models. For example:
This allows the hf trainer to recognise such models as still being peft models and thereby allow quantised training (QLoRA).
Fixes #30878
Before submitting
Pull Request section?
to it if that's the case. -> Have
_is_peft_model
check if there's any peft submodule/Allow quantised training #30878documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@younesbelkada