Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions quark/torch/quantization/config/algo_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,21 @@
],
model_decoder_layers="model.language_model.layers",
),
"gemma4": GPTQConfig(
inside_layer_modules=[
"self_attn.k_proj",
"self_attn.v_proj",
"self_attn.q_proj",
"self_attn.o_proj",
"mlp.up_proj",
"mlp.gate_proj",
"mlp.down_proj",
"experts.*.up_proj",
"experts.*.gate_proj",
"experts.*.down_proj",
],
model_decoder_layers="model.language_model.layers",
),
"gpt_oss": GPTQConfig(
inside_layer_modules=[
"self_attn.q_proj",
Expand Down
26 changes: 26 additions & 0 deletions quark/torch/quantization/config/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ def get(cls, model_type: str) -> LLMTemplate:
- gemma2
- gemma3
- gemma3_text
- gemma4
- glm4_moe
- glm4_moe_lite
- glm_moe_dsa
Expand Down Expand Up @@ -1096,6 +1097,31 @@ def _set_layer_type_config(self, config: QConfig, layer_type_config: dict[type[n
"q_layer_name": "*q_proj",
"exclude_layers_name": ["*lm_head"],
},
"gemma4": {
"kv_layers_name": ["*language_model.*k_proj", "*language_model.*v_proj"],
"q_layer_name": "*language_model.*q_proj",
"exclude_layers_name": [
"*vision_tower*",
"*embed_vision*",
"*audio_tower*",
"*embed_audio*",
"*multi_modal_projector*",
"*lm_head",
"*router.proj",
],
"f2f_weight_converters": [
WeightConverter(
"gate_up_proj",
["gate_proj.weight", "up_proj.weight"],
operations=[SplitFusedExperts(split_axis=0)],
),
WeightConverter(
"down_proj",
["down_proj.weight"],
operations=[SplitFusedExperts(split_axis=0)],
),
],
},
"glm4_moe": {
"kv_layers_name": ["*k_proj", "*v_proj"],
"q_layer_name": "*q_proj",
Expand Down