1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #453] Native GGUFs in transformers! #207

Open
opened 2026-11-01 04:18:38 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @kabachuha on GitHub (Sep 23, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/453

https://huggingface.co/blog/transformers-llama-cpp-quants

https://old.reddit.com/r/LocalLLaMA/comments/1wnxm0r/ggufs_in_transformers_natively/

@woct0rdho:

A lot of training frameworks such as Unsloth and Axolotl are based on transformers. Now you can train LoRA over GGUF, which saves more memory compared to the old way to train LoRA over bnb 4-bit models. Nowadays bnb still does not even support MoE but GGUF of course does.

I've made a proof of concept https://github.com/woct0rdho/transformers5-qwen3.5-recipe . There's still some work to do to update it with the latest changes in transformers, but you get the idea.

I hope Unsloth can continue their genius work to support training of recent models. I also expect non-training model surgery tools such as Heretic benefitting from this.

Originally created by @kabachuha on GitHub (Sep 23, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/453 https://huggingface.co/blog/transformers-llama-cpp-quants https://old.reddit.com/r/LocalLLaMA/comments/1wnxm0r/ggufs_in_transformers_natively/ @woct0rdho: > A lot of training frameworks such as Unsloth and Axolotl are based on transformers. Now you can train LoRA over GGUF, which saves more memory compared to the old way to train LoRA over bnb 4-bit models. Nowadays bnb still does not even support MoE but GGUF of course does. > I've made a proof of concept https://github.com/woct0rdho/transformers5-qwen3.5-recipe . There's still some work to do to update it with the latest changes in transformers, but you get the idea. > I hope Unsloth can continue their genius work to support training of recent models. I also expect non-training model surgery tools such as Heretic benefitting from this.
Author
Owner

@p-e-w commented on GitHub (Sep 23, 2026):

Yup, I saw it. This is great news, but I can't find any details on how it works. Do they have custom kernels for every quantized weight format, or are they dequantizing on-the-fly during inference?

<!-- gh-comment-id:5794277302 --> @p-e-w commented on GitHub (Sep 23, 2026): Yup, I saw it. This is great news, but I can't find any details on how it works. Do they have custom kernels for every quantized weight format, or are they dequantizing on-the-fly during inference?
Author
Owner

@woct0rdho commented on GitHub (Sep 23, 2026):

The goal is to have custom kernels for every quant type and every hardware (of course it's big work, although most of the work is to create Python wrappers for libggml). For now the HF guys made some kernels for Apple and I made some kernels for Strix Halo. When there is no kernel it falls back to dequantizing on-the-fly using torch, but at least that saves memory compared to dequantizing the whole model from the beginning (and we can make it a bit faster by applying torch.compile just on the dequant function).

<!-- gh-comment-id:5796528628 --> @woct0rdho commented on GitHub (Sep 23, 2026): The goal is to have custom kernels for every quant type and every hardware (of course it's big work, although most of the work is to create Python wrappers for libggml). For now the HF guys made some kernels for Apple and I made some kernels for Strix Halo. When there is no kernel it falls back to dequantizing on-the-fly using torch, but at least that saves memory compared to dequantizing the whole model from the beginning (and we can make it a bit faster by applying torch.compile just on the dequant function).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#207
No description provided.