Skip to content

Llama training finetuning interface #2246

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

howard0su
Copy link
Collaborator

Like to get early feedback to adding fine tunning interface to llama.h.

  1. Leverage same code for compute graph
  2. leverage same model class to store the weights including LoRA weights

Questions to get feedback:

  1. shall we have finetune context instead of llama_context today?
  2. shall we have simple function to complete hide training? I feel it may miss the feature like using grammar CFG to finetune model.

@howard0su howard0su changed the title Llama train interface Llama training finetuning interface Jul 17, 2023
Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

Looks fine, though it's hard to tell what's the best approach.
I see you are applying LoRA at runtime. Can you make a prototype for loading the optional LoRA tensors and measure what is the performance difference compared to applying the LoRA once at the start?

@@ -242,6 +252,11 @@ extern "C" {
// IMPORTANT: do not use for anything else other than debugging and testing!
LLAMA_API int llama_eval_export(struct llama_context * ctx, const char * fname);

// Enable finetune on the context, flags indicate what type of finetune
LLAMA_API int llama_enable_finetune(struct llama_context * ctx, enum llama_finetune_type flags);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LLAMA_API int llama_enable_finetune(struct llama_context * ctx, enum llama_finetune_type flags);
LLAMA_API int llama_finetune_enable(struct llama_context * ctx, enum llama_finetune_type flags);

@daboe01 daboe01 mentioned this pull request Jul 22, 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.

2 participants