mwitiderrick commited on
Commit
320ea85
·
1 Parent(s): 36caaf4

Update recipe.yaml

Browse files
Files changed (1) hide show
  1. recipe.yaml +28 -13
recipe.yaml CHANGED
@@ -4,23 +4,38 @@ test_stage:
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.6.mlp.down_proj
18
- - model.layers.24.mlp.down_proj
19
- - model.layers.25.mlp.down_proj
20
- - model.layers.23.mlp.down_proj
21
- - model.layers.2.mlp.down_proj
22
  post_oneshot_calibration: true
23
  scheme_overrides:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  Embedding:
25
  input_activations: null
26
  weights:
 
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.6.mlp.down_proj
18
+ - model.layers.24.mlp.down_proj
19
+ - model.layers.25.mlp.down_proj
20
+ - model.layers.23.mlp.down_proj
21
+ - model.layers.2.mlp.down_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
+ MatMulLeftInput_PV:
35
+ input_activations:
36
+ num_bits: 8
37
+ symmetric: true
38
+ # For the embeddings, only weight-quantization makes sense
39
  Embedding:
40
  input_activations: null
41
  weights: