fbaldassarri
commited on
Commit
•
c8e40f6
1
Parent(s):
638c580
Initial Upload
Browse files- README.md +87 -3
- config.json +57 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- quantize_config.json +25 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +214 -0
README.md
CHANGED
@@ -1,3 +1,87 @@
|
|
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 |
+
- gptq
|
12 |
+
- autogptq
|
13 |
+
- woq
|
14 |
+
license: apache-2.0
|
15 |
+
model_name: Pythia 2.8b
|
16 |
+
base_model: EleutherAI/pythia-2.8b
|
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-2.8b](EleutherAI/pythia-2.8b) using torch.float32 for quantization tuning.
|
32 |
+
- 4 bits (INT4)
|
33 |
+
- group size = 128
|
34 |
+
- Symmetrical Quantization
|
35 |
+
- Method AutoGPTQ
|
36 |
+
|
37 |
+
Quantization framework: [Intel AutoRound](https://github.com/intel/auto-round)
|
38 |
+
|
39 |
+
Note: this INT4 version of pythia-2.8b 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-2.8b"
|
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, True
|
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-2.8b-autogptq-int4-gs128-sym"
|
77 |
+
autoround.save_quantized(output_dir, format='auto_gptq', 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.
|
87 |
+
|
config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "EleutherAI/pythia-2.8b",
|
3 |
+
"architectures": [
|
4 |
+
"GPTNeoXForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": true,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"bos_token_id": 0,
|
9 |
+
"classifier_dropout": 0.1,
|
10 |
+
"eos_token_id": 0,
|
11 |
+
"hidden_act": "gelu",
|
12 |
+
"hidden_dropout": 0.0,
|
13 |
+
"hidden_size": 2560,
|
14 |
+
"initializer_range": 0.02,
|
15 |
+
"intermediate_size": 10240,
|
16 |
+
"layer_norm_eps": 1e-05,
|
17 |
+
"max_position_embeddings": 2048,
|
18 |
+
"model_type": "gpt_neox",
|
19 |
+
"num_attention_heads": 32,
|
20 |
+
"num_hidden_layers": 32,
|
21 |
+
"partial_rotary_factor": 0.25,
|
22 |
+
"quantization_config": {
|
23 |
+
"amp": false,
|
24 |
+
"autoround_version": "0.4.0.dev",
|
25 |
+
"bits": 4,
|
26 |
+
"damp_percent": 0.01,
|
27 |
+
"data_type": "int",
|
28 |
+
"desc_act": false,
|
29 |
+
"enable_minmax_tuning": true,
|
30 |
+
"enable_norm_bias_tuning": false,
|
31 |
+
"enable_quanted_input": true,
|
32 |
+
"gradient_accumulate_steps": 1,
|
33 |
+
"group_size": 128,
|
34 |
+
"iters": 200,
|
35 |
+
"low_gpu_mem_usage": false,
|
36 |
+
"lr": 0.005,
|
37 |
+
"minmax_lr": 0.005,
|
38 |
+
"nsamples": 128,
|
39 |
+
"quant_block_list": null,
|
40 |
+
"quant_method": "gptq",
|
41 |
+
"scale_dtype": "torch.float16",
|
42 |
+
"seqlen": 512,
|
43 |
+
"sym": true,
|
44 |
+
"train_bs": 4,
|
45 |
+
"true_sequential": false
|
46 |
+
},
|
47 |
+
"rope_scaling": null,
|
48 |
+
"rope_theta": 10000,
|
49 |
+
"rotary_emb_base": 10000,
|
50 |
+
"rotary_pct": 0.25,
|
51 |
+
"tie_word_embeddings": false,
|
52 |
+
"torch_dtype": "float32",
|
53 |
+
"transformers_version": "4.45.2",
|
54 |
+
"use_cache": true,
|
55 |
+
"use_parallel_residual": true,
|
56 |
+
"vocab_size": 50304
|
57 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 0,
|
4 |
+
"eos_token_id": 0,
|
5 |
+
"transformers_version": "4.45.2"
|
6 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:097fa6d1171820baf6fd891be62584c109606761718b94f2f64e58c31b467160
|
3 |
+
size 2340551504
|
quantize_config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bits": 4,
|
3 |
+
"group_size": 128,
|
4 |
+
"sym": true,
|
5 |
+
"data_type": "int",
|
6 |
+
"enable_quanted_input": true,
|
7 |
+
"enable_minmax_tuning": true,
|
8 |
+
"seqlen": 512,
|
9 |
+
"train_bs": 4,
|
10 |
+
"scale_dtype": "torch.float16",
|
11 |
+
"lr": 0.005,
|
12 |
+
"minmax_lr": 0.005,
|
13 |
+
"gradient_accumulate_steps": 1,
|
14 |
+
"iters": 200,
|
15 |
+
"amp": false,
|
16 |
+
"nsamples": 128,
|
17 |
+
"low_gpu_mem_usage": false,
|
18 |
+
"quant_block_list": null,
|
19 |
+
"enable_norm_bias_tuning": false,
|
20 |
+
"autoround_version": "0.4.0.dev",
|
21 |
+
"quant_method": "gptq",
|
22 |
+
"desc_act": false,
|
23 |
+
"true_sequential": false,
|
24 |
+
"damp_percent": 0.01
|
25 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|endoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"unk_token": {
|
17 |
+
"content": "<|endoftext|>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
}
|
23 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": false,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<|endoftext|>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<|padding|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"50254": {
|
23 |
+
"content": " ",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": true,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": false
|
29 |
+
},
|
30 |
+
"50255": {
|
31 |
+
"content": " ",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": true,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": false
|
37 |
+
},
|
38 |
+
"50256": {
|
39 |
+
"content": " ",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": true,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": false
|
45 |
+
},
|
46 |
+
"50257": {
|
47 |
+
"content": " ",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": true,
|
50 |
+
"rstrip": false,
|
51 |
+
"single_word": false,
|
52 |
+
"special": false
|
53 |
+
},
|
54 |
+
"50258": {
|
55 |
+
"content": " ",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": true,
|
58 |
+
"rstrip": false,
|
59 |
+
"single_word": false,
|
60 |
+
"special": false
|
61 |
+
},
|
62 |
+
"50259": {
|
63 |
+
"content": " ",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": true,
|
66 |
+
"rstrip": false,
|
67 |
+
"single_word": false,
|
68 |
+
"special": false
|
69 |
+
},
|
70 |
+
"50260": {
|
71 |
+
"content": " ",
|
72 |
+
"lstrip": false,
|
73 |
+
"normalized": true,
|
74 |
+
"rstrip": false,
|
75 |
+
"single_word": false,
|
76 |
+
"special": false
|
77 |
+
},
|
78 |
+
"50261": {
|
79 |
+
"content": " ",
|
80 |
+
"lstrip": false,
|
81 |
+
"normalized": true,
|
82 |
+
"rstrip": false,
|
83 |
+
"single_word": false,
|
84 |
+
"special": false
|
85 |
+
},
|
86 |
+
"50262": {
|
87 |
+
"content": " ",
|
88 |
+
"lstrip": false,
|
89 |
+
"normalized": true,
|
90 |
+
"rstrip": false,
|
91 |
+
"single_word": false,
|
92 |
+
"special": false
|
93 |
+
},
|
94 |
+
"50263": {
|
95 |
+
"content": " ",
|
96 |
+
"lstrip": false,
|
97 |
+
"normalized": true,
|
98 |
+
"rstrip": false,
|
99 |
+
"single_word": false,
|
100 |
+
"special": false
|
101 |
+
},
|
102 |
+
"50264": {
|
103 |
+
"content": " ",
|
104 |
+
"lstrip": false,
|
105 |
+
"normalized": true,
|
106 |
+
"rstrip": false,
|
107 |
+
"single_word": false,
|
108 |
+
"special": false
|
109 |
+
},
|
110 |
+
"50265": {
|
111 |
+
"content": " ",
|
112 |
+
"lstrip": false,
|
113 |
+
"normalized": true,
|
114 |
+
"rstrip": false,
|
115 |
+
"single_word": false,
|
116 |
+
"special": false
|
117 |
+
},
|
118 |
+
"50266": {
|
119 |
+
"content": " ",
|
120 |
+
"lstrip": false,
|
121 |
+
"normalized": true,
|
122 |
+
"rstrip": false,
|
123 |
+
"single_word": false,
|
124 |
+
"special": false
|
125 |
+
},
|
126 |
+
"50267": {
|
127 |
+
"content": " ",
|
128 |
+
"lstrip": false,
|
129 |
+
"normalized": true,
|
130 |
+
"rstrip": false,
|
131 |
+
"single_word": false,
|
132 |
+
"special": false
|
133 |
+
},
|
134 |
+
"50268": {
|
135 |
+
"content": " ",
|
136 |
+
"lstrip": false,
|
137 |
+
"normalized": true,
|
138 |
+
"rstrip": false,
|
139 |
+
"single_word": false,
|
140 |
+
"special": false
|
141 |
+
},
|
142 |
+
"50269": {
|
143 |
+
"content": " ",
|
144 |
+
"lstrip": false,
|
145 |
+
"normalized": true,
|
146 |
+
"rstrip": false,
|
147 |
+
"single_word": false,
|
148 |
+
"special": false
|
149 |
+
},
|
150 |
+
"50270": {
|
151 |
+
"content": " ",
|
152 |
+
"lstrip": false,
|
153 |
+
"normalized": true,
|
154 |
+
"rstrip": false,
|
155 |
+
"single_word": false,
|
156 |
+
"special": false
|
157 |
+
},
|
158 |
+
"50271": {
|
159 |
+
"content": " ",
|
160 |
+
"lstrip": false,
|
161 |
+
"normalized": true,
|
162 |
+
"rstrip": false,
|
163 |
+
"single_word": false,
|
164 |
+
"special": false
|
165 |
+
},
|
166 |
+
"50272": {
|
167 |
+
"content": " ",
|
168 |
+
"lstrip": false,
|
169 |
+
"normalized": true,
|
170 |
+
"rstrip": false,
|
171 |
+
"single_word": false,
|
172 |
+
"special": false
|
173 |
+
},
|
174 |
+
"50273": {
|
175 |
+
"content": " ",
|
176 |
+
"lstrip": false,
|
177 |
+
"normalized": true,
|
178 |
+
"rstrip": false,
|
179 |
+
"single_word": false,
|
180 |
+
"special": false
|
181 |
+
},
|
182 |
+
"50274": {
|
183 |
+
"content": " ",
|
184 |
+
"lstrip": false,
|
185 |
+
"normalized": true,
|
186 |
+
"rstrip": false,
|
187 |
+
"single_word": false,
|
188 |
+
"special": false
|
189 |
+
},
|
190 |
+
"50275": {
|
191 |
+
"content": " ",
|
192 |
+
"lstrip": false,
|
193 |
+
"normalized": true,
|
194 |
+
"rstrip": false,
|
195 |
+
"single_word": false,
|
196 |
+
"special": false
|
197 |
+
},
|
198 |
+
"50276": {
|
199 |
+
"content": " ",
|
200 |
+
"lstrip": false,
|
201 |
+
"normalized": true,
|
202 |
+
"rstrip": false,
|
203 |
+
"single_word": false,
|
204 |
+
"special": false
|
205 |
+
}
|
206 |
+
},
|
207 |
+
"bos_token": "<|endoftext|>",
|
208 |
+
"clean_up_tokenization_spaces": false,
|
209 |
+
"eos_token": "<|endoftext|>",
|
210 |
+
"model_max_length": 1000000000000000019884624838656,
|
211 |
+
"pad_token": null,
|
212 |
+
"tokenizer_class": "GPTNeoXTokenizer",
|
213 |
+
"unk_token": "<|endoftext|>"
|
214 |
+
}
|