Skip to content

[quantization] Support GPTQ for Gemma4 - #871

Merged
mhs4670go merged 1 commit into
Samsung:mainfrom
Torrero:gemma_gptq_support
Aug 6, 2026
Merged

[quantization] Support GPTQ for Gemma4#871
mhs4670go merged 1 commit into
Samsung:mainfrom
Torrero:gemma_gptq_support

Conversation

@Torrero

@Torrero Torrero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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), the Gemma4GPTQConfig dataclass in config/gemma4_gptq.py, and wires the GPTQ stage into the recipe pipeline. It also updates gemma4_quantize.yaml to 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

@Torrero
Torrero requested a review from mhs4670go August 6, 2026 10:47
This commit adds GPTQQuantizer for Gemma4

Co-Authored-By: Cline

TICO-DCO-1.0-Signed-off-by:  Evgenii Maltsev <e.maltsev@samsung.com>
@Torrero
Torrero force-pushed the gemma_gptq_support branch from d203aae to dad9d26 Compare August 6, 2026 11:05

# 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'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mhs4670go left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. You can apply above comments in the next PR.

@mhs4670go
mhs4670go merged commit dade21e into Samsung:main Aug 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants