Skip to content

Commit 9a11f52

Browse files
authored
Add: deepseekv2 smoothquant mappings (#1433)
This PR adds deafult smoothquant mappings for Deepseekv2! Test Plan: Checked that `examples/quantizing_moe/deepseek_moe_w8a8_int8.py` runs with a smoothquant modifier (w/o having to specify mapings) Signed-off-by: Rahul Tuli <[email protected]>
1 parent c00f238 commit 9a11f52

File tree

1 file changed

+11
-0
lines changed
  • src/llmcompressor/modifiers/smoothquant

1 file changed

+11
-0
lines changed

src/llmcompressor/modifiers/smoothquant/utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
6363
),
6464
]
6565

66+
DEEPSEEK_V2_SMOOTHQUANT_MAPPINGS: List[LayerMap] = [
67+
LayerMap(
68+
balance_layers=["re:.*q_proj", "re:.*kv_a_proj_with_mqa"],
69+
smooth_layers="re:.*input_layernorm",
70+
),
71+
LayerMap(
72+
balance_layers=["re:.*gate"], smooth_layers="re:.*post_attention_layernorm"
73+
),
74+
]
75+
6676

6777
# Registry of layer mappings for different architectures
6878
# Add more mappings here
@@ -75,6 +85,7 @@
7585
"ChatGLMForConditionalGeneration": BLOOM_SMOOTHQUANT_MAPPINGS,
7686
"Phi3VForCausalLM": PHI3_VISION_SMOOTHQUANT_MAPPINGS,
7787
"WhisperForConditionalGeneration": WHISPER_V2_SMOOTHQUANT_MAPPINGS,
88+
"DeepseekV2ForCausalLM": DEEPSEEK_V2_SMOOTHQUANT_MAPPINGS,
7889
}
7990

8091

0 commit comments

Comments
 (0)