Project#15: GGUF Reader in OpenVINO for direct GGUF Execution (Prototype) - #3449
Project#15: GGUF Reader in OpenVINO for direct GGUF Execution (Prototype)#3449shahkarnav115-beep wants to merge 6 commits into
Conversation
|
@ravi9 some of the work for the build is left to be done. Will push the commit shortly. |
|
@shahkarnav115-beep Converting PR to draft as description states it's WIP |
|
This is the complete integration of llama.cpp ("dev_backend_openvino" - branch) in openvino.genai as a submodule (static library). I have implemented the minimal architecture (skeleton) of GGUFReaderV2 in gguf_reader_v2.cpp and its .hpp. To verify that it successfully calls the APIs from the submodule, I have also added a minimal C++ regression test in gguf_reader_v2_test.cpp. Locally, I have built all the required components and tested them, and this minimal scaffold is compiling and working perfectly on my system. As part of my GSoC 2026 preparation, I would be extremely grateful to get your reviews on this initial architectural integration. cc: @ravi9, @cavusmustafa |
|
Link to headers file for submodule's (dev_backend_openvino branch): ravi9/llama.cpp#55 |
|
@shahkarnav115-beep hi Karnav! I read your proposal and am very excited to see your work!! I run OpenArc, where your changes in this pr will be most welcome! https://github.com/SearchSavior/OpenArc I encourage you to join our discord- we can help you test when you need feedback, other machines etc. Plus it's great to have support. Thanks for your work so far!! (And of course, your mentors as well!) |
b000e0e to
03d5544
Compare
03d5544 to
87b6552
Compare
87b6552 to
03d5544
Compare
3db32ae to
5749c93
Compare
|
By bypassing some of the input tensors and applying the correct causal mask, the math execution is now working. TinyLlama-1.1B-Chat-v1.0-f16.gguf is successfully running through the translated OpenVINO graph, and the output logits are matching the native llama.cpp execution within standard floating-point tolerances. model download link: https://huggingface.co/andrijdavid/TinyLlama-1.1B-Chat-v1.0-GGUF?utm_source=chatgpt.com&show_file_info=TinyLlama-1.1B-Chat-v1.0-f16.gguf |
647829d to
024cd2b
Compare
|
|
||
| if(ENABLE_GGUF) | ||
| target_link_libraries(${TARGET_NAME_OBJ} PRIVATE gguflib) | ||
| target_compile_definitions(${TARGET_NAME_OBJ} PRIVATE ENABLE_GGUF) |
There was a problem hiding this comment.
Why have you removed this line?
| if (ctx) gguf_free(ctx); | ||
| } | ||
|
|
||
| inline void load_arrays(gguf_ctx*, std::unordered_map<std::string, ov::Tensor>&, std::unordered_map<std::string, gguf_tensor_type>&) {} |
There was a problem hiding this comment.
Is this behavior ok? Maybe add some warning or avoid calling this method completely if HAS_LLAMA_CPP is enabled.
|
Hii @sgonorov, Thanks for looking into the prototype. The main aim of the prototype was to extract ggml_cgraph from llama.cpp. So, in order to make it possible, some changes were made in certain files. As this was prototypal work, it will only be used as a reference while implementing the actual parsing and translation of models from llama.cpp to OpenVINO. The changes in the code have some known flaws which will need proper implementation during GSoC's coding period — until then it is just a proof of work. Though, to answer some doubts:
Again, Thanks for reviewing!! |
As it's a prototype converting pr to draft |
|
This PR will be closed in a week because of 2 weeks of no activity. |
|
This PR will be closed in a week because of 2 weeks of no activity. |
|
Closing due to inactivity. Feel free to reopen if you plan to continue working on this. |
Summary
The PR introduces the new gguf reader which is a temporary work-around (prototype)
related information can be found in below given links:
Proposed Plan:
Drafft-proposal.pdf
Link to thirdparty module changes (llama.cpp): ravi9/llama.cpp#55
log for testing tinnyllama.gguf:
Checklist: