huggingface / optimum

🚀 Accelerate training and inference of 🤗 Transformers and 🤗 Diffusers with easy to use hardware optimization tools
https://huggingface.co/docs/optimum/main/
Apache License 2.0
2.59k stars 469 forks source link

Support transformers export to ggml format #903

Open fxmarty opened 1 year ago

fxmarty commented 1 year ago

Feature request

ggml is gaining traction (e.g. llama.cpp has 10k stars), and it would be great to extend optimum.exporters and enable the community to export PyTorch/Tensorflow transformers weights to the format expected by ggml, having a more streamlined and single-entry export.

This could avoid duplicates as https://github.com/ggerganov/llama.cpp/blob/master/convert-pth-to-ggml.py https://github.com/ggerganov/whisper.cpp/blob/master/models/convert-pt-to-ggml.py https://github.com/ggerganov/ggml/blob/master/examples/gpt-j/convert-h5-to-ggml.py

Motivation

/

Your contribution

I could have a look at it and submit a POC, cc @NouamaneTazi @ggerganov

Open to contribution as well, I don't expect it to be too much work

NouamaneTazi commented 1 year ago

Amazing idea! One could also take inspiration from this script which enables support for all bloom architectures:

https://github.com/NouamaneTazi/bloomz.cpp/blob/main/convert-hf-to-ggml.py

sidistic commented 1 year ago

take Hello I would love to contribute.