mwitiderrick
commited on
Commit
•
2c602c7
1
Parent(s):
f2a00f4
Create recipe.yaml
Browse files- recipe.yaml +47 -0
recipe.yaml
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.21.mlp.down_proj
|
18 |
+
- model.layers.7.mlp.down_proj
|
19 |
+
- model.layers.2.mlp.down_proj
|
20 |
+
- model.layers.8.self_attn.q_proj
|
21 |
+
- model.layers.8.self_attn.k_proj
|
22 |
+
post_oneshot_calibration: true
|
23 |
+
scheme_overrides:
|
24 |
+
# Enable channelwise quantization for better accuracy
|
25 |
+
Linear:
|
26 |
+
weights:
|
27 |
+
num_bits: 8
|
28 |
+
symmetric: true
|
29 |
+
strategy: channel
|
30 |
+
MatMulLeftInput_QK:
|
31 |
+
input_activations:
|
32 |
+
num_bits: 8
|
33 |
+
symmetric: true
|
34 |
+
# For the embeddings, only weight-quantization makes sense
|
35 |
+
Embedding:
|
36 |
+
input_activations: null
|
37 |
+
weights:
|
38 |
+
num_bits: 8
|
39 |
+
symmetric: false
|
40 |
+
SparseGPTModifier:
|
41 |
+
sparsity: 0.5
|
42 |
+
block_size: 128
|
43 |
+
sequential_update: true
|
44 |
+
quantize: true
|
45 |
+
percdamp: 0.01
|
46 |
+
mask_structure: "0:0"
|
47 |
+
targets: ["re:model.layers.\\d*$"]
|