Repository navigation
fix(gptaq,foem): CPU fallback around the accelerator Hessian inverse (#4604) - #4618
Merged
Merged
Conversation
…4604) GPTAQ and FOEM re-implemented the block pass but called hessian_inverse without GPTQ's allocation guard, so a cuSOLVER/hipSOLVER workspace OOM aborted the run. Share GPTQ's retry helper: move the Hessian, weight, native delta, act-order permutations and static-group quantizers to the host, rerun the inverse (and GPTAQ's native-delta product), then move the result back to the module device.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4604 (#4350/#4400 incomplete). GPTAQ and FOEM re-implement the block pass but called
hessian_inverse(and GPTAQ's native-delta product) without GPTQ's allocation guard, so a cuSOLVER/hipSOLVER workspace OOM aborted a run GPTQ would have finished on CPU._run_with_accelerator_oom_cpu_fallback(compute, source_device, stage, prepare_cpu).prepare_cpumoves the Hessian, weight, native delta, act-order permutations,global_perm/final_perm, static-group quantizers and scale/zero to the host, the inverse (and GPTAQ delta product) reruns entirely on CPU, and the finalQis moved back to the module device.desc_act,act_group_awareandstatic_groupscombinations, including the ungroupeddesc_actmeasurement rebuild.Validation
tests/test_gptaq_foem_oom_fallback_4604.py→ 20 passed (forced OOM → CPU retry completes; Q/g_idxbitwise equal to a host reference; results back on device; both GPTAQ and FOEM, all ordering modes)ruff check gptqmodel docs/eora tests setup.pycleanResidual: the fallback is exercised with a forced OOM; no real solver-workspace exhaustion was reproduced.
Resolves #4604.