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

make all-linear as default for target_modules #1498

Closed
wants to merge 1 commit into from

Conversation

pacman100
Copy link
Contributor

What does this PR do?

  1. Make all-linear as default for target_modules. This should make LoRA and variants work for any new model out-of-the-box.

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

@BenjaminBossan
Copy link
Member

Hmm, I'm not sure, this would break backwards compatibility, right? If we have a supported model architecture that does not target all linear layers but only a subset, using the LoraConfig defaults would suddenly target different layers. I think this would be very unexpected for users.

We could consider to leave None as default but to fall back on all-linear in case that the model architecture is not supported. But even then there can be problems. For instance, all-linear currently only works for transformers models. Also, as we saw in #1485, the function to detect all linear layers is still not quite robust. I thus don't think it's mature enough to be used as default.

My personal preference would be to leave the default the same. We could, however, improve the error message in case that the architecture is not supported by adding something like "When using a transformers model, consider setting target_layers="all-linear" to automatically add LoRA to all Linear layers".

@pacman100
Copy link
Contributor Author

pacman100 commented Feb 22, 2024

Thank you Benjamin, makes sense, closing the PR.

@pacman100 pacman100 closed this Feb 22, 2024
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