mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[GH-ISSUE #95] State save possible? #50
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#50
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 @Hotohori on GitHub (Jan 2, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/95
I wonder if it would be possible to save states between trials so you can continue if anything stops the app or save trials directly which are under a set value of KL/refusal?
I tried to use my RTX 4090 to run Heretic on Mistral Nemo 12B (no quant), but because 24GB VRAM is a bit too less for the full model some parts needed to be on CPU it and so it runs close on full VRAM and for reasons it failed after over 2h with CUDA out of memory on trial 35 and with that you lose everything.
@Vinay-Umrethe commented on GitHub (Jan 2, 2026):
that's a cracking idea actually and something i’d considered before but i haven't made any PRs for it or gave much attention... I know optuna uses sqlite to save data in a .db file but I’m not entirely sure if heretic actually makes use of that built in feature or not
@Hotohori commented on GitHub (Jan 3, 2026):
Well, it would be great, because now it was even more annoying. I tried the actual branch to set max_memory. It worked good until the end. When I should selected the trial I want to save and give it a directory name > CUDA out of memory. Closed all to make as much VRAM free as possible, didn't help and in the end the app crashed totally with a CUDA out of memory and already all the work for nothing.
So, yes, a save of the trials under a specific rate would be great.
@spikymoth commented on GitHub (Jan 3, 2026):
I actually implemented something like this locally, just extracted it into a branch:
https://github.com/spikymoth/heretic/tree/save-and-resume (the commits:
github.com/spikymoth/heretic@d0d9092a30&github.com/spikymoth/heretic@4ac0d54c83)It's a bit rough:
log/study.jsonland uses fixed internal namemy_studySo it needs more work before it can be called production ready, but it's usable if you know the limitations.
If anyone wants to use it as a starting point for a pull request, you have my blessing :)
@spikymoth commented on GitHub (Jan 3, 2026):
My implementation can be simplified a bit more by setting
load_if_exists=Trueinoptuna.create_studyinstead of usingoptuna.load_study. Pushed a 2nd commit for that:github.com/spikymoth/heretic@4ac0d54c83@anrp commented on GitHub (Jan 15, 2026):
Reworked/improved your change, in https://github.com/p-e-w/heretic/pull/106