mwitiderrick
commited on
Commit
•
6f7231f
1
Parent(s):
470d8d3
Create quantize.yaml
Browse files- quantize.yaml +41 -0
quantize.yaml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
test_stage:
|
2 |
+
obcq_modifiers:
|
3 |
+
LogarithmicEqualizationModifier:
|
4 |
+
mappings: [
|
5 |
+
[["re:.*q_proj", "re:.*k_proj", "re:.*v_proj"], "re:.*input_layernorm"],
|
6 |
+
[["re:.*gate_proj", "re:.*up_proj"], "re:.*post_attention_layernorm"],
|
7 |
+
]
|
8 |
+
QuantizationModifier:
|
9 |
+
ignore:
|
10 |
+
# These operations don't make sense to quantize
|
11 |
+
- LlamaRotaryEmbedding
|
12 |
+
- LlamaRMSNorm
|
13 |
+
- SiLUActivation
|
14 |
+
- MatMulOutput_QK
|
15 |
+
- MatMulOutput_PV
|
16 |
+
# Skip quantizing the layers with the most sensitive activations
|
17 |
+
- model.layers.1.mlp.down_proj
|
18 |
+
- model.layers.30.mlp.down_proj
|
19 |
+
- model.layers.31.mlp.down_proj
|
20 |
+
- model.layers.28.mlp.down_proj
|
21 |
+
- model.layers.29.mlp.down_proj
|
22 |
+
post_oneshot_calibration: true
|
23 |
+
scheme_overrides:
|
24 |
+
Linear:
|
25 |
+
weights:
|
26 |
+
num_bits: 8
|
27 |
+
symmetric: true
|
28 |
+
strategy: channel
|
29 |
+
MatMulLeftInput_QK:
|
30 |
+
input_activations:
|
31 |
+
num_bits: 8
|
32 |
+
symmetric: true
|
33 |
+
MatMulLeftInput_PV:
|
34 |
+
input_activations:
|
35 |
+
num_bits: 8
|
36 |
+
symmetric: true
|
37 |
+
Embedding:
|
38 |
+
input_activations: null
|
39 |
+
weights:
|
40 |
+
num_bits: 8
|
41 |
+
symmetric: false
|