burn icon indicating copy to clipboard operation
burn copied to clipboard

Support importing GGUF files

Open richardanaya opened this issue 1 year ago • 22 comments

I apologize if this seems too far fetched, but it seemed in line with how ONNX generation works.

richardanaya avatar Jan 29 '24 20:01 richardanaya

If gguf contains the model graph information, then we can use what burn-import ONNX facility. In our burn-import, we convert ONNX graph to IR (intermediate representation) (see this doc). So, it would possible to convert the model graph to IR and generate source code + weights.

If gguf contains only weights, we can go burn-import pytorch route, where we only download weights.

antimora avatar Jan 29 '24 20:01 antimora

From my brief research, GGUF format contains metadata + tensor weights. This aligns with burn-import pytorch route and not burn-import/ONNX. This will mean model needs to be constructed in Burn first and use the weights to load.

Here is one Rust lib to parse GGUF file: https://github.com/Jimexist/gguf

antimora avatar Jan 29 '24 20:01 antimora

GGUF spec: https://github.com/ggerganov/ggml/pull/302

antimora avatar Mar 15 '24 19:03 antimora

Parser in Rust: https://github.com/Jimexist/gguf

antimora avatar Mar 15 '24 19:03 antimora