FIX [PEFT / Trainer ] Handle better peft + quantized compiled models#29055
Conversation
PEFT / handle peft + compiled modelsPEFT / Trainer ] Handle better peft + quantized compiled models
|
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. |
|
LGTM! Let me know when it's out of draft and you want a final review |
|
It would be good to add a test for compiled models alongside this change |
|
Thanks @amyeroberts ! This is ready for review ! |
amyeroberts
left a comment
There was a problem hiding this comment.
Thanks for fixing and adding a test!
If it's still not yet possible to use a compiled model with bnb, then we should raise an error saying this to the user instead of letting things fail when they call .train
| # TODO: In the future (once we have bnb + compile support), uncomment this | ||
| # trainer.train() |
There was a problem hiding this comment.
If this is the case - we should raise an explicit error if using bnb + compile with trainer.
|
Thanks @amyeroberts for the review! I just adapted the PR according to your suggestion, one concern I have with this new approach is that if bnb supports |
|
@younesbelkada How soon and with what confidence do you think bnb will support this? I agree we want to avoid bloat as much as possible, but I think it's better overall to be explict and have well defined behaviour for our users. The easiest way to avoid many version checks is to only support the latest version of bnb. |
|
OK sounds good! I agree with that approach! |
|
@younesbelkada I would certainly be interested if bnb could support torch.compile! |
What does this PR do?
Fixes: #29033
Even though quantized models + compile + peft is not really stable (might not work OTB for all users), the current way we deal with peft compiled models leads to errors that are hard to interpret to users such as the one described in #29033
I will run some tests on my see to check if torch.compile + qlora is supported
cc @amyeroberts