mirror of
https://github.com/huggingface/transformers.git
synced 2026-10-29 01:06:24 +08:00
* Match a skip-list entry from the start only up to a module boundary
should_convert_module matched an entry from the start of the module name with
no boundary after it, so "model.layers.1" also skipped model.layers.10 to 19,
and Qwen3.8-27B-FP8's router entry "mlp.gate" also skipped the quantized
mlp.gate_proj (its FP8 weight then reached a bf16 linear). A match from the
start now has to end on a "." it consumed, or right before a "." or the end
of the name, which keeps regex entries that carry their own boundary such as
"^model\.audio_tower(?:\.|$)". The endswith clause Hub skip-lists rely on
("gate" covering shared_expert_gate) is unchanged.
Supersedes #47990, which anchors with "$" and so stops matching such regex
entries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Shorten the should_convert_module docstring
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Restore the matching-rules comment of should_convert_module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Move the should_convert_module test to a general quantizer utils test file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Explain why the skip-list key is grouped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fit the skip-list comment within the noisy-comment limits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Name the skip-list test's exclusion lists modules_to_not_convert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>