You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When config.json lacks embedded quantization metadata, GPTQModel.load() falls back to looking for quantize_config.json or quant_config.json. The lookup ignores the selected subfolder and Hub revision. It also calls the Hub file-listing API in offline mode.
Nested checkpoint reproduction
At 72cef9bac, quantize and save a tiny Llama checkpoint under root/gptq. Remove only the embedded quantization_config field from its config.json, leaving quantize_config.json and the packed weights in place. This mimics a legacy sidecar-only checkpoint.
Verified on CPU. The first two calls return True and load packed layers. The third returns False and creates dense layers. Transformers reports unexpected packed tensors and missing dense projection weights, which it initializes.
Offline cache reproduction
Using a complete local Hugging Face cache of a tiny dense Llama checkpoint at a pinned revision, set HF_HUB_OFFLINE=1 and pass local_files_only=True. AutoConfig.from_pretrained() and GPTQModel.from_pretrained() load the snapshot. GPTQModel.load() raises OfflineModeIsEnabled while listing repository files. This was verified without a network dependency using a locally prepared cache.
Expected behavior
The sidecar lookup agrees with the config and weights on subfolder and revision, and honors the caller's offline policy. The nested checkpoint should dispatch to the quantized loader, and the cached dense checkpoint should load without listing the remote repository. Config lookup, sidecar lookup.
Suggested mitigation
The fallback in gptqmodel/models/auto.py could resolve each legacy filename using the same cache-aware file lookup and subfolder, revision, and local-file policy as the config loader. For local paths, it could probe the effective checkpoint directory directly.
A regression could assert that a sidecar-only nested checkpoint installs packed layers, and a separate pinned-cache case could exercise the dense dispatch with network access disabled. As workarounds, the explicit from_quantized() route succeeds for the nested fixture, and using a local snapshot directory avoids the Hub listing call.
Agent claim:agent-4e3a0639ecaf is working on this issue now.
Started 2026-11-19T09:10:00Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Resolve the legacy sidecar lookup through the same subfolder/revision selection as the config and weights, and never list the Hub repository when the caller is offline.
GPTQModel.load() decides between the dense and quantized loader by probing for quantize_config.json / quant_config.json when config.json has no embedded quantization metadata. The probe always looked at the repository root and always listed the remote repository: a nested checkpoint (subfolder=) was treated as dense (packed tensors loaded as dense weights and re-initialized), a pinned revision was ignored, and an offline caller hit OfflineModeIsEnabled.
Fix
New _has_legacy_quant_sidecar() in gptqmodel/models/auto.py, called with the same _get_config_load_kwargs() the config load uses:
local: check <model>/<subfolder>/<name>;
remote: list the pinned revision and match the subfolder-prefixed name;
offline (HF_HUB_OFFLINE): never list the repository - probe the local Hub cache with hf_hub_download(..., local_files_only=True).
Verification
New tests/test_legacy_sidecar_selection_5379.py (6 tests): nested sidecar dispatches to the quantized loader with subfolder forwarded; a root sidecar does not select a nested dense checkpoint; local/remote/offline probes each resolve the selection correctly.
Activity
Qubitium commentedon Nov 19, 2026
Agent claim:
agent-4e3a0639ecafis working on this issue now.Started 2026-11-19T09:10:00Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.
Resolve the legacy sidecar lookup through the same subfolder/revision selection as the config and weights, and never list the Hub repository when the caller is offline.
fix(load): resolve the legacy sidecar through the checkpoint selection (
Qubitium commentedon Nov 19, 2026
Released: #5494 merged as
afd856571.Root cause
GPTQModel.load()decides between the dense and quantized loader by probing forquantize_config.json/quant_config.jsonwhenconfig.jsonhas no embedded quantization metadata. The probe always looked at the repository root and always listed the remote repository: a nested checkpoint (subfolder=) was treated as dense (packed tensors loaded as dense weights and re-initialized), a pinnedrevisionwas ignored, and an offline caller hitOfflineModeIsEnabled.Fix
_has_legacy_quant_sidecar()ingptqmodel/models/auto.py, called with the same_get_config_load_kwargs()the config load uses:<model>/<subfolder>/<name>;HF_HUB_OFFLINE): never list the repository - probe the local Hub cache withhf_hub_download(..., local_files_only=True).Verification
tests/test_legacy_sidecar_selection_5379.py(6 tests): nested sidecar dispatches to the quantized loader withsubfolderforwarded; a root sidecar does not select a nested dense checkpoint; local/remote/offline probes each resolve the selection correctly.58fbec467: 2 failed -> 6 passed.test_checkpoint_subfolder_resolution.py+test_model_dequant_v2_metadata_alias_5413.py+ new file -> 31 passed; ruff clean.