nm-research commited on
Commit
6ed8674
·
verified ·
1 Parent(s): b0f03f2

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -0
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - vllm
4
+ - sparsity
5
+ - quantization
6
+ - int4
7
+ pipeline_tag: text-generation
8
+ license: llama3.1
9
+ base_model: neuralmagic/Sparse-Llama-3.1-8B-evolcodealpaca-2of4
10
+ datasets:
11
+ - theblackcat102/evol-codealpaca-v1
12
+ language:
13
+ - en
14
+ ---
15
+
16
+ # Sparse-Llama-3.1-8B-evolcodealpaca-2of4-FP8-dynamic
17
+
18
+ ## Model Overview
19
+ - **Model Architecture:** Llama-3.1-8B
20
+ - **Input:** Text
21
+ - **Output:** Text
22
+ - **Model Optimizations:**
23
+ - **Sparsity:** 2:4
24
+ - **Weight quantization:** FP8
25
+ - **Activation quantization:** FP8
26
+ - **Release Date:** 11/15/2024
27
+ - **Version:** 1.0
28
+ - **License(s):** [llama3.1](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B/blob/main/LICENSE)
29
+ - **Model Developers:** Neural Magic
30
+
31
+ This is a code completion AI model obtained by fine-tuning the 2:4 sparse [Sparse-Llama-3.1-8B-2of4](https://huggingface.co/neuralmagic/Sparse-Llama-3.1-8B-2of4) on the [evol-codealpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1) dataset, followed by quantization
32
+ On the [HumanEval](https://arxiv.org/abs/2107.03374) benchmark, it achieves a pass@1 of 49.0, compared to 48.5 for the fine-tuned dense model [Llama-3.1-8B-evolcodealpaca](https://huggingface.co/neuralmagic/Llama-3.1-8B-evolcodealpaca) — demonstrating over **100% accuracy recovery**.
33
+
34
+
35
+ ### Model Optimizations
36
+
37
+ This model was obtained by quantizing the weights and of [Sparse-Llama-3.1-8B-evolcodealpaca-2of4](https://huggingface.co/neuralmagic/Sparse-Llama-3.1-8B-evolcodealpaca-2of4) to FP8 data type.
38
+ 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).
39
+ Weight quantization also reduces disk size requirements by approximately 50%.
40
+
41
+ Only weights and activations of the linear operators within transformers blocks are quantized.
42
+ Weights are quantized with a symmetric static per-channel scheme, where a fixed linear scaling factor is applied between FP8 and BF16 representations for each output channel dimension.
43
+ Linear scaling factors are computed via by minimizing the mean squarred error (MSE).
44
+ Activations are quantized with a symmetric dynamic per-token scheme, computing a linear scaling factor at runtime for each token between FP8 and BF16 representations.
45
+ The [GPTQ](https://arxiv.org/abs/2210.17323) algorithm is applied for quantization, as implemented in the [llm-compressor](https://github.com/vllm-project/llm-compressor) library.
46
+
47
+
48
+ ## Deployment with vLLM
49
+
50
+ This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend. vLLM aslo supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
51
+
52
+
53
+ ## Evaluation
54
+
55
+ This model was evaluated on Neural Magic's fork of [EvalPlus](https://github.com/neuralmagic/evalplus).
56
+
57
+ ### Accuracy
58
+ #### Human Benchmark
59
+ <table>
60
+ <tr>
61
+ <td><strong>Metric</strong></td>
62
+ <td style="text-align: center"><strong>Llama-3.1-8B-evolcodealpaca</strong></td>
63
+ <td style="text-align: center"><strong>Sparse-Llama-3.1-8B-evolcodealpaca-2of4</strong></td>
64
+ <td style="text-align: center"><strong>Sparse-Llama-3.1-8B-evolcodealpaca-2of4-FP8-dynamic</strong></td>
65
+ </tr>
66
+ <tr>
67
+ <td>HumanEval pass@1</td>
68
+ <td style="text-align: center">48.5</td>
69
+ <td style="text-align: center">49.1</td>
70
+ <td style="text-align: center">49.0</td>
71
+ </tr>
72
+ <tr>
73
+ <td>HumanEval+ pass@1</td>
74
+ <td style="text-align: center">44.2</td>
75
+ <td style="text-align: center">46.3</td>
76
+ <td style="text-align: center">46.2</td>
77
+ </tr>
78
+ </table>