caikit / caikit-nlp

Apache License 2.0
12 stars 46 forks source link

Add LoRA configuration support for fine-tuning module #169

Open gkumbhat opened 1 year ago

gkumbhat commented 1 year ago

Description

After refactoring #163 PT to take out prompt tuning related configuration to separate module. We want to add support for prompt tuning (specifically LoRA) in fine-tuning module, i.e text_generation. Changes:

  1. Add LoRA configuration support in the toolkit functionality created in #163
  2. Add LoRA configuration and training from text-generation module (train).
  3. Expose parameter required for LoRA configuration via .train function
  4. 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.

Acceptance Criteria

ibm-peach-fish commented 1 year ago

@gkumbhat please confirm that for description items 2,3,4 you want https://github.com/caikit/caikit-nlp/blob/main/caikit_nlp/modules/text_generation/text_generation_local.py#L172 updated only ( I didn't see a train function in text_generation_tgis.py )

ibm-peach-fish commented 1 year ago

@gkumbhat re: point 2.

Add LoRA configuration and training from text-generation module (train).

is from a typo that should be to?

ibm-peach-fish commented 12 months ago

From slack conversation- add flag about weather model is a lora or not to the config.yaml

ibm-peach-fish commented 12 months ago

also per slack conversation- FYI if anyone is doing something later and happens to read this (good for you).

Merged models have lower latency than base + LoRA

src: https://huggingface.co/docs/peft/conceptual_guides/lora

ibm-peach-fish commented 12 months ago

@gkumbhat could i get more specification on what readme.md you want updated, I'm having a hard time following the link