yintongl commited on
Commit
29904ee
·
verified ·
1 Parent(s): 40f69b1

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -0
README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - NeelNanda/pile-10k
5
+ ---
6
+
7
+
8
+
9
+
10
+
11
+
12
+ ## Model Details: gemma-7b-int4-inc
13
+
14
+ This model is an int4 model with group_size 128 of [google/gemma-7b](https://huggingface.co/google/gemma-7b) generated by [intel/auto-round](https://github.com/intel/auto-round).
15
+
16
+ ## How To Use
17
+
18
+ ### Reproduce the model
19
+
20
+ Here is the sample command to reproduce the model
21
+
22
+ ```bash
23
+ git clone https://github.com/intel/auto-round
24
+ cd auto-round/examples/language-modeling
25
+ pip install -r requirements.txt
26
+ python3 main.py \
27
+ --model_name google/gemma-7b \
28
+ --device 0 \
29
+ --group_size 128 \
30
+ --bits 4 \
31
+ --iters 1000 \
32
+ --enable_minmax_tuning \
33
+ --minmax_lr 2e-3 \
34
+ --low_gpu_mem_usage \
35
+ --deployment_device 'gpu' \
36
+ --scale_dtype 'fp32' \
37
+ --eval_bs 32 \
38
+ --output_dir "./tmp_autoround" \
39
+ --amp
40
+
41
+ ```
42
+
43
+
44
+
45
+
46
+
47
+
48
+ ### Evaluate the model
49
+
50
+ Install [lm-eval-harness](https://github.com/EleutherAI/lm-evaluation-harness.git) from source, and the git id 96d185fa6232a5ab685ba7c43e45d1dbb3bb906d, Install the latest [AutoGPTQ](https://github.com/AutoGPTQ/AutoGPTQ) from source first
51
+
52
+ ```bash
53
+ lm_eval --model hf --model_args pretrained="Intel/gemma-7b-int4-inc",autogptq=True,gptq_use_triton=True --device cuda:0 --tasks lambada_openai,hellaswag,piqa,winogrande,truthfulqa_mc1,openbookqa,boolq,rte,arc_easy,arc_challenge,mmlu --batch_size 32
54
+ ```
55
+
56
+ | Metric | FP16 | int4 |
57
+ | -------------- | ------ | ------ |
58
+ | Avg. | 0.6239 | 0.6307 |
59
+ | mmlu | 0.6162 | 0.6147 |
60
+ | lambada_openai | 0.6751 | 0.7204 |
61
+ | hellaswag | 0.6047 | 0.5903 |
62
+ | winogrande | 0.7324 | 0.7514 |
63
+ | piqa | 0.7943 | 0.7949 |
64
+ | truthfulqa_mc1 | 0.3097 | 0.3011 |
65
+ | openbookqa | 0.3320 | 0.3400 |
66
+ | boolq | 0.8278 | 0.8269 |
67
+ | rte | 0.6534 | 0.7076 |
68
+ | arc_easy | 0.8178 | 0.7959 |
69
+ | arc_challenge | 0.4991 | 0.4940 |
70
+
71
+
72
+
73
+
74
+
75
+ ## Caveats and Recommendations
76
+
77
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
78
+
79
+ Here are a couple of useful links to learn more about Intel's AI software:
80
+
81
+ * Intel Neural Compressor [link](https://github.com/intel/neural-compressor)
82
+ * Intel Extension for Transformers [link](https://github.com/intel/intel-extension-for-transformers)
83
+
84
+ ## Disclaimer
85
+
86
+ The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please consult an attorney before using this model for commercial purposes.
87
+
88
+
89
+ ## Cite
90
+ @article{cheng2023optimize,
91
+ title={Optimize weight rounding via signed gradient descent for the quantization of llms},
92
+ author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao},
93
+ journal={arXiv preprint arXiv:2309.05516},
94
+ year={2023}
95
+ }
96
+
97
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)