fbaldassarri
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,86 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- pytorch
|
6 |
+
- causal-lm
|
7 |
+
- pythia
|
8 |
+
- autoround
|
9 |
+
- intel
|
10 |
+
- intel-autoround
|
11 |
+
- awq
|
12 |
+
- autoawq
|
13 |
+
- woq
|
14 |
+
license: apache-2.0
|
15 |
+
model_name: Pythia 410m deduped
|
16 |
+
base_model: EleutherAI/pythia-410m-deduped
|
17 |
+
inference: false
|
18 |
+
model_creator: EleutherAI
|
19 |
+
datasets:
|
20 |
+
- EleutherAI/pile
|
21 |
+
pipeline_tag: text-generation
|
22 |
+
prompt_template: '{prompt}
|
23 |
+
'
|
24 |
+
quantized_by: fbaldassarri
|
25 |
+
---
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
## Model Information
|
30 |
+
|
31 |
+
Quantized version of [EleutherAI/pythia-410m-deduped](EleutherAI/pythia-410m-deduped) using torch.float32 for quantization tuning.
|
32 |
+
- 4 bits (INT4)
|
33 |
+
- group size = 128
|
34 |
+
- Asymmetrical Quantization
|
35 |
+
- Method AutoAWQ
|
36 |
+
|
37 |
+
Quantization framework: [Intel AutoRound](https://github.com/intel/auto-round)
|
38 |
+
|
39 |
+
Note: this INT4 version of pythia-410m-deduped has been quantized to run inference through CPU.
|
40 |
+
|
41 |
+
## Replication Recipe
|
42 |
+
|
43 |
+
### Step 1 Install Requirements
|
44 |
+
|
45 |
+
I suggest to install requirements into a dedicated python-virtualenv or a conda enviroment.
|
46 |
+
|
47 |
+
```
|
48 |
+
python -m pip install <package> --upgrade
|
49 |
+
```
|
50 |
+
|
51 |
+
- accelerate==1.0.1
|
52 |
+
- auto_gptq==0.7.1
|
53 |
+
- neural_compressor==3.1
|
54 |
+
- torch==2.3.0+cpu
|
55 |
+
- torchaudio==2.5.0+cpu
|
56 |
+
- torchvision==0.18.0+cpu
|
57 |
+
- transformers==4.45.2
|
58 |
+
|
59 |
+
### Step 2 Build Intel Autoround wheel from sources
|
60 |
+
|
61 |
+
```
|
62 |
+
python -m pip install git+https://github.com/intel/auto-round.git
|
63 |
+
```
|
64 |
+
|
65 |
+
### Step 3 Script for Quantization
|
66 |
+
|
67 |
+
```
|
68 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
69 |
+
model_name = "EleutherAI/pythia-410m-deduped"
|
70 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
71 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
72 |
+
from auto_round import AutoRound
|
73 |
+
bits, group_size, sym = 4, 128, False
|
74 |
+
autoround = AutoRound(model, tokenizer, nsamples=128, iters=200, seqlen=512, batch_size=4, bits=bits, group_size=group_size, sym=sym)
|
75 |
+
autoround.quantize()
|
76 |
+
output_dir = "./AutoRound/EleutherAI_pythia-410m-deduped-autoawq-int4-gs128-asym"
|
77 |
+
autoround.save_quantized(output_dir, format='auto_awq', inplace=True)
|
78 |
+
```
|
79 |
+
|
80 |
+
## License
|
81 |
+
|
82 |
+
[Apache 2.0 License](https://choosealicense.com/licenses/apache-2.0/)
|
83 |
+
|
84 |
+
## Disclaimer
|
85 |
+
|
86 |
+
This quantized model comes with no warrenty. It has been developed only for research purposes.
|