[quantization] Support GPTQ for Gemma4 - #871
Merged
Merged
Conversation
This commit adds GPTQQuantizer for Gemma4 Co-Authored-By: Cline TICO-DCO-1.0-Signed-off-by: Evgenii Maltsev <e.maltsev@samsung.com>
Torrero
force-pushed
the
gemma_gptq_support
branch
from
August 6, 2026 11:05
d203aae to
dad9d26
Compare
mhs4670go
reviewed
Aug 6, 2026
|
|
||
| # Track whether this batch has vision inputs (pixel_values) | ||
| # Gemma4 uses 'pixel_values' for image inputs. | ||
| # Unlike Qwen3-VL, Gemma4 does not have 'pixel_values_videos'. |
Contributor
There was a problem hiding this comment.
Gemma4 has pixel_values_videos.
Comment on lines
+174
to
+176
| has_vision_input = ( | ||
| "pixel_values" in m_kwargs and m_kwargs["pixel_values"] is not None | ||
| ) |
Contributor
There was a problem hiding this comment.
Suggested change
| has_vision_input = ( | |
| "pixel_values" in m_kwargs and m_kwargs["pixel_values"] is not None | |
| ) | |
| has_vision_input = any( | |
| m_kwargs.get(name) is not None | |
| for name in ("pixel_values", "pixel_values_videos") | |
| ) |
mhs4670go
approved these changes
Aug 6, 2026
mhs4670go
left a comment
Contributor
There was a problem hiding this comment.
LGTM. You can apply above comments in the next PR.
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.
This PR introduces a dedicated GPTQ quantizer for the Gemma4 model.
It adds the full
tico/quantization/algorithm/gemma4_gptq/package (quantizer, GPTQ core, utils, config, README), theGemma4GPTQConfigdataclass inconfig/gemma4_gptq.py, and wires the GPTQ stage into the recipe pipeline. It also updatesgemma4_quantize.yamlto include the GPTQ stage and fixes the example-config test to expect the["gptq", "ptq"]pipeline. A comprehensive test file (test_gemma4_gptq.py, 51 tests) is included.Co-Authored-By: Cline
TICO-DCO-1.0-Signed-off-by: Evgenii Maltsev e.maltsev@samsung.com