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 #123] Bug: Double VRAM usage during refusal direction calculation when using quantization #69

Closed
opened 2026-11-01 04:17:11 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @stepfunction83 on GitHub (Jan 29, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/123

When using bnb_4bit quantization, the VRAM used for running heretic on 12B Mistral NeMo in the first stage of the process (refusal direction calculation) is roughly double the VRAM needed for the evaluation stage of the process.

Refusal direction calculation total VRAM usage: 23.9GB
Evaluation total VRAM usage: 12.8GB

My settings are:

max_response_length = 300
quantization = "bnb_4bit"
max_memory = {0 = "20GB", "cpu" = "64GB"}
batch_size = 32  # auto

With 500 total bad/good prompts and 100 bad/good evaluation prompts

Originally created by @stepfunction83 on GitHub (Jan 29, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/123 When using bnb_4bit quantization, the VRAM used for running heretic on 12B Mistral NeMo in the first stage of the process (refusal direction calculation) is roughly double the VRAM needed for the evaluation stage of the process. Refusal direction calculation total VRAM usage: 23.9GB Evaluation total VRAM usage: 12.8GB My settings are: ``` max_response_length = 300 quantization = "bnb_4bit" max_memory = {0 = "20GB", "cpu" = "64GB"} batch_size = 32 # auto ``` With 500 total bad/good prompts and 100 bad/good evaluation prompts
Author
Owner

@p-e-w commented on GitHub (Jan 30, 2026):

Can you try a smaller model without special max_memory configuration to make this problem easier to pin down?

<!-- gh-comment-id:3823103823 --> @p-e-w commented on GitHub (Jan 30, 2026): Can you try a smaller model without special `max_memory` configuration to make this problem easier to pin down?
Author
Owner

@p-e-w commented on GitHub (Feb 8, 2026):

I am still unable to reproduce this. For a 4B model with quantization enabled, VRAM usage peaked at 2.53 GB for me.

<!-- gh-comment-id:3866064961 --> @p-e-w commented on GitHub (Feb 8, 2026): I am still unable to reproduce this. For a 4B model with quantization enabled, VRAM usage peaked at 2.53 GB for me.
Author
Owner

@kalle07 commented on GitHub (Feb 18, 2026):

same on model granite-8b, 16gb VRAM
no max_memory options, only set to "bnb_4bit"

until preparing full VRAM after training starts arround 8GB

<!-- gh-comment-id:3919541278 --> @kalle07 commented on GitHub (Feb 18, 2026): same on model granite-8b, 16gb VRAM no max_memory options, only set to "bnb_4bit" until preparing full VRAM after training starts arround 8GB
Author
Owner

@p-e-w commented on GitHub (Apr 7, 2026):

Fixed in #239.

<!-- gh-comment-id:4199182414 --> @p-e-w commented on GitHub (Apr 7, 2026): Fixed in #239.
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#69
No description provided.