Skip to content

[BUG] LazyTurtle .bin → safetensors conversion still goes to the system TMPDIR and ignores offload_to_disk_path (incomplete fix of #4205) #4319

Closed

Description

@Qubitium

Severity: low. Status: confirmed by repro on CPU and on an RTX 4090. Kind: incomplete fix of #4205 (2c625bb).

Where

  • gptqmodel/models/loader.py:2015: LazyTurtle.maybe_create(...) is called without offload_path=.
  • gptqmodel/utils/structure.py:1171 and :1244: _infer_conversion_root looks for the path in model_init_kwargs, where it never is, and in target_model.quantize_config, which the HF shell does not have.

Repro

from gptqmodel import GPTQModel, QuantizeConfig
OFF = "/data/offload"   # any writable dir
GPTQModel.load("facebook/opt-125m", quantize_config=QuantizeConfig(bits=4, offload_to_disk_path=OFF))
  • Actual: the ~250 MB lazyturtle-<pid>-<digest> directory is created under $TMPDIR, and OFF stays empty.
  • Expected: the conversion goes under the configured offload path. On hosts where /tmp is a small tmpfs this matters.
  • What 2c625bb does fix: the conversion is reused across loads and deleted when the model and turtle are freed.

Found during an AI-assisted review (Claude Code, round 11) of 842d666; repros were run at that commit 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

    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.

  3. self-assigned this
    on Nov 16, 2026
  4. Qubitium commented on Nov 16, 2026

    @Qubitium
    CollaboratorAuthor

    Already fixed on main by #4340 (commit 688208d20): the loader now passes offload_path=getattr(quantize_config, "offload_to_disk_path", None) to LazyTurtle.maybe_create. Verified on current main (313529a97): tests/test_lazy_turtle_conversion_cache.py → 6 passed, and a CPU load of cached sshleifer/tiny-gpt2 (.bin source) with offload_to_disk_path=/tmp/a4319_real/offload created lazyturtle-<pid>-<digest> under that directory (TMPDIR untouched) and removed it on turtle.close(). No additional PR is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions