Skip to content

Changes to support fsdp+qlora and dsz3+qlora - #1550

Merged
pacman100 merged 11 commits into
mainfrom
smangrul/fsdp_dsz3_qlora
Mar 13, 2024
Merged

pacman100 merged 11 commits into
mainfrom
smangrul/fsdp_dsz3_qlora

Conversation

@pacman100

Copy link
Copy Markdown
Contributor

What does this PR do?

  1. With the latest bitsandbytes version, the storage data type of 4-bit params is no longer fixed to unit8 as users can now use half or full precision in scenarios like FSDP+QLoRA. As such, this PR fixes the calculation of the number of parameters.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

Comment thread src/peft/peft_model.py Resolved
@pacman100
pacman100 marked this pull request as draft March 12, 2024 12:10

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work thanks @pacman100 ! 🚀

Comment thread docs/source/accelerate/fsdp.md Resolved

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left few nits on the docs

Comment thread docs/source/accelerate/fsdp.md Resolved
Comment thread docs/source/accelerate/fsdp.md Resolved
@pacman100
pacman100 marked this pull request as ready for review March 12, 2024 16:10

@BenjaminBossan BenjaminBossan left a comment •

Copy link
Copy Markdown
Member

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 amount of work you put into this, Sourab, to show how users can get DS Z3 to work with QLoRA.

I think there are a few issues in the descriptions, but nothing major, please take a look. Also, this requires the most recent version of bnb, right? Also, not sure, but probably requires accelerate, trl and transformers from source? Could be useful to mention the version requirements in the docs.

Comment thread docs/source/accelerate/deepspeed.md Resolved
Comment thread docs/source/accelerate/deepspeed.md Resolved
Comment thread docs/source/accelerate/deepspeed.md Resolved
Comment thread docs/source/accelerate/deepspeed.md Resolved
Comment thread docs/source/accelerate/fsdp.md Resolved
Comment thread docs/source/accelerate/fsdp.md Resolved
Comment thread docs/source/accelerate/fsdp.md Resolved
Comment thread docs/source/accelerate/fsdp.md Resolved
Comment thread docs/source/accelerate/fsdp.md Resolved
Comment thread docs/source/accelerate/deepspeed.md Resolved
pacman100 and others added 2 commits March 13, 2024 13:06
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
@pacman100

Copy link
Copy Markdown
Contributor Author

Also, this requires the most recent version of bnb, right? Also, not sure, but probably requires accelerate, trl and transformers from source? Could be useful to mention the version requirements in the docs.

Addressed this in the latest commit.

@BenjaminBossan BenjaminBossan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments, this looks great.

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge work ! 🚀

@pacman100
pacman100 merged commit 6008f27 into main Mar 13, 2024
BenjaminBossan added a commit to BenjaminBossan/peft that referenced this pull request Mar 15, 2024
* changes to support fsdp+qlora and dsz3+qlora

* address comments

* add example and start docs

* quality

* deepspeed fixes

* dsz3+qlora docs

* section link fix

* add fsdp+qlora docs

* Apply suggestions from code review

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>

* address comments

---------

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
Guy-Bilitski pushed a commit to Guy-Bilitski/peft that referenced this pull request May 13, 2025
* changes to support fsdp+qlora and dsz3+qlora

* address comments

* add example and start docs

* quality

* deepspeed fixes

* dsz3+qlora docs

* section link fix

* add fsdp+qlora docs

* Apply suggestions from code review

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>

* address comments

---------

Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants