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] GPTAQ/FOEM have no accelerator-OOM CPU fallback around hessian_inverse: HIPSOLVER/CUSOLVER_STATUS_ALLOC_FAILED aborts the run where GPTQ recovers (#4350/#4400 incomplete) #4604
Found on main @ 4b65923, AMD Radeon AI PRO R9700 (gfx1201, ROCm 10.1). The root cause is not ROCm-specific.
What is wrong
#4350, #4400, #4442 and #4492 gave GPTQ (and QQQ/EXL3) a CPU fallback when the dense Hessian inverse runs out of accelerator memory. The guard is _is_memory_allocation_failure (it matches HIPSOLVER/CUSOLVER_STATUS_ALLOC_FAILED, OutOfMemoryError, ...). The GPTQ copy lives at gptqmodel/quantization/gptq.py:2647-2667.
GPTAQ and FOEM re-implement the quantize loop and call self.hessian_inverse(H) with no guard at all. For GPTAQ that is gptqmodel/quantization/gptaq.py:502; FOEM has the same pattern. A solver workspace allocation failure that GPTQ survives therefore aborts the whole GPTAQ/FOEM quantization.
I hit this for real while the card was shared and nearly full. A Llama-3.2-1B-Instruct GPTAQ run died with:
File "gptqmodel/quantization/gptaq.py", line 502, in quantize
File "gptqmodel/quantization/gptq.py", line 2204, in hessian_inverse
File "gptqmodel/quantization/gptq.py", line 2112, in try_factor
File "gptqmodel/quantization/gptq.py", line 2091, in inverse_factor
RuntimeError: hipsolver error: HIPSOLVER_STATUS_ALLOC_FAILED, when calling `hipsolverDnSpotrs(handle, uplo, n, nrhs, A, lda, B, ldb, devInfo)`.
Deterministic repro (inject the solver allocation failure)
INFO Quantization: Module `self_attn.q_proj` -> CPU fallback complete; moving final quantized weights back to cuda:0.
... (all 7 modules)
gptq OK
gptaq CRASH hipsolver error: HIPSOLVER_STATUS_ALLOC_FAILED, when calling `hipsolverDnSpotrf(...)`
foem CRASH hipsolver error: HIPSOLVER_STATUS_ALLOC_FAILED, when calling `hipsolverDnSpotrf(...)`
Suggested fix
Share GPTQ's guarded inverse with GPTAQ and FOEM. Factor the try: hessian_inverse(...) except RuntimeError: if _is_memory_allocation_failure(exc): move H (and W, dXXT for GPTAQ's native delta, the static-group quantizers) to CPU and retry block from GPTQ._quantize_impl into a helper. Then call that helper from gptaq.py:502 and from the FOEM equivalent. The GPTAQ P = alpha * ((dXXT @ Hinv.T).triu(1)) @ Hinv product right after the inverse is another C x C allocation and needs the same treatment.
Test that should have caught it
The #4350/#4464 fallback tests cover GPTQ and QQQ only. Parametrizing them over gptaq=GPTAQConfig() and foem=FOEMConfig() would catch this.
Severity
Medium: GPTAQ/FOEM runs abort on large hidden sizes or shared GPUs, where GPTQ would have finished the module on CPU. Incomplete coverage of #4350/#4400.
Activity
Qubitium commentedon Nov 17, 2026
Claimed by an AI agent. Will reproduce on CPU, fix, add a focused regression test, and open a PR.
fix(gptaq,foem): CPU fallback around the accelerator Hessian inverse (#…
fix(gptaq,foem): CPU fallback around the accelerator Hessian inverse (#…