Files changed (1) hide show
  1. README.md +180 -168
README.md CHANGED
@@ -1,168 +1,180 @@
1
- ---
2
- license: apache-2.0
3
- license_link: https://huggingface.co/Qwen/Qwen2.5-14B/blob/main/LICENSE
4
- language:
5
- - en
6
- pipeline_tag: text-generation
7
- base_model: Qwen/Qwen2.5-14B
8
- tags:
9
- - chat
10
- - neuralmagic
11
- - llmcompressor
12
- ---
13
-
14
- # Qwen2.5-14B-FP8-dynamic
15
-
16
- ## Model Overview
17
- - **Model Architecture:** Qwen2
18
- - **Input:** Text
19
- - **Output:** Text
20
- - **Model Optimizations:**
21
- - **Activation quantization:** INT8
22
- - **Weight quantization:** INT8
23
- - **Intended Use Cases:** Intended for commercial and research use multiple languages. Similarly to [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B), this models is intended for assistant-like chat.
24
- - **Out-of-scope:** Use in any manner that violates applicable laws or regulations (including trade compliance laws).
25
- - **Release Date:** 11/27/2024
26
- - **Version:** 1.0
27
- - **License(s):** [apache-2.0](https://huggingface.co/Qwen/Qwen2.5-14B/blob/main/LICENSE)
28
- - **Model Developers:** Neural Magic
29
-
30
- Quantized version of [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B).
31
- It achieves an average score of 75.44 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark (version 1), whereas the unquantized model achieves 75.66.
32
-
33
- ### Model Optimizations
34
-
35
- This model was obtained by quantizing the weights of [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B) to INT8 data type.
36
- This optimization reduces the number of bits used to represent weights and activations from 16 to 8, reducing GPU memory requirements (by approximately 50%) and increasing matrix-multiply compute throughput (by approximately 2x).
37
- Weight quantization also reduces disk size requirements by approximately 50%.
38
-
39
- Only weights and activations of the linear operators within transformers blocks are quantized.
40
- Weights are quantized with a symmetric static per-channel scheme, where a fixed linear scaling factor is applied between INT8 and floating point representations for each output channel dimension.
41
- Activations are quantized with a symmetric dynamic per-token scheme, computing a linear scaling factor at runtime for each token between INT8 and floating point representations.
42
-
43
- ## Deployment
44
-
45
- This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
46
-
47
- ```python
48
- from vllm import LLM, SamplingParams
49
- from transformers import AutoTokenizer
50
-
51
- model_id = "neuralmagic/Qwen2.5-14B-FP8-dynamic"
52
- number_gpus = 1
53
- max_model_len = 8192
54
-
55
- sampling_params = SamplingParams(temperature=0.7, top_p=0.8, max_tokens=256)
56
-
57
- tokenizer = AutoTokenizer.from_pretrained(model_id)
58
-
59
- prompt = "Give me a short introduction to large language model."
60
-
61
- llm = LLM(model=model_id, tensor_parallel_size=number_gpus, max_model_len=max_model_len)
62
-
63
- outputs = llm.generate(prompt, sampling_params)
64
-
65
- generated_text = outputs[0].outputs[0].text
66
- print(generated_text)
67
- ```
68
-
69
- vLLM aslo supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
70
-
71
-
72
- ## Evaluation
73
-
74
- The model was evaluated on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) leaderboard tasks (version 1) with the [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/383bbd54bc621086e05aa1b030d8d4d5635b25e6) (commit 383bbd54bc621086e05aa1b030d8d4d5635b25e6) and the [vLLM](https://docs.vllm.ai/en/stable/) engine, using the following command:
75
- ```
76
- lm_eval \
77
- --model vllm \
78
- --model_args pretrained="neuralmagic/Qwen2.5-14B-FP8-dynamic",dtype=auto,gpu_memory_utilization=0.9,add_bos_token=True,max_model_len=4096,enable_chunk_prefill=True,tensor_parallel_size=1 \
79
- --tasks openllm \
80
- --batch_size auto
81
- ```
82
-
83
- ### Accuracy
84
-
85
- #### Open LLM Leaderboard evaluation scores
86
- <table>
87
- <tr>
88
- <td><strong>Benchmark</strong>
89
- </td>
90
- <td><strong>Qwen2.5-14B</strong>
91
- </td>
92
- <td><strong>Qwen2.5-14B-FP8-dynamic (this model)</strong>
93
- </td>
94
- <td><strong>Recovery</strong>
95
- </td>
96
- </tr>
97
- <tr>
98
- <td>MMLU (5-shot)
99
- </td>
100
- <td>79.71
101
- </td>
102
- <td>79.48
103
- </td>
104
- <td>99.7%
105
- </td>
106
- </tr>
107
- <tr>
108
- <td>ARC Challenge (25-shot)
109
- </td>
110
- <td>65.70
111
- </td>
112
- <td>65.19
113
- </td>
114
- <td>99.2%
115
- </td>
116
- </tr>
117
- <tr>
118
- <td>GSM-8K (5-shot, strict-match)
119
- </td>
120
- <td>84.46
121
- </td>
122
- <td>83.62
123
- </td>
124
- <td>99.0%
125
- </td>
126
- </tr>
127
- <tr>
128
- <td>Hellaswag (10-shot)
129
- </td>
130
- <td>84.28
131
- </td>
132
- <td>84.28
133
- </td>
134
- <td>100.0%
135
- </td>
136
- </tr>
137
- <tr>
138
- <td>Winogrande (5-shot)
139
- </td>
140
- <td>81.37
141
- </td>
142
- <td>81.77
143
- </td>
144
- <td>100.5%
145
- </td>
146
- </tr>
147
- <tr>
148
- <td>TruthfulQA (0-shot, mc2)
149
- </td>
150
- <td>58.46
151
- </td>
152
- <td>58.30
153
- </td>
154
- <td>99.7%
155
- </td>
156
- </tr>
157
- <tr>
158
- <td><strong>Average</strong>
159
- </td>
160
- <td><strong>75.66</strong>
161
- </td>
162
- <td><strong>75.44</strong>
163
- </td>
164
- <td><strong>99.7%</strong>
165
- </td>
166
- </tr>
167
- </table>
168
-
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ license_link: https://huggingface.co/Qwen/Qwen2.5-14B/blob/main/LICENSE
4
+ language:
5
+ - zho
6
+ - eng
7
+ - fra
8
+ - spa
9
+ - por
10
+ - deu
11
+ - ita
12
+ - rus
13
+ - jpn
14
+ - kor
15
+ - vie
16
+ - tha
17
+ - ara
18
+ pipeline_tag: text-generation
19
+ base_model: Qwen/Qwen2.5-14B
20
+ tags:
21
+ - chat
22
+ - neuralmagic
23
+ - llmcompressor
24
+ ---
25
+
26
+ # Qwen2.5-14B-FP8-dynamic
27
+
28
+ ## Model Overview
29
+ - **Model Architecture:** Qwen2
30
+ - **Input:** Text
31
+ - **Output:** Text
32
+ - **Model Optimizations:**
33
+ - **Activation quantization:** INT8
34
+ - **Weight quantization:** INT8
35
+ - **Intended Use Cases:** Intended for commercial and research use multiple languages. Similarly to [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B), this models is intended for assistant-like chat.
36
+ - **Out-of-scope:** Use in any manner that violates applicable laws or regulations (including trade compliance laws).
37
+ - **Release Date:** 11/27/2024
38
+ - **Version:** 1.0
39
+ - **License(s):** [apache-2.0](https://huggingface.co/Qwen/Qwen2.5-14B/blob/main/LICENSE)
40
+ - **Model Developers:** Neural Magic
41
+
42
+ Quantized version of [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B).
43
+ It achieves an average score of 75.44 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark (version 1), whereas the unquantized model achieves 75.66.
44
+
45
+ ### Model Optimizations
46
+
47
+ This model was obtained by quantizing the weights of [Qwen2.5-14B](https://huggingface.co/Qwen/Qwen2.5-14B) to INT8 data type.
48
+ This optimization reduces the number of bits used to represent weights and activations from 16 to 8, reducing GPU memory requirements (by approximately 50%) and increasing matrix-multiply compute throughput (by approximately 2x).
49
+ Weight quantization also reduces disk size requirements by approximately 50%.
50
+
51
+ Only weights and activations of the linear operators within transformers blocks are quantized.
52
+ Weights are quantized with a symmetric static per-channel scheme, where a fixed linear scaling factor is applied between INT8 and floating point representations for each output channel dimension.
53
+ Activations are quantized with a symmetric dynamic per-token scheme, computing a linear scaling factor at runtime for each token between INT8 and floating point representations.
54
+
55
+ ## Deployment
56
+
57
+ This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
58
+
59
+ ```python
60
+ from vllm import LLM, SamplingParams
61
+ from transformers import AutoTokenizer
62
+
63
+ model_id = "neuralmagic/Qwen2.5-14B-FP8-dynamic"
64
+ number_gpus = 1
65
+ max_model_len = 8192
66
+
67
+ sampling_params = SamplingParams(temperature=0.7, top_p=0.8, max_tokens=256)
68
+
69
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
70
+
71
+ prompt = "Give me a short introduction to large language model."
72
+
73
+ llm = LLM(model=model_id, tensor_parallel_size=number_gpus, max_model_len=max_model_len)
74
+
75
+ outputs = llm.generate(prompt, sampling_params)
76
+
77
+ generated_text = outputs[0].outputs[0].text
78
+ print(generated_text)
79
+ ```
80
+
81
+ vLLM aslo supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
82
+
83
+
84
+ ## Evaluation
85
+
86
+ The model was evaluated on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) leaderboard tasks (version 1) with the [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/383bbd54bc621086e05aa1b030d8d4d5635b25e6) (commit 383bbd54bc621086e05aa1b030d8d4d5635b25e6) and the [vLLM](https://docs.vllm.ai/en/stable/) engine, using the following command:
87
+ ```
88
+ lm_eval \
89
+ --model vllm \
90
+ --model_args pretrained="neuralmagic/Qwen2.5-14B-FP8-dynamic",dtype=auto,gpu_memory_utilization=0.9,add_bos_token=True,max_model_len=4096,enable_chunk_prefill=True,tensor_parallel_size=1 \
91
+ --tasks openllm \
92
+ --batch_size auto
93
+ ```
94
+
95
+ ### Accuracy
96
+
97
+ #### Open LLM Leaderboard evaluation scores
98
+ <table>
99
+ <tr>
100
+ <td><strong>Benchmark</strong>
101
+ </td>
102
+ <td><strong>Qwen2.5-14B</strong>
103
+ </td>
104
+ <td><strong>Qwen2.5-14B-FP8-dynamic (this model)</strong>
105
+ </td>
106
+ <td><strong>Recovery</strong>
107
+ </td>
108
+ </tr>
109
+ <tr>
110
+ <td>MMLU (5-shot)
111
+ </td>
112
+ <td>79.71
113
+ </td>
114
+ <td>79.48
115
+ </td>
116
+ <td>99.7%
117
+ </td>
118
+ </tr>
119
+ <tr>
120
+ <td>ARC Challenge (25-shot)
121
+ </td>
122
+ <td>65.70
123
+ </td>
124
+ <td>65.19
125
+ </td>
126
+ <td>99.2%
127
+ </td>
128
+ </tr>
129
+ <tr>
130
+ <td>GSM-8K (5-shot, strict-match)
131
+ </td>
132
+ <td>84.46
133
+ </td>
134
+ <td>83.62
135
+ </td>
136
+ <td>99.0%
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <td>Hellaswag (10-shot)
141
+ </td>
142
+ <td>84.28
143
+ </td>
144
+ <td>84.28
145
+ </td>
146
+ <td>100.0%
147
+ </td>
148
+ </tr>
149
+ <tr>
150
+ <td>Winogrande (5-shot)
151
+ </td>
152
+ <td>81.37
153
+ </td>
154
+ <td>81.77
155
+ </td>
156
+ <td>100.5%
157
+ </td>
158
+ </tr>
159
+ <tr>
160
+ <td>TruthfulQA (0-shot, mc2)
161
+ </td>
162
+ <td>58.46
163
+ </td>
164
+ <td>58.30
165
+ </td>
166
+ <td>99.7%
167
+ </td>
168
+ </tr>
169
+ <tr>
170
+ <td><strong>Average</strong>
171
+ </td>
172
+ <td><strong>75.66</strong>
173
+ </td>
174
+ <td><strong>75.44</strong>
175
+ </td>
176
+ <td><strong>99.7%</strong>
177
+ </td>
178
+ </tr>
179
+ </table>
180
+