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

[Feature] Support additional trainable layers during LoRA fine-tuning #1901

Open
ebsmothers opened this issue Oct 24, 2024 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@ebsmothers
Copy link
Contributor

In e.g. the LongLoRA paper they fully train both the embedding and the norm layers while still applying LoRA to self-attention layers. Our recipes set only LoRA parameters to trainable here, but it shouldn't be too hard to support passing additional layers to that function from the config. E.g. it could be similar to our usage of custom_sharded_layers.

@felipemello1
Copy link
Contributor

felipemello1 commented Oct 24, 2024

when someone picks it up, have in mind that all the configs and and model builders would have to be updated. So, before doing it, please put up a draft PR, and only after you get an ok showing that it works for one model, update all the builders/recipe. This will save you a lot of work :)

Edit: we would only have to touch the builders if we implemented LoraEmbedding. My bad.

@ebsmothers
Copy link
Contributor Author

Quick edit to @felipemello1's comment: we can do this without touching the model builders (similar to the custom_sharded_layers example). Also similar to that comment, we don't have to expose in every config file -- we can instead use our usual pattern of e.g. additional_trainable_layers=cfg.get("additional_trainable_layers", None)

@RdoubleA
Copy link
Contributor

If any brave soul wants to go the extra mile, I would prefer exposing in all configs and not let hidden defaults proliferate. But I understand that it is much, much easier

@felipemello1
Copy link
Contributor

If we don’t add it to the config, I feel that the reach would be small :/

@ebsmothers ebsmothers added the enhancement New feature or request label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants