-
Notifications
You must be signed in to change notification settings - Fork 459
Add fsdp+qlora support #160
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
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 a lot for the nice addition @deep-diver ! Would you like to add a small example on how to run FSDP + QLoRA here? https://github.com/huggingface/alignment-handbook/tree/main/scripts#fine-tuning
Let's also rename the accelerate config and then we can merge
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.
Let's call this just fsdp.yaml
since I think it will also work with full training
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.
For FSDP+QLoRA, We need to set fsdp_cpu_ram_efficient_loading=true, fsdp_use_orig_params=false and fsdp_offload_params=true(cpu offloading) when using Accelerate config according to this doc.
Since this is a recipe, I think it would be handy to provide separate yaml who wants to use FSDP+QLoRA out of the box. WDYT?
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.
Sounds great, can we then rename the file to fsdp_qlora.yaml
please?
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.
done! :)
Besides keeping or removing |
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. |
reminder |
reminder. I addressed your comments :) |
Add fsdp+qlora support (huggingface#160)
This PR is to add FSDP+QLoRA support with the following changes:
recipes/accelerate_configs/fsdp+qlora.yaml
peft>=0.9.0
andbitsandbytes>=0.43.0
dependenciesbnb_4bit_quant_storage
field inModelArguments
bnb_4bit_quant_storage
ofBitsAndBytesConfig
With these changes, I have confirmed FSDP+QLoRA works within my local setup (2 x A6000).