Skip to content

[quantization] fix QuantGemma4ClippableLinear module - #855

Open
Torrero wants to merge 1 commit into
Samsung:mainfrom
Torrero:fix_QuantGemma4ClippableLinear
Open

[quantization] fix QuantGemma4ClippableLinear module#855
Torrero wants to merge 1 commit into
Samsung:mainfrom
Torrero:fix_QuantGemma4ClippableLinear

Conversation

@Torrero

@Torrero Torrero commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR corrects fp_name for QuantGemma4ClippableLinear module and introduces _clippable_linear_tree_override in gemma4_builders.py.

Why

  • The fp_name passed to the inner PTQWrapper was wrong — it passed the parent's name (e.g., "layers.0.self_attn.q_proj") instead of the child's qualified name (e.g., "layers.0.self_attn.q_proj.linear").
  • New _clippable_linear_tree_override resolves the problem when vision modules use Gemma4ClippableLinear (which wraps an inner nn.Linear as .linear), and QuantGemma4ClippableLinear scopes the child config via qcfg.child("linear"). As Example, the builder was placing weight overrides at gate_proj.weight instead of gate_proj.linear.weight, so qcfg.child("linear") found nothing. test_builders.py has been corrected accordingly.

TICO-DCO-1.0-Signed-off-by: Evgenii Maltsev e.maltsev@samsung.com

@Torrero
Torrero requested a review from mhs4670go August 4, 2026 19:29
@Torrero
Torrero force-pushed the fix_QuantGemma4ClippableLinear branch from c2cb6bf to b638c9a Compare August 4, 2026 20:22
This commit corrects the `fp_name` of inner linear wrapper of QuantGemma4ClippableLinear
and introduces _clippable_linear_tree_override in gemma4_builders.py

TICO-DCO-1.0-Signed-off-by:  Evgenii Maltsev <e.maltsev@samsung.com>
@Torrero
Torrero force-pushed the fix_QuantGemma4ClippableLinear branch from b638c9a to 648f3e7 Compare August 4, 2026 21:03
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.

1 participant