-
Notifications
You must be signed in to change notification settings - Fork 55
[caikitnlp-169] Add LoRA configuration support for fine-tuning module #212
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
base: main
Are you sure you want to change the base?
Conversation
…n 163 Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
… done in .train function itself, that way, the model that we configure to __init__ function will look like any other transformers model. Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
|
For the readme update: From @gkumbhat on slack
Sometimes when I don't understand things, I'll just walk away for a bit then I 'get it' when I came back- often it works. This time it didn't. So I need more guidance on what to put where in the readme.md, but ott this PR is ready for review |
Signed-off-by: Trevor Grant <[email protected]>
Signed-off-by: Trevor Grant <[email protected]>
|
cc: @Ssukriti Would be great to get your eyes on this |
gkumbhat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding support for LoRA. Upon review a couple of things needs to be changed:
- The input to train function needs to be a data model or built-in python data types. This is so that we can automatically then leverage those data types and type hints to generate a server spec servable via
caikit.runtime. Under the hood, these parameter to.trainfunction gets converted to a proto spec automatically and gets exposed to our gRPC and REST server. Currently it it acceptingLoRAConfig, which won't work with auto generation of server and thus won't get exposed in API. - The lora vector and lora based PEFT model gets generated after the model is already trained. So it looks like the LoRA vectors / weights are actually not getting modified / trained.
- Once we move the LoRAConfig parameters to data model type object,, we would also need to be filter and set "reasonable defaults" for those configuration parameters.
- It looks like the lora config related changes in
peft_config.pyaren't actually getting used. - Upon looking at the implementation and considering generally how Lora is being referenced as part of "prompt tuning", we decided it would probably be better to move this to prompt tuning module and add a flag to save prompt vectors via merged weights or not. There will certainly be some things we would need to figure out to correctly hook it up for inferencing and its routing configuration. But that probably aligns more with how people are using it.
|
Based on the requested changes, I think a complete refactor is in order- closing. |
|
I would like to keep this open while Sukriti reviews |
|
@gkumbhat since I do not have write access to caikit-nlp, could you create a branch in main repo and merge this PR to that branch ? I can then continue to commit to that branch too, instead of having to pull from another fork |
|
added first PR to create data model and utilities #270 Remaining work is being paused till we have more direction on priorities. We can close this PR , and continue to refer to it for any further refactor as separate PRs |
Add LoRA configuration support in the toolkit functionality created in Refactor peft module to take out common peft config functionality #163
Add LoRA configuration and training from text-generation module (train).
Expose parameter required for LoRA configuration via .train function
Add support for saving LoRA models with "merged weights". This is to be done in .train function itself, that way, the model that we configure to
__init__function will look like any other transformers model.Unit tests cover new/changed code
Examples build against new/changed code
README updated here
Example for training lora added in example script