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

Support Rank Stabilized LoRA in the ModelConfig/LoraConfig #1877

Merged
merged 12 commits into from
Aug 6, 2024

Conversation

JohnGiorgi
Copy link
Contributor

Tiny PR to support Rank Stabilized LoRA. To do this we:

Of course, a user could always do this outside TRL, but my motivation for enabling it this way was that I am working with a slightly modified version of the sft.py script, so it would be nice if I could enable Rank Stabilized LoRA with a single flag.

@kashif
Copy link
Collaborator

kashif commented Jul 25, 2024

@JohnGiorgi do we need to pin peft to some version for this?

@JohnGiorgi
Copy link
Contributor Author

JohnGiorgi commented Jul 29, 2024

@kashif Good question! Looks like yes... v0.8.0 based on digging through the release notes. Looks like TRL currently pins it to >=0.4.0. Is that a change TRL maintainers are okay with?

@kashif
Copy link
Collaborator

kashif commented Jul 29, 2024

yes i believe we will need to pin peft to that for this PR, also could you kindly also add a test?

@JohnGiorgi
Copy link
Contributor Author

@kashif Okay I bumped the peft dependency to >=0.8.0. I also added a test for get_peft_config (which looks to be untested), which also serves as a test to ensure use_rslora is getting passed from a ModelConfig to resulting LoraConfig

@JohnGiorgi JohnGiorgi changed the title feat: support RS-LoRA in the ModelConfig Support Rank Stabilized LoRA in the ModelConfig/LoraConfig Jul 30, 2024
@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.

@kashif
Copy link
Collaborator

kashif commented Jul 30, 2024

@JohnGiorgi i believe its failing for one of the older python with:

AttributeError: 'str' object has no attribute 'removeprefix'

@JohnGiorgi
Copy link
Contributor Author

JohnGiorgi commented Jul 30, 2024

Fixed! Let me know if anything else is blocking this

"pytest",
"pytest-xdist",
"accelerate",
Copy link
Member

Choose a reason for hiding this comment

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

already in required

@qgallouedec qgallouedec merged commit b60ce79 into huggingface:main Aug 6, 2024
9 checks passed
@qgallouedec
Copy link
Member

Merged, thank you @JohnGiorgi

@JohnGiorgi
Copy link
Contributor Author

Merged, thank you @JohnGiorgi

Thank you!

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