Skip to content

fix(gptq): harden the failed-quantize Hessian release and run the #5026 guards - #5054

Merged
Qubitium merged 1 commit into
mainfrom
root/hessian-release-guard-5026
Nov 18, 2026
Merged

Qubitium merged 1 commit into
mainfrom
root/hessian-release-guard-5026

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to the #5026 sequence (#5040, #5043, #5047). The del g_h half of the
report is already fixed on main (f4511e735), so this PR carries only what is
still broken. It replaces the closed #5050 with a narrower scope.

1. A #5026 regression file fails on main today. process() releases the
task's [C, C] accumulator when g.quantize() raises, through
g.release_hessian_state() — unconditionally. The lifetime probe
(tests/test_gptq_processor_hessian_lifetime_5026.py) drives that path with a
SimpleNamespace task to count strong references, so the teardown raises and
replaces the _StopInQuantize the probe relies on:

$ git checkout 7fea67058 && pytest tests/test_gptq_processor_hessian_lifetime_5026.py
E  AttributeError: 'types.SimpleNamespace' object has no attribute 'release_hessian_state'
1 failed

2. Neither #5026 test file is run by any workflow. That is how a stale
del g_h from a duplicate PR could merge on top of the fix that removed the
local and break every GPTQ/GPTAQ/FOEM quantize() with
UnboundLocalError: cannot access local variable 'g_h' until it was found by
hand.

What Changed

Tests

On unmodified origin/main (7fea67058, both files copied into a separate
worktree):

File Result
tests/test_gptq_processor_hessian_release_5026.py (5 nodes) 5 passed — the del g_h breakage is already fixed on main
tests/test_gptq_processor_hessian_lifetime_5026.py (1 node) 1 failed — AttributeError: 'SimpleNamespace' object has no attribute 'release_hessian_state'

On this branch: 6 passed.

Neighbouring suites (CPU):

Run Result
test_gptq_hessian_memory, test_gptq_shared_hessian, test_gptq_workspace_release, test_gptaq_foem_batch, test_gptaq_shuffle_pairing_4869, test_fallback_hessian_release, test_failed_run_model_state_5009, test_docs_contract_refs + both #5026 files 77 passed, 6 skipped, 1 failed

The single failure is the pre-existing
test_fallback_hessian_release.py::TestFallbackReleasesPartials::test_shared_input_fallback_releases_adopted_source_before_clone
(IndexError: list index out of range), identical on main and unrelated.

ruff check clean on the changed Python file.

Notes

… guards

`GPTQProcessor.process()` releases the task's `[C, C]` accumulator when
`g.quantize()` raises (#5026). The release went through
`g.release_hessian_state()` unconditionally, so a task double without that
method - which is exactly how `tests/test_gptq_processor_hessian_lifetime_5026.py`
probes the reference count - turns the original quantize error into
`AttributeError: 'SimpleNamespace' object has no attribute
'release_hessian_state'`. That test fails on `main` today (`7fea67058`).

Release through the method only when the task provides it, and log (rather than
propagate) a teardown error so the exception that ended `quantize()` is always
the one the caller sees.

Also wire both #5026 regression files into the AWQ CPU `unit` lane. Neither was
run by any workflow, which is how a stale `del g_h` from a duplicate PR could
merge on top of the fix that removed the local and break every GPTQ quantize
until it was found by hand. The lane's path filter already covers
`gptqmodel/looper/**` and `gptqmodel/quantization/**`; add the test glob too.

The `del g_h` half of the original report is already fixed on `main`
(`f4511e735`); this commit carries only what is still missing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant