nm-research commited on
Commit
1aa2e4c
·
verified ·
1 Parent(s): b5bd0f6

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -0
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - vllm
4
+ - sparsity
5
+ pipeline_tag: text-generation
6
+ license: llama3.1
7
+ base_model: neuralmagic/Sparse-Llama-3.1-8B-ultrachat_200k-2of4
8
+ datasets:
9
+ - HuggingFaceH4/ultrachat_200k
10
+ language:
11
+ - en
12
+ ---
13
+
14
+ # Sparse-Llama-3.1-8B-ultrachat_200k-2of4-FP8-dynamic
15
+
16
+ ## Model Overview
17
+ - **Model Architecture:** Llama-3.1-8B
18
+ - **Input:** Text
19
+ - **Output:** Text
20
+ - **Model Optimizations:**
21
+ - **Sparsity:** 2:4
22
+ - **Weight quantization:** FP8
23
+ - **Activation quantization:** FP8
24
+ - **Release Date:** 11/15/2024
25
+ - **Version:** 1.0
26
+ - **License(s):** [llama3.1](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B/blob/main/LICENSE)
27
+ - **Model Developers:** Neural Magic
28
+
29
+ This is a multi-turn conversational 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 [ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k) dataset, followed by quantization.
30
+ On the [AlpacaEval](https://github.com/tatsu-lab/alpaca_eval) benchmark (version 1), it achieves a score of 62.9, compared to 62.0 for the fine-tuned dense model [Llama-3.1-8B-ultrachat_200k](https://huggingface.co/neuralmagic/Llama-3.1-8B-ultrachat_200k) — demonstrating a **99.4% accuracy recovery**.
31
+
32
+
33
+ ### Model Optimizations
34
+
35
+ This model was obtained by quantizing the weights of [Sparse-Llama-3.1-8B-ultrachat_200k-2of4](https://huggingface.co/neuralmagic/Sparse-Llama-3.1-8B-ultrachat_200k-2of4) to FP8 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 FP8 and BF16 representations for each output channel dimension.
41
+ Linear scaling factors are computed via by minimizing the mean squarred error (MSE).
42
+ 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.
43
+ 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.
44
+
45
+
46
+ ## Deployment with vLLM
47
+
48
+ 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.
49
+
50
+
51
+ ## Evaluation
52
+
53
+ This model was evaluated on Neural Magic's fork of [AlpacaEval](https://github.com/neuralmagic/alpaca_eval) benchmark.
54
+ We adopt the same setup as in [Enabling High-Sparsity Foundational Llama Models with Efficient Pretraining and Deployment](https://arxiv.org/abs/2405.03594), using version 1 of the benchmark and [Llama-2-70b-chat](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf) as the annotator.
55
+
56
+ ### Accuracy
57
+ #### AlpacaEval Benchmark
58
+ <table>
59
+ <tr>
60
+ <td><strong>Metric</strong></td>
61
+ <td style="text-align: center"><strong>Llama-3.1-8B-ultrachat_200k</strong></td>
62
+ <td style="text-align: center"><strong>Sparse-Llama-3.1-8B-ultrachat_200k-2of4</strong></td>
63
+ <td style="text-align: center"><strong>Sparse-Llama-3.1-8B-ultrachat_200k-2of4-FP8-dynamic</strong></td>
64
+ </tr>
65
+ <tr>
66
+ <td>Win rate</td>
67
+ <td style="text-align: center">62.0</td>
68
+ <td style="text-align: center">61.1</td>
69
+ <td style="text-align: center">62.9</td>
70
+ </tr>
71
+ </table>