mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[GH-ISSUE #179] feat: blockwise loading #104
Labels
No labels
bug
enhancement
enhancement
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
p-e-w/heretic#104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kalle07 on GitHub (Feb 18, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/179
good work so fare ... i forget to say ;)
the option bnb_4bit works for larger models ... but I have no idea about the quality and accuracy.
but while train or execute large models it give layer offloading or blockwise execution... its open source but dont know how complex is the implementation ...
@Muitamax commented on GitHub (Feb 18, 2026):
Thanks — do you mean integration with Accelerate’s device_map="auto" style layer offloading, or a more manual block-by-block execution loop?
If it's the former, exposing device map configuration alongside bnb_4bit should be relatively straightforward.
If it's true blockwise loading with manual forward control, that would require more invasive architectural changes, especially around attention caching and residual tracking.
Happy to explore the lighter-weight offloading option first if that would already cover the main use case.
@kabachuha commented on GitHub (Feb 18, 2026):
Theoretically, heretic should be compatible with llama.cpp. It is based on hidden state extraction -- llama.cpp has callbacks in each model file for this, and this can be implemented with a simple .cpp plugin -- and abliteration, which is done here via LoRA and llama.cpp supports GGUF loras. However, in practice is would be a pain to implement, but llama.cpp-based heretic is definitely possible to be implemented.
@kabachuha commented on GitHub (Feb 18, 2026):
I did some preliminary work here with small success, but to base it on top of heretic would have a lot of work. https://github.com/kabachuha/abliterate.cpp
With the proliferation of ~trillion-scale models it will be necessary indeed
@kalle07 commented on GitHub (Feb 18, 2026):
i only know the "function" from vision training like Ai-toolkit or kohoya ... all open source
btw option "float8_e4m3fn" for dtypes ... possible to use or implement ?
@kabachuha commented on GitHub (Feb 18, 2026):
@kalle07 There is bnb fp4 quantization here. 8bit quantization (at least bnb) has numerical problems here as said in #60.
There is very small quality loss in 4bit compared to full bf16, so this function is not really worth introducing
@kalle07 commented on GitHub (Feb 18, 2026):
@kabachuha all fine ;)
but there is a small error or it is not possible to do it differently.
https://github.com/p-e-w/heretic/issues/123
@p-e-w commented on GitHub (Apr 7, 2026):
We're not going to implement custom loading mechanisms. The only way this happens is if it gets added to Transformers upstream.