Repository navigation
fix(gptq): drop the stale del g_h that broke main's lint gate - #5048
Conversation
#5040 made `process()` call `task.release_hessian_state()` when `quantize()` raises; #5043's probe double predates that helper, so the probe fails with AttributeError instead of measuring the reference count. That leaves `tests/test_gptq_processor_hessian_lifetime_5026.py` red on main after #5047 removed the stale `del g_h`. Give the double a no-op hook.
f14a20b to
b2a9687
Compare
|
Superseded: |
|
Reopening: this is not a duplicate of #5047. #5047 fixed the library half ( Cause: Scoped to one test file — no library changes, no overlap with #5047. |
What broke
#5043 (squash
297a5c4c) replaced theg_h = g.Hlocal with a read through the task but left the matchingdel g_hinGPTQProcessor.process(). That isF821 Undefined name 'g_h'from ruff — the lint gate is red onmainfor every worktree that merged it, andNameErroron every GPTQ/GPTAQ/FOEM module processed with a Hessian present (i.e. all of them).tests/test_gptq_processor_hessian_release_5026.pywas 5/5 red onmain:Fix
del g_hand replace the comment that described it. The device assert still readsg.Hwithout binding it, so nothing pins the accumulator acrossquantize()([MEM] GPTQProcessor.process() keeps the task Hessian alive across g.quantize() (local g_h): GPTAQ/FOEM peak VRAM +784 MiB per layer on Llama-3.1-8B (6280 -> 5496 MiB with del g_h, bitwise identical) #5026/fix(gptq): stop pinning the task Hessian across quantize() (#5026) #5040 stay satisfied).tests/test_gptq_processor_hessian_lifetime_5026.pywas written against fix(gptq): stop holding the task Hessian across g.quantize() (#5026) #5043's branch, which predates fix(gptq): stop pinning the task Hessian across quantize() (#5026) #5040'stask.release_hessian_state()call on the failure path. ItsSimpleNamespacedouble now supplies a no-op hook so the probe measures the reference count again instead of raisingAttributeError.The two commits are a semantic merge conflict between #5040 and #5043 that squash-merging did not catch.
Verification
tests/test_gptq_hessian_memory.py::test_hessian_inverse_inverse_step_failure_is_a_candidate_failurefails identically on pristinemain236f31b0(verified in a detached worktree); it is unrelated to this change.Fixes the
main-is-red regression from #5043.