flower icon indicating copy to clipboard operation
flower copied to clipboard

Support for fine tuning GGML libraries

Open andrewschreiber opened this issue 2 years ago • 8 comments

Describe the type of feature and its functionality.

GGML is an exciting new library that's being used for edge computing of ML models. For example, llama.cpp and whisper.cpp.

GGML does support fine-tuning, but usually it's by importing from another model format. For example, fine-tuning a HuggingFace model, then converting it as shown here: https://github.com/ggerganov/whisper.cpp/tree/master/models#fine-tuned-models

Seeing as Flower supports HuggingFace, perhaps there is an approach here? Curious the community's thoughts.

Describe step by step what files and adjustments are you planning to include.

An example pipeline of fine tuning a ggml model using flower.

Is there something else you want to add?

No response

andrewschreiber avatar Jun 07 '23 20:06 andrewschreiber

Hi @andrewschreiber,

Thanks for reaching out. I'm quite excited about this - I actually commented on the GGML HN thread asking if it supported training on mobile platforms. The reply was that while training is possible, it's not documented yet.

Have you used GGML fine-tuning? Happy to collaborate on a code example with Flower if you're interested!

danieljanes avatar Jun 07 '23 20:06 danieljanes

Thanks for the quick response! It's encouraging to see your enthusiasm as well @danieljanes

I expect to have bandwidth in early August to dive in. Privacy-respecting training is paramount in my new project and flower + ggml seems like the strongest angle of attack

andrewschreiber avatar Jun 08 '23 18:06 andrewschreiber

Hi @andrewschreiber

Thanks for raising this feature request. Is this something that you would like to implement, maybe open a PR?

WilliamLindskog avatar Dec 05 '24 22:12 WilliamLindskog

Hey still quite busy with other efforts unfortunately. Will loop back when I have more availability.

andrewschreiber avatar Dec 11 '24 21:12 andrewschreiber

Sounds good! Let me know if there's anything we can help you with in the meantime.

WilliamLindskog avatar Jan 29 '25 16:01 WilliamLindskog

Open comment if anyone has seen similar implementations of GGML that can be replicated in Flower?

WilliamLindskog avatar May 04 '25 21:05 WilliamLindskog

We are looking into this, one comment would be, would it suffice to change C++ example to something like in this script?

#include "arg.h"
#include "common.h"
#include "log.h"
#include "llama.h"

The C++ example is not up-to-date but is work in progress, see here:

  • https://github.com/adap/flower/issues/5286
  • https://github.com/adap/flower/pull/5287

WilliamLindskog avatar May 12 '25 14:05 WilliamLindskog

I find this very interesting, would like to contribute. Is there a possibility? Also, just to make sure my understanding is right: We are looking to create a pipeline where a model is FL trained using Flower and then the model is converted to a ggml format so that the inference can happen at edge. Is that understanding right?

I am happy to pick this or collaborate on this.

milonimittal avatar Oct 29 '25 15:10 milonimittal