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

[post training] support save hf safetensor format checkpoint #845

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SLR722
Copy link
Contributor

@SLR722 SLR722 commented Jan 22, 2025

context

Now, in llama stack, we only support inference / eval a finetuned checkpoint with meta-reference as inference provider. This is sub-optimal since meta-reference is pretty slow.

Our vision is that developer can inference / eval a finetuned checkpoint produced by post training apis with all the inference providers on the stack. To achieve this, we'd like to define an unified output checkpoint format for post training providers. So that, all the inference provider can respect that format for customized model inference.

By spotting check how ollama and fireworks do inference on a customized model, we defined the output checkpoint format as /adapter/adapter_config.json and /adapter/adapter_model.safetensors (as we only support LoRA post training now, we begin from adapter only checkpoint)

test

we kick off a post training job and configured checkpoint format as 'hf'. Output files
Screenshot 2025-01-22 at 5 03 14 PM

we did a proof of concept with ollama to see if ollama can inference our finetuned checkpoint

  1. create Modelfile like
Screenshot 2025-01-22 at 5 04 18 PM
  1. create a customized model with ollama create llama_3_2_finetuned and run inference successfully
Screenshot 2025-01-22 at 5 05 17 PM

This is just a proof of concept with ollama cmd line. As next step, we'd like to wrap loading / inference customized model logic in the inference provider implementation.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 22, 2025
@SLR722 SLR722 changed the title [WIP][post training] support save hf safetensor format checkpoint [post training] support save hf safetensor format checkpoint Jan 23, 2025
@SLR722 SLR722 marked this pull request as ready for review January 23, 2025 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants