luow-amd commited on
Commit
ccb504d
1 Parent(s): cebd349

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +83 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: llama3.1
4
+ license_link: https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE
5
+ base_model: meta-llama/Meta-Llama-3.1-405B-Instruct
6
+ ---
7
+
8
+ # Meta-Llama-3.1-405B-Instruct-FP8-KV
9
+ - ## Introduction
10
+ This model was created by applying [Quark](https://quark.docs.amd.com/latest/index.html) with calibration samples from Pile dataset.
11
+ - ## Quantization Stragegy
12
+ - ***Quantized Layers***: All linear layers excluding "lm_head"
13
+ - ***Weight***: FP8 symmetric per-tensor
14
+ - ***Activation***: FP8 symmetric per-tensor
15
+ - ***KV Cache***: FP8 symmetric per-tensor
16
+ - ## Quick Start
17
+ 1. [Download and install Quark](https://quark.docs.amd.com/latest/install.html)
18
+ 2. Run the quantization script in the example folder using the following command line:
19
+ ```sh
20
+ export MODEL_DIR = [local model checkpoint folder] or meta-llama/Meta-Llama-3.1-405B-Instruct
21
+ # single GPU
22
+ python3 quantize_quark.py \
23
+ --model_dir $MODEL_DIR \
24
+ --output_dir Meta-Llama-3.1-405B-Instruct-FP8-KV \
25
+ --quant_scheme w_fp8_a_fp8 \
26
+ --kv_cache_dtype fp8 \
27
+ --num_calib_data 128 \
28
+ --model_export quark_safetensors
29
+
30
+ # If model size is too large for single GPU, please use multi GPU instead.
31
+ python3 quantize_quark.py \
32
+ --model_dir $MODEL_DIR \
33
+ --output_dir Meta-Llama-3.1-405B-Instruct-FP8-KV \
34
+ --quant_scheme w_fp8_a_fp8 \
35
+ --kv_cache_dtype fp8 \
36
+ --num_calib_data 128 \
37
+ --model_export quark_safetensors \
38
+ --multi_gpu
39
+ ```
40
+ ## Deployment
41
+ Quark has its own export format and allows FP8 quantized models to be efficiently deployed using the vLLM backend(vLLM-compatible).
42
+
43
+ ## Evaluation
44
+ Quark currently uses perplexity(PPL) as the evaluation metric for accuracy loss before and after quantization.The specific PPL algorithm can be referenced in the quantize_quark.py.
45
+ The quantization evaluation results are conducted in pseudo-quantization mode, which may slightly differ from the actual quantized inference accuracy. These results are provided for reference only.
46
+
47
+ #### Evaluation scores
48
+ <table>
49
+ <tr>
50
+ <td><strong>Benchmark</strong>
51
+ </td>
52
+ <td><strong>Meta-Llama-3.1-405B-Instruct </strong>
53
+ </td>
54
+ <td><strong>Meta-Llama-3.1-405B-Instruct-FP8-KV(this model)</strong>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <td>Perplexity-wikitext2
59
+ </td>
60
+ <td>1.8561
61
+ </td>
62
+ <td>1.8951
63
+ </td>
64
+ </tr>
65
+
66
+ </table>
67
+
68
+
69
+
70
+ #### License
71
+ Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All Rights Reserved.
72
+
73
+ Licensed under the Apache License, Version 2.0 (the "License");
74
+ you may not use this file except in compliance with the License.
75
+ You may obtain a copy of the License at
76
+
77
+ http://www.apache.org/licenses/LICENSE-2.0
78
+
79
+ Unless required by applicable law or agreed to in writing, software
80
+ distributed under the License is distributed on an "AS IS" BASIS,
81
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
82
+ See the License for the specific language governing permissions and
83
+ limitations under the License.