Repository navigation
Conversation
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
Protocol
-:selectors are matched withpcre.searchin_pattern_matches, but_compile_negative_match_dynamiccopied the selector verbatim intodynamic, where rules are evaluated with a start-anchoredpcre.match. A rule such as["*", "-:down_proj"]therefore excludeddown_projin the protocol but quantized it in the compiledQuantizeConfig. Only.*-prefixed selectors worked by accident.What Changed
gptqmodel/quantization/protocol.py:_compile_negative_match_dynamicnow emits-:.*(?:<selector>), which preserves search semantics under start-anchored matching.-:*compiles to-:.*(exclude everything) instead of an invalid regex.tests/test_protocol_negative_search_4197.py: new regressions covering selectors that do not start with.*(down_proj,mlp\.gate$,\.self_attn\.q_proj$), the-:*case, and the AWQ compilation path. Each case asserts the compileddynamic_getdecision agrees withrule.matches.tests/protocol/test_protocol.py: updated the three exact-key assertions to the new canonical-:.*(?:.*layers\.2.*)form (same behavior).Tests
Repro from the issue now reports
compiled excludes: Truefor bothmodel.layers.0.mlp.down_projandmodel.layers.0.mlp.gate.Fixes #4197