Skip to content

[BUG] Every quantize() creates a new full-size run-<uuid> directory under offload_to_disk_path, and it is never deleted (regression from 2bc2f63, #4202) #4368

Closed

Description

@Qubitium

Severity: medium-high: disk use grows without bound on large models. Status: confirmed on an RTX 4090; A/B tested against 842d666. Kind: regression from 2bc2f63.

Where

gptqmodel/utils/offload.py:79-110 (bind_private_offload_root), called from ModuleLooper.__init__ and WeightOnlyLooper.__init__.

Description

  • Each looper creates <offload_to_disk_path>/run-<uuid16>, and every offload bundle for that run is written into it. That is the whole model.
  • Nothing ever removes the directory: not after save(), not after the model is freed, not on an exception, and not on a later run.
  • Before this commit the bundle names were reused, so disk use stayed at one model.
  • An auto temp dir is cleaned up at interpreter exit. An explicit path, which is the normal choice for large models, grows by one full model per run, across processes too.
  • The EoRA-generate looper allocates another run dir on top.

Repro

import os, subprocess
from gptqmodel import GPTQModel, QuantizeConfig
for i in range(2):
    q = QuantizeConfig(bits=4, group_size=32, offload_to_disk=True, offload_to_disk_path="/data/off")
    m = GPTQModel.load("<any small Llama>", quantize_config=q)
    m.quantize(calib); m.save(f"out_{i}"); del m
    print(os.listdir("/data/off"), subprocess.check_output(["du", "-sh", "/data/off"]).decode())

Found during an AI-assisted review (Claude Code, round 12) of def6e61; repros were run at that commit (A/B against 842d666 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Confirmed independently by a second reviewer: 4 runs of a 3-layer Qwen3-0.6B left 1.3 GB of run-<uuid> trees, including the dense embed_tokens bundle, under an explicit offload_to_disk_path.

    The auto /tmp/gptqmodel_* directory is still removed at exit.

    The per-run isolation itself works: two same-architecture models, quantized sequentially or concurrently with a shared path, each save bit-identical to their own reference. So the fix is only missing cleanup.

  3. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.

  4. self-assigned this
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions