Skip to content

Commit

Permalink
add qwen2 ptq map
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanlehome committed Aug 8, 2024
1 parent a6bde28 commit 7844fb7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions paddlenlp/experimental/transformers/qwen2/ptq_scales_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"act_scale":{
"qkv_in_scale": "qwen2.layers.#.self_attn.q_proj.activation_quanter",
"out_linear_in_scale": "qwen2.layers.#.self_attn.o_proj.activation_quanter",
"ffn1_in_scale": "qwen2.layers.#.mlp.gate_proj.activation_quanter",
"ffn2_in_scale": "qwen2.layers.#.mlp.down_proj.activation_quanter"
},
"weight_scale":{
"q_weight_scale":"qwen2.layers.#.self_attn.q_proj.weight_quanter",
"k_weight_scale":"qwen2.layers.#.self_attn.k_proj.weight_quanter",
"v_weight_scale":"qwen2.layers.#.self_attn.v_proj.weight_quanter",
"out_linear_weight_scale":"qwen2.layers.#.self_attn.o_proj.weight_quanter",
"ffn1_1_weight_scale":"qwen2.layers.#.mlp.gate_proj.weight_quanter",
"ffn1_2_weight_scale":"qwen2.layers.#.mlp.up_proj.weight_quanter",
"ffn2_weight_scale":"qwen2.layers.#.mlp.down_proj.weight_quanter"
},
"cachekv_scale":{
"cache_k_scale": "qwen2.layers.#.self_attn.cachek_matmul.activation_quanter",
"cache_v_scale": "qwen2.layers.#.self_attn.cachev_matmul.activation_quanter"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"act_scale":{
"qkv_in_scale": "qwen2.layers.#.self_attn.q_proj.activation_quanter",
"out_linear_in_scale": "qwen2.layers.#.self_attn.o_proj.layer.activation_quanter",
"ffn1_in_scale": "qwen2.layers.#.mlp.gate_proj.activation_quanter",
"ffn2_in_scale": "qwen2.layers.#.mlp.down_proj.layer.activation_quanter"
},
"weight_scale":{
"q_weight_scale":"qwen2.layers.#.self_attn.q_proj.weight_quanter",
"k_weight_scale":"qwen2.layers.#.self_attn.k_proj.weight_quanter",
"v_weight_scale":"qwen2.layers.#.self_attn.v_proj.weight_quanter",
"out_linear_weight_scale":"qwen2.layers.#.self_attn.o_proj.layer.weight_quanter",
"ffn1_1_weight_scale":"qwen2.layers.#.mlp.gate_proj.weight_quanter",
"ffn1_2_weight_scale":"qwen2.layers.#.mlp.up_proj.weight_quanter",
"ffn2_weight_scale":"qwen2.layers.#.mlp.down_proj.layer.weight_quanter"
},
"cachekv_scale":{
"cache_k_scale": "qwen2.layers.#.self_attn.cachek_matmul.activation_quanter",
"cache_v_scale": "qwen2.layers.#.self_attn.cachev_matmul.activation_quanter"
}
}

0 comments on commit 7844fb7

Please sign in to comment.