Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gptqmodel/utils/offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from accelerate.utils import align_module_device, has_offloaded_params
from torch import nn

from .memory import MEM_LORD
from ..looper.named_module import NamedModule
from .device import get_device
from .torch import CPU, HAS_CUDA, META
Expand Down Expand Up @@ -90,6 +91,7 @@ def _offload_disk(module: nn.Module, name: str, disk_path: str = "."):
# print(f"[skip] '{name}' is on meta; leaving as-is")
return

MEM_LORD.free(module)
m_device = get_device(module)
if m_device.type == "cuda":
torch.cuda.set_device(m_device)
Expand Down