Repository navigation
fix(config): reject exclude_attention_sinks on paths that ignore it (#4447) - #4525
Merged
Merged
Conversation
…4447) The attention-sink mask is only implemented by the plain GPTQ Hessian path, but the flag was accepted (and serialized as true) by VPTQ, by dynamic overrides that were never applied, by per-module GPTAQ/FOEM rules, and by the AWQ/ParoQuant factory. - mark GPTQConfig as mask-capable; QQQ/VPTQ reject the flag explicitly - copy and validate dynamic exclude_attention_sinks in the module clone - reject dynamic GPTAQ/FOEM rules that would ignore the mask, re-check after the clone applies mutable dynamic edits - reject the flag in the factory for every method without the mask (AWQ, ParoQuant, EXL3, MACaQ, FP8, NF12, TT-blockfloat, bnb, GGUF) - keep legacy checkpoints loadable: repair metadata that claims true on a path that never masked, and warn instead of raising
This was referenced Nov 17, 2026
Qubitium
added a commit
that referenced
this pull request
Nov 17, 2026
…mask (#4393) Move the attention-sink opt-in from `GPTQConfig.exclude_attention_sinks` to the calibration config, `quantize(..., calibration_exclude_attention_sinks=True)` (`CalibrationConfig.exclude_attention_sinks`), and apply it once, in the shared calibration keep-mask, so every calibration method drops the same rows. Rule: every attended BOS token is excluded (the leading one, after left or right padding, and each document-boundary BOS of concatenated calibration). Nothing else is: a tokenizer without a BOS token (Qwen2/2.5/3) keeps every row and its checkpoint is bitwise identical to the default run (#4459). - `LoopProcessor.calibration_keep_mask` edits the padding mask per batch; `_mask_tls.padding_value` keeps the padding-only mask for forward-visible consumers (MoE padding zeroing, NVFP4 amax, EXL3/DeepSeek-V4 router evidence). Token totals and the zero-sample threshold use the retained rows. - Consumers: GPTQ/GPTAQ/FOEM/native capture, QQQ, MACaQ, EXL3 capture, AWQ features and token-row structure, calibrated FP8 GSQ. Natively routed experts and VLM batches whose sequence cannot be placed keep their rows. - VPTQ rejects the option (PPL 4.5-4.7x worse on Llama-3.2-1B/-Instruct); ParoQuant and staged GSQ reject it; `quantize()` rejects a `dynamic[...].exclude_attention_sinks` rule. - Remove the GPTQConfig field and its per-method plumbing from #4440, #4525, #4526 and #4610 (`attention_sink_mask_supported`, factory/dynamic/load sanitizers, `GPTQ._attention_sink_row_keep`, `attention_sink_bos_flags`). `GPTQConfig(exclude_attention_sinks=...)` now raises `TypeError`. - Supersede the GPTQ-only #4568 fix (#4610): the BOS positions are resolved from the prepared `input_ids` and `tokenizer.bos_token_id` when the processor is built, before `release_calibration_dataset()`, for every calibration method; #4610's per-batch decision cache in `GPTQProcessor`, its dynamic gating and its Hessian-share signature field are removed. - Provenance: `meta.calibration_exclude_attention_sinks: true` only when on. - test_llama3_2: forward the switch through the new kwarg and re-baseline the slow metrics for the new rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qubitium
added a commit
that referenced
this pull request
Nov 17, 2026
…mask (#4393) (#4663) * feat(calibration): exclude attention sinks in the shared calibration mask (#4393) Move the attention-sink opt-in from `GPTQConfig.exclude_attention_sinks` to the calibration config, `quantize(..., calibration_exclude_attention_sinks=True)` (`CalibrationConfig.exclude_attention_sinks`), and apply it once, in the shared calibration keep-mask, so every calibration method drops the same rows. Rule: every attended BOS token is excluded (the leading one, after left or right padding, and each document-boundary BOS of concatenated calibration). Nothing else is: a tokenizer without a BOS token (Qwen2/2.5/3) keeps every row and its checkpoint is bitwise identical to the default run (#4459). - `LoopProcessor.calibration_keep_mask` edits the padding mask per batch; `_mask_tls.padding_value` keeps the padding-only mask for forward-visible consumers (MoE padding zeroing, NVFP4 amax, EXL3/DeepSeek-V4 router evidence). Token totals and the zero-sample threshold use the retained rows. - Consumers: GPTQ/GPTAQ/FOEM/native capture, QQQ, MACaQ, EXL3 capture, AWQ features and token-row structure, calibrated FP8 GSQ. Natively routed experts and VLM batches whose sequence cannot be placed keep their rows. - VPTQ rejects the option (PPL 4.5-4.7x worse on Llama-3.2-1B/-Instruct); ParoQuant and staged GSQ reject it; `quantize()` rejects a `dynamic[...].exclude_attention_sinks` rule. - Remove the GPTQConfig field and its per-method plumbing from #4440, #4525, #4526 and #4610 (`attention_sink_mask_supported`, factory/dynamic/load sanitizers, `GPTQ._attention_sink_row_keep`, `attention_sink_bos_flags`). `GPTQConfig(exclude_attention_sinks=...)` now raises `TypeError`. - Supersede the GPTQ-only #4568 fix (#4610): the BOS positions are resolved from the prepared `input_ids` and `tokenizer.bos_token_id` when the processor is built, before `release_calibration_dataset()`, for every calibration method; #4610's per-batch decision cache in `GPTQProcessor`, its dynamic gating and its Hessian-share signature field are removed. - Provenance: `meta.calibration_exclude_attention_sinks: true` only when on. - test_llama3_2: forward the switch through the new kwarg and re-baseline the slow metrics for the new rule. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(gptq): keep process_batch signature compatible with its overrides --------- 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 #4447. Every method/path now either implements
exclude_attention_sinksor rejects it, and checkpoint metadata always reflects what actually ran.dynamicsinks onlydynamicGPTAQ/FOEM + sinksKey fix: rejecting at construction made pre-fix VPTQ/QQQ checkpoints unloadable, because
from_quant_configliftsmeta.exclude_attention_sinksinto the constructor. Load is now lenient: unsupported legacy metadata is coerced tofalsewith a warning and re-saved truthfully; explicit construction still raises.Validation
pytest tests/test_attention_sink_config_coverage_4447.py -q→ 37 passed (includes an nsamples A/B proof that the dynamic copy changes the Hessian)pytest tests/test_gptq.py -q→ 74 passed, 3 skippedruff checkcleanResidual: directly constructing GPTAQ/FOEM after mutating
qcfg.exclude_attention_sinksbypasses the processor clone guard; load-time repair is warn-and-coerce by design.Resolves #4447.