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

initial commit for trlx LORA support #110

Merged
merged 15 commits into from
Jan 8, 2023
Merged

Conversation

ethankim00
Copy link
Contributor

Basic support for low rank adaptation.

@LouisCastricato
Copy link
Contributor

This should take a similar form to how hydra models are built. It shouldn't be required and directly integrated into ilql or PPO model

@LouisCastricato
Copy link
Contributor

#80 Relevant issue.

@Dahoas
Copy link
Collaborator

Dahoas commented Dec 9, 2022

@ethankim00 just a gentle push on when you expect to finish this?

@cat-state
Copy link
Collaborator

cc @Sayanc93

@ethankim00
Copy link
Contributor Author

I can get to it tomorrow or Monday. I'm wondering what the API should be to avoid modifying the model definitions?

@cat-state
Copy link
Collaborator

cat-state commented Dec 14, 2022

I can get to it tomorrow or Monday. I'm wondering what the API should be to avoid modifying the model definitions?

I think it would be like, instead of modifying the CausalLMWithValueHeads or GPTHydraHeadWithValueModel class definitions, the delta versions could be subclasses, and then the config can treat them as just another architecture to be trained

@LouisCastricato
Copy link
Contributor

Circling back around on this.

@LouisCastricato
Copy link
Contributor

@cat-state does it make sense to do lora + hydra or just have lora be entirely separate...

@ethankim00
Copy link
Contributor Author

We could have a function to modify the base model of each different model type rather than creating subclasses.

@LouisCastricato
Copy link
Contributor

Hm... I differ to better software engineers haha @jon-tow your input would be great here too

@jon-tow
Copy link
Collaborator

jon-tow commented Jan 6, 2023

@ethankim00 This looks great! I've made a few changes based on some testing on our cluster. Here's the summary:

  • Updates "gpt_neo"` model type name in the modifier map.

  • Fixes layer regex pattern, as the previous one could not capture on ranges with multiple digits, e.g. adapting LORA to a model's 8 through 11 block layers failed since [8-11] is an invalid regex character range.

  • Moves the delta model modifications to the base trainer to avoid unnecessary duplication.

  • Change _opendelta_available to HAS_OPENDELTA for consistency with other modules (see HAS_BNB).

Overall things look very promising. Check out these runs from the PPO sentiments task here. I'm going to begin testing on ILQL and once that's cleared up, we can get this ready for review and a merge.

Reports:

@LouisCastricato
Copy link
Contributor

This looks fantastic! Definitely worth including for the 0.4 release next week. Let's get this merged :)

@jon-tow jon-tow added this to the v0.4.0 milestone Jan 7, 2023
@LouisCastricato LouisCastricato marked this pull request as ready for review January 8, 2023 17:20
Copy link
Contributor

@LouisCastricato LouisCastricato left a comment

Choose a reason for hiding this comment

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

LGTM

@LouisCastricato LouisCastricato merged commit e9c6c86 into CarperAI:main Jan 8, 2023
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.

5 participants