Skip to content
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

[Core] Enhancements and refactoring of LoRA method #695

Merged

Conversation

pacman100
Copy link
Contributor

@pacman100 pacman100 commented Jul 13, 2023

What does this PR do?

  1. Adds and improves utils for LoRA
  2. Refactors LoRA for simplicity and removing redundancies.
  3. Adds relevant docs.

1. Refactor LoRA code
2. Add method to delete LoRA adapters
3. Add method to unload the PEFT LoRA model.
4. Add `svd` weighted adapter support.
5. minor fixes
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 13, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

The refactoring looks nice ! I left one suggestion, also can you make sure slow tests pass just in case?
We could also add tests for delete_adapter / unload but can be done in a follow up PR I think

src/peft/peft_model.py Outdated Show resolved Hide resolved
src/peft/tuners/lora.py Show resolved Hide resolved
Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Very nice addition. This should give users much better control about how they deal with the adapters. I like it a lot.

I left a few comments, please take a look. I would also like to see tests for the new functionality, but I would be okay with them being added in a later PR.

docs/source/conceptual_guides/lora.mdx Show resolved Hide resolved
src/peft/peft_model.py Outdated Show resolved Hide resolved
src/peft/tuners/lora.py Outdated Show resolved Hide resolved
src/peft/tuners/lora.py Outdated Show resolved Hide resolved
src/peft/tuners/lora.py Outdated Show resolved Hide resolved
src/peft/tuners/lora.py Show resolved Hide resolved
pacman100 and others added 2 commits July 14, 2023 11:48
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
@BenjaminBossan
Copy link
Member

@pacman100 Nice additions, especially the tests. Some are still failing, could you please check?

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Outstanding work, LGTM

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

This looks great to me, amazing work !

@pacman100 pacman100 merged commit 86ad5ce into main Jul 14, 2023
11 checks passed
@pacman100 pacman100 deleted the smangrul/lora-weighted-and-delete-adapter-functionality-updates branch July 17, 2023 09:46
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