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

add magnitude_prune merging method #1466

Merged
merged 3 commits into from
Feb 15, 2024
Merged

Conversation

pacman100
Copy link
Contributor

What does this PR do?

  1. In my experiments, I found that pruning task tensors based on magnitude followed by weighted sum to perform better in comparison to dare_linear or ties. This PR add a new merging method magnitude_prune which first prunes the task tensors to remove small values and retain top_k values based on the param density. After this, a weighted sum is computed and returned.

@HuggingFaceDocBuilderDev

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.

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.

Thanks for adding this new adapter merging method. Implementation-wise, this LGTM. Since your experiments show that it works well, it's a great addition.

Let's ensure that it is documented by updating the docs added via #1423, depending on which PR lands first.

Also, as mentioned in a previous PR, it would be good to add unit tests for merge_utils.py eventually.

@pacman100 pacman100 merged commit 25dec60 into main Feb 15, 2024
14 checks passed
@pacman100 pacman100 deleted the smangrul/add-magnitude-prune-linear branch February 20, 2024 05:46
BenjaminBossan pushed a commit to BenjaminBossan/peft that referenced this pull request Mar 14, 2024
* add `magnitude_prune` merging method

* Update model.py

* 😅
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.

3 participants