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

[peft] simple update when unscale #9689

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

sweetcocoa
Copy link
Contributor

What does this PR do?

In peft's unscale, it unnecessarily traverses modules even when weight is None.

I think a modification like this PR would logically achieve the same behavior without traversing.

It seems like a simple fix, but please review.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@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.

This should achieve the same result while avoiding unnecessary iteration. Thanks!

@sayakpaul sayakpaul merged commit 5783286 into huggingface:main Oct 16, 2024
15 checks passed
@sayakpaul
Copy link
Member

Thanks for your contributions!

sayakpaul added a commit that referenced this pull request Dec 23, 2024
Update peft_utils.py

Co-authored-by: Sayak Paul <[email protected]>
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