Repository navigation
fix(looper): dedup shared-input Hessians for QQQ/VPTQ/MACaQ/EXL3 and GPTAQ/FOEM (#4401, #4391) - #4514
Merged
Merged
Conversation
Add SharedInputCaptureProcessor(SharedInputCaptureMixin, LoopProcessor) that
explicitly delegates begin_shared_input_capture/end_shared_input_capture to
the mixin, and have QQQ, VPTQ, MACaQ and EXL3 inherit that single base. This
removes the conflicting inherited attributes flagged by code quality while
preserving the mixin's leader election and adoption behavior. LoopProcessor
keeps its no-op defaults for every other processor.
Add tests asserting the four processors resolve the wrapper methods, that the
wrappers delegate to the mixin (non-empty leaders, verified telemetry), and
that a bare LoopProcessor still returns {} / None.
13 tasks done
Qubitium
added a commit
that referenced
this pull request
Nov 29, 2026
…s private copy GPTQProcessor carried its own copy of the shared-input leader election (_resolve_shared_input_plan, begin/end_shared_input_capture, shared_input_leader and the inline election loop). #4514 introduced SharedInputCaptureMixin with the same algorithm for QQQ, VPTQ, MACaQ and EXL3 but left the GPTQ copy in place. GPTQProcessor now derives from SharedInputCaptureProcessor and keeps only its GPTQ-specific parts as mixin hooks: - _shared_input_task_enabled: the per-task hessian.dedup_shared_inputs check. - _shared_input_task_signature: the former _hessian_capture_signature (GPTQ/ADMM-Q, GPTAQ, FOEM and JointQ cohorts), renamed. - _shared_input_begin_cohort: clears the plain-GPTQ factor caches of the subset. The mixin hook now also receives subset_names, because GPTQ only clears tasks in the subset. - _shared_input_task_adopt: adopts the Hessian, then attaches one SharedHessianFactorCache per plain-GPTQ leader. The leader's cache was cleared when the cohort began, so its first follower creates the cache and the rest join it. That matches the old per-call dict without the processor holding a reference to cached factors after the pass ends. Shared-input dedup decides which modules share a Hessian, so the leaders, telemetry, per-task H/dXXT/quantized weights and factor-cache identity graph were compared against origin/main on CPU fixtures. GPTQ and GPTAQ quantization of Qwen2.5-0.5B-Instruct and of a tiny random Mixtral (a shared-input verified MoE, so expert gate/up share a Hessian) were also compared on GPU, together with the sorted quant-log rows and dedup telemetry. All of them are bit-identical. Two observable differences remain. The generation counter now also advances when a model has no shared-input plan; no factor cache exists then, and every cache that is created keeps the same generation as before. The mismatch warning says "accumulation settings" instead of "capture settings". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
added a commit
that referenced
this pull request
Nov 29, 2026
…s private copy (#6428) GPTQProcessor carried its own copy of the shared-input leader election (_resolve_shared_input_plan, begin/end_shared_input_capture, shared_input_leader and the inline election loop). #4514 introduced SharedInputCaptureMixin with the same algorithm for QQQ, VPTQ, MACaQ and EXL3 but left the GPTQ copy in place. GPTQProcessor now derives from SharedInputCaptureProcessor and keeps only its GPTQ-specific parts as mixin hooks: - _shared_input_task_enabled: the per-task hessian.dedup_shared_inputs check. - _shared_input_task_signature: the former _hessian_capture_signature (GPTQ/ADMM-Q, GPTAQ, FOEM and JointQ cohorts), renamed. - _shared_input_begin_cohort: clears the plain-GPTQ factor caches of the subset. The mixin hook now also receives subset_names, because GPTQ only clears tasks in the subset. - _shared_input_task_adopt: adopts the Hessian, then attaches one SharedHessianFactorCache per plain-GPTQ leader. The leader's cache was cleared when the cohort began, so its first follower creates the cache and the rest join it. That matches the old per-call dict without the processor holding a reference to cached factors after the pass ends. Shared-input dedup decides which modules share a Hessian, so the leaders, telemetry, per-task H/dXXT/quantized weights and factor-cache identity graph were compared against origin/main on CPU fixtures. GPTQ and GPTAQ quantization of Qwen2.5-0.5B-Instruct and of a tiny random Mixtral (a shared-input verified MoE, so expert gate/up share a Hessian) were also compared on GPU, together with the sorted quant-log rows and dedup telemetry. All of them are bit-identical. Two observable differences remain. The generation counter now also advances when a model has no shared-input plan; no factor cache exists then, and every cache that is created keeps the same generation as before. The mismatch warning says "accumulation settings" instead of "capture settings". Co-authored-by: Claude Opus 5.5 <[email protected]>
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 #4401 item 3 and #4391 item 4 (second half).
dXXTwhere accumulated) instead of each building an identical copy. GPTQ already had this dedup; these methods were excluded because they "also consume outputs", which is not true of theiradd_batchHessian accumulation.HanddXXTatbs>1instead of accumulating identical matrices per sibling (q/k/v ×3, gate/up ×2), and the stale comment is corrected.Validation
pytest tests/test_shared_input_hessian_dedup_methods.py -q→ 14 passedpytest tests/test_gptaq_foem_batch.py tests/test_native_sibling_input_sharing.py -q→ 22 passedResolves #4401 (item 3) and the remaining item of #4391.