Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Disk-offload bundles were keyed by module name only (
<root>/<module path>),and the root comes from a
QuantizeConfigthat is routinely shared by severalmodels: the automatic temporary directory,
copy.copy, andcopy.deepcopyallhand out the same directory. A second
quantize()therefore replaced the firstmodel's finalized bundles in place, and
save()later read whatever bundle wason disk -- silently writing the other model's
qweight/scales.Each quantization run now binds a private
run-<id>subdirectory under theconfigured offload root and keeps a private config copy on the model. Writes and
the save-time bundle lookup use the same namespace, and a later run on another
model cannot move this model's lookup. An explicit
offload_to_disk_pathisstill the root the user asked for; only the per-run subdirectory is added.
What Changed
gptqmodel/utils/offload.py: addbind_private_offload_root(), which createsa unique per-run directory under the configured root and installs a shallow
config copy on the model.
gptqmodel/looper/module_looper.py: bind the private namespace at looperconstruction and point processors that still hold the shared config object at
the private copy.
gptqmodel/looper/weight_only_looper.py: same for the weight-only lifecycle.Tests
End-to-end repro (two same-architecture tiny Llama models, one shared
QuantizeConfig, defaultoffload_to_disk=True): the two models report distinctrun-*roots after quantization, and the first model's savedmodel.layers.0.self_attn.q_proj.qweightis bit-equal to a fresh first-model-onlyreference (
A == ref: True) while differing from the second model(
A == B: False).Fixes #4202
Rebased onto main after #4295 merged; this PR now contains only the #4202 changes.