Improve language tag
#1
by
lbourdois
- opened
README.md
CHANGED
|
@@ -1,242 +1,254 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
license_link: https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct/blob/main/LICENSE
|
| 4 |
-
language:
|
| 5 |
-
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
from
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
<td>
|
| 101 |
-
</td>
|
| 102 |
-
<td>
|
| 103 |
-
</td>
|
| 104 |
-
<td>
|
| 105 |
-
</td>
|
| 106 |
-
<td>
|
| 107 |
-
</td>
|
| 108 |
-
</tr>
|
| 109 |
-
<tr>
|
| 110 |
-
<td>
|
| 111 |
-
</td>
|
| 112 |
-
<td>
|
| 113 |
-
</td>
|
| 114 |
-
<td>
|
| 115 |
-
</td>
|
| 116 |
-
<td>
|
| 117 |
-
</td>
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
<td>
|
| 123 |
-
</td>
|
| 124 |
-
<td>33.
|
| 125 |
-
</td>
|
| 126 |
-
<td>
|
| 127 |
-
</td>
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
<td>
|
| 133 |
-
</td>
|
| 134 |
-
<td>
|
| 135 |
-
</td>
|
| 136 |
-
<td>
|
| 137 |
-
</td>
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
<td>
|
| 143 |
-
</td>
|
| 144 |
-
<td>
|
| 145 |
-
</td>
|
| 146 |
-
<td>
|
| 147 |
-
</td>
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
<td>
|
| 153 |
-
</td>
|
| 154 |
-
<td>
|
| 155 |
-
</td>
|
| 156 |
-
<td>
|
| 157 |
-
</td>
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
<td
|
| 163 |
-
</td>
|
| 164 |
-
<td
|
| 165 |
-
</td>
|
| 166 |
-
<td
|
| 167 |
-
</td>
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
<td>
|
| 173 |
-
</td>
|
| 174 |
-
<td>
|
| 175 |
-
</td>
|
| 176 |
-
<td>
|
| 177 |
-
</td>
|
| 178 |
-
<td>
|
| 179 |
-
</td>
|
| 180 |
-
</tr>
|
| 181 |
-
<tr>
|
| 182 |
-
<td>
|
| 183 |
-
</td>
|
| 184 |
-
<td>
|
| 185 |
-
</td>
|
| 186 |
-
<td>
|
| 187 |
-
</td>
|
| 188 |
-
<td>
|
| 189 |
-
</td>
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
<td>
|
| 195 |
-
</td>
|
| 196 |
-
<td>
|
| 197 |
-
</td>
|
| 198 |
-
<td>
|
| 199 |
-
</td>
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
<td>
|
| 205 |
-
</td>
|
| 206 |
-
<td>
|
| 207 |
-
</td>
|
| 208 |
-
<td
|
| 209 |
-
</td>
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
<td>
|
| 215 |
-
</td>
|
| 216 |
-
<td>
|
| 217 |
-
</td>
|
| 218 |
-
<td>
|
| 219 |
-
</td>
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
<td>
|
| 225 |
-
</td>
|
| 226 |
-
<td>
|
| 227 |
-
</td>
|
| 228 |
-
<td>
|
| 229 |
-
</td>
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
<td
|
| 235 |
-
</td>
|
| 236 |
-
<td
|
| 237 |
-
</td>
|
| 238 |
-
<td
|
| 239 |
-
</td>
|
| 240 |
-
|
| 241 |
-
</
|
| 242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
license_link: https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct/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-0.5B-Instruct
|
| 20 |
+
tags:
|
| 21 |
+
- chat
|
| 22 |
+
- neuralmagic
|
| 23 |
+
- llmcompressor
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Qwen2.5-0.5B-Instruct-quantized.w8a8
|
| 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-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct), 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:** 10/09/2024
|
| 38 |
+
- **Version:** 1.0
|
| 39 |
+
- **License(s):** [apache-2.0](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct/blob/main/LICENSE)
|
| 40 |
+
- **Model Developers:** Neural Magic
|
| 41 |
+
|
| 42 |
+
Quantized version of [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct).
|
| 43 |
+
It achieves an average score of 43.38 on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) benchmark version 1 and 23.42 on version 2, whereas the unquantized model achieves 43.64 on version 1 and 23.39 on version 2.
|
| 44 |
+
|
| 45 |
+
### Model Optimizations
|
| 46 |
+
|
| 47 |
+
This model was obtained by quantizing the weights of [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) 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-0.5B-Instruct-quantized.w8a8"
|
| 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-0.5B-Instruct-quantized.w8a8",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-0.5B-Instruct</strong>
|
| 103 |
+
</td>
|
| 104 |
+
<td><strong>Qwen2.5-0.5B-Instruct-quantized.w8a8 (this model)</strong>
|
| 105 |
+
</td>
|
| 106 |
+
<td><strong>Recovery</strong>
|
| 107 |
+
</td>
|
| 108 |
+
</tr>
|
| 109 |
+
<tr>
|
| 110 |
+
<td rowspan="7" ><strong>OpenLLM v1</strong>
|
| 111 |
+
</td>
|
| 112 |
+
<td>MMLU (5-shot)
|
| 113 |
+
</td>
|
| 114 |
+
<td>46.83
|
| 115 |
+
</td>
|
| 116 |
+
<td>46.29
|
| 117 |
+
</td>
|
| 118 |
+
<td>98.9%
|
| 119 |
+
</td>
|
| 120 |
+
</tr>
|
| 121 |
+
<tr>
|
| 122 |
+
<td>ARC Challenge (25-shot)
|
| 123 |
+
</td>
|
| 124 |
+
<td>33.62
|
| 125 |
+
</td>
|
| 126 |
+
<td>33.36
|
| 127 |
+
</td>
|
| 128 |
+
<td>99.2%
|
| 129 |
+
</td>
|
| 130 |
+
</tr>
|
| 131 |
+
<tr>
|
| 132 |
+
<td>GSM-8K (5-shot, strict-match)
|
| 133 |
+
</td>
|
| 134 |
+
<td>33.21
|
| 135 |
+
</td>
|
| 136 |
+
<td>33.21
|
| 137 |
+
</td>
|
| 138 |
+
<td>100.0%
|
| 139 |
+
</td>
|
| 140 |
+
</tr>
|
| 141 |
+
<tr>
|
| 142 |
+
<td>Hellaswag (10-shot)
|
| 143 |
+
</td>
|
| 144 |
+
<td>51.31
|
| 145 |
+
</td>
|
| 146 |
+
<td>50.97
|
| 147 |
+
</td>
|
| 148 |
+
<td>99.3%
|
| 149 |
+
</td>
|
| 150 |
+
</tr>
|
| 151 |
+
<tr>
|
| 152 |
+
<td>Winogrande (5-shot)
|
| 153 |
+
</td>
|
| 154 |
+
<td>55.01
|
| 155 |
+
</td>
|
| 156 |
+
<td>55.01
|
| 157 |
+
</td>
|
| 158 |
+
<td>100.0%
|
| 159 |
+
</td>
|
| 160 |
+
</tr>
|
| 161 |
+
<tr>
|
| 162 |
+
<td>TruthfulQA (0-shot, mc2)
|
| 163 |
+
</td>
|
| 164 |
+
<td>41.85
|
| 165 |
+
</td>
|
| 166 |
+
<td>41.47
|
| 167 |
+
</td>
|
| 168 |
+
<td>99.1%
|
| 169 |
+
</td>
|
| 170 |
+
</tr>
|
| 171 |
+
<tr>
|
| 172 |
+
<td><strong>Average</strong>
|
| 173 |
+
</td>
|
| 174 |
+
<td><strong>43.64</strong>
|
| 175 |
+
</td>
|
| 176 |
+
<td><strong>43.38</strong>
|
| 177 |
+
</td>
|
| 178 |
+
<td><strong>99.4%</strong>
|
| 179 |
+
</td>
|
| 180 |
+
</tr>
|
| 181 |
+
<tr>
|
| 182 |
+
<td rowspan="7" ><strong>OpenLLM v2</strong>
|
| 183 |
+
</td>
|
| 184 |
+
<td>MMLU-Pro (5-shot)
|
| 185 |
+
</td>
|
| 186 |
+
<td>17.49
|
| 187 |
+
</td>
|
| 188 |
+
<td>16.95
|
| 189 |
+
</td>
|
| 190 |
+
<td>96.9%
|
| 191 |
+
</td>
|
| 192 |
+
</tr>
|
| 193 |
+
<tr>
|
| 194 |
+
<td>IFEval (0-shot)
|
| 195 |
+
</td>
|
| 196 |
+
<td>31.17
|
| 197 |
+
</td>
|
| 198 |
+
<td>32.04
|
| 199 |
+
</td>
|
| 200 |
+
<td>102.8%
|
| 201 |
+
</td>
|
| 202 |
+
</tr>
|
| 203 |
+
<tr>
|
| 204 |
+
<td>BBH (3-shot)
|
| 205 |
+
</td>
|
| 206 |
+
<td>32.79
|
| 207 |
+
</td>
|
| 208 |
+
<td>32.51
|
| 209 |
+
</td>
|
| 210 |
+
<td>99.2%
|
| 211 |
+
</td>
|
| 212 |
+
</tr>
|
| 213 |
+
<tr>
|
| 214 |
+
<td>Math-lvl-5 (4-shot)
|
| 215 |
+
</td>
|
| 216 |
+
<td>0.21
|
| 217 |
+
</td>
|
| 218 |
+
<td>0.17
|
| 219 |
+
</td>
|
| 220 |
+
<td>***
|
| 221 |
+
</td>
|
| 222 |
+
</tr>
|
| 223 |
+
<tr>
|
| 224 |
+
<td>GPQA (0-shot)
|
| 225 |
+
</td>
|
| 226 |
+
<td>25.67
|
| 227 |
+
</td>
|
| 228 |
+
<td>26.12
|
| 229 |
+
</td>
|
| 230 |
+
<td>101.8%
|
| 231 |
+
</td>
|
| 232 |
+
</tr>
|
| 233 |
+
<tr>
|
| 234 |
+
<td>MuSR (0-shot)
|
| 235 |
+
</td>
|
| 236 |
+
<td>33.02
|
| 237 |
+
</td>
|
| 238 |
+
<td>32.75
|
| 239 |
+
</td>
|
| 240 |
+
<td>99.2%
|
| 241 |
+
</td>
|
| 242 |
+
</tr>
|
| 243 |
+
<tr>
|
| 244 |
+
<td><strong>Average</strong>
|
| 245 |
+
</td>
|
| 246 |
+
<td><strong>23.39</strong>
|
| 247 |
+
</td>
|
| 248 |
+
<td><strong>23.42</strong>
|
| 249 |
+
</td>
|
| 250 |
+
<td><strong>100.1%</strong>
|
| 251 |
+
</td>
|
| 252 |
+
</tr>
|
| 253 |
+
</table>
|
| 254 |
+
*** Reference value too low to report meaningful recovery.
|