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
{{ message }}
Repository navigation
[BUG] Dense-load backend is inherited by quantize() only when typed: load(backend=BACKEND.AWQ_TORCH) is silently replaced by AUTO, load(backend=AwqTorchConfig()) is honored (#4375) #4582
Found on main @ 4b65923, RTX 4090 (sm89), torch 2.15 + CUDA 13.2.
What is wrong
Since #4375, BaseQModel.quantize() calls resolve_quantize_backend(backend, self.quantize_config, inherit=True) (gptqmodel/models/base.py:2127-2129). That carries the dense load's backend into quantize(backend=AUTO), but only when the load used a typed BackendConfig. resolve_quantize_backend sets qcfg._backend_config only for a typed backend (gptqmodel/utils/backend_config.py:302). An enum passed to the same load (backend=BACKEND.AWQ_TORCH) is used only for auto_select_device in ModelLoader.from_pretrained and is then dropped, with no warning. The two spellings of the same explicit request therefore quantize and pack with different kernels:
load backend = typed AwqTorchConfig() -> quantize() OK, kernels ['AwqTorchLinear']
load backend = enum BACKEND.AWQ_TORCH -> quantize() FAILED NotImplementedError <class '...gemm_awq.AwqGEMMLinear'>: `out_features`: 288 must be divisible by [64].
Suggested fix
Record an explicit, non-AUTO enum the same way as a typed choice: qcfg._backend_config = backend (or a separate _load_backend) whenever normalize_backend(backend) != AUTO, so quantize(backend=AUTO) inherits it. If enum inheritance is deliberately unsupported, GPTQModel.load(..., quantize_config, backend=<enum>) should at least warn that the enum does not apply to quantization, and docs/backend-selection.md should say so. Today it is silently ignored.
Test that should have caught it
tests/test_backend_config_reuse_4446.py covers typed inheritance only. Parametrize it over AwqTorchConfig() vs BACKEND.AWQ_TORCH (and TorchConfig() vs BACKEND.GPTQ_TORCH) and assert the same packing kernel.
Severity
Low-medium. An explicit backend request is silently replaced. It turns into a crash on shapes only the requested kernel supports.
Activity
Qubitium commentedon Nov 17, 2026
Claimed. This issue is now owned by a dedicated worker; a fix PR referencing it will follow.
fix(backend): inherit explicit enum load backend into quantize (#4582) (