mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[PR #17] [MERGED] Fix multi-GPU support and memory management #239
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#239
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?
📋 Pull Request Information
Original PR: https://github.com/p-e-w/heretic/pull/17
Author: @kldzj
Created: 11/17/2025
Status: ✅ Merged
Merged: 11/18/2025
Merged by: @p-e-w
Base:
master← Head:master📝 Commits (10+)
c1bdecaEnsure projector is on the same device as the matrix for multi-GPU support32aefeaOptimize memory management for loaded model weights16a44deRefactor memory management by removing unnecessary gc.collect() calls01a1a7eMerge branch 'p-e-w:master' into master4663606Optimize memory usage (#1)b71d328Fix broken file74771cfRemove unnecessary deletions74d8491Remove unnecessary empty_cache() calls3647d4aRemove unused import of gc0ff072bDuplicategc.collectcall inempty_cache()📊 Changes
3 files changed (+11 additions, -1 deletions)
View changed files
📝
src/heretic/main.py(+6 -0)📝
src/heretic/model.py(+3 -1)📝
src/heretic/utils.py(+2 -0)📄 Description
Problem
RuntimeError: Expected all tensors to be on the same device, but got mat2 is on cuda:1, different from other tensors on cuda:0Solution
gc.collect()+empty_cache()before model reloads and after trialsResult
Models with
device_map="auto"now run successfully across multiple GPUs without device mismatches or memory accumulation between trials.Successfully abliterated gpt-oss-120b on 8x B200:
Also confirmed to be working using 4x H200.
Fixes #8
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.