ggml icon indicating copy to clipboard operation
ggml copied to clipboard

Automatically convert pytorch model to ggml

Open Maknee opened this issue 11 months ago • 4 comments

Is there a way to automatically convert any pytorch model and its functionality to gguf format + ggml framework? Has anyone worked on such a feature?

Maknee avatar Mar 03 '24 05:03 Maknee

I think what should exist is documentation of the functions in ggml and their equivalents in PyTorch, and then each person can figure out how to port any model. The above is more realistic than creating a program that magically reads an entire PyTorch project and converts the models into a ggml executable and gguf model.

FSSRepo avatar Mar 04 '24 15:03 FSSRepo

This is surprisingly non trivial because pytorch models often have a variable computational graph defined at runtime based on conditional logic.

balisujohn avatar Mar 05 '24 16:03 balisujohn

This is surprisingly non trivial because pytorch models often have a variable computational graph defined at runtime based on conditional logic.

Interesting. How does onnx handle variable computation graphs?

Maknee avatar Mar 06 '24 01:03 Maknee

How about .onnx model? Is there any way can convert .onnx model to gguf format automatically?

Francis235 avatar Mar 12 '24 09:03 Francis235