INC4AI commited on
Commit
e1485f6
·
verified ·
1 Parent(s): 3becfda

Upload quantized model neo-3-1B-A90M-Base-AutoRound-W4A16-RTN

Browse files
README.md ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - aquiffoo/neo-3-1B-A90M-Base
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - quantized
7
+ - w4a16
8
+ - autoround
9
+ - low-bit-open-llm-leaderboard
10
+ ---
11
+
12
+ # neo-3-1B-A90M-Base-AutoRound-W4A16-RTN
13
+
14
+ ## Model Details
15
+
16
+ This model is a int4 weight-only quantization with group_size 128 and symmetric quantization of [aquiffoo/neo-3-1B-A90M-Base](https://huggingface.co/aquiffoo/neo-3-1B-A90M-Base) generated by [AutoRound](https://github.com/intel/auto-round). Please follow the license of the original model.
17
+
18
+ ## Quantization Details
19
+
20
+ | Attribute | Value |
21
+ |-----------|-------|
22
+ | Base Model | [aquiffoo/neo-3-1B-A90M-Base](https://huggingface.co/aquiffoo/neo-3-1B-A90M-Base) |
23
+ | Quantization Tool | [AutoRound](https://github.com/intel/auto-round) |
24
+ | Quantization Scheme | W4A16 |
25
+ | Quantized Size | 701 MB |
26
+
27
+ ## Evaluation Results
28
+
29
+ | Task | Accuracy |
30
+ |------|----------|
31
+ | hellaswag | 0.2565 |
32
+ | mmlu | 0.2295 |
33
+ | mmlu_abstract_algebra | 0.2200 |
34
+ | mmlu_anatomy | 0.1852 |
35
+ | mmlu_astronomy | 0.1776 |
36
+ | mmlu_business_ethics | 0.3000 |
37
+ | mmlu_clinical_knowledge | 0.2151 |
38
+ | mmlu_college_biology | 0.2569 |
39
+ | mmlu_college_chemistry | 0.2000 |
40
+ | mmlu_college_computer_science | 0.2600 |
41
+ | mmlu_college_mathematics | 0.2100 |
42
+ | mmlu_college_medicine | 0.2081 |
43
+ | mmlu_college_physics | 0.2157 |
44
+ | mmlu_computer_security | 0.2800 |
45
+ | mmlu_conceptual_physics | 0.2638 |
46
+ | mmlu_econometrics | 0.2368 |
47
+ | mmlu_electrical_engineering | 0.2414 |
48
+ | mmlu_elementary_mathematics | 0.2090 |
49
+ | mmlu_formal_logic | 0.2857 |
50
+ | mmlu_global_facts | 0.1800 |
51
+ | mmlu_high_school_biology | 0.1774 |
52
+ | mmlu_high_school_chemistry | 0.1527 |
53
+ | mmlu_high_school_computer_science | 0.2500 |
54
+ | mmlu_high_school_european_history | 0.2182 |
55
+ | mmlu_high_school_geography | 0.1768 |
56
+ | mmlu_high_school_government_and_politics | 0.1969 |
57
+ | mmlu_high_school_macroeconomics | 0.2026 |
58
+ | mmlu_high_school_mathematics | 0.2111 |
59
+ | mmlu_high_school_microeconomics | 0.2101 |
60
+ | mmlu_high_school_physics | 0.1987 |
61
+ | mmlu_high_school_psychology | 0.1927 |
62
+ | mmlu_high_school_statistics | 0.1528 |
63
+ | mmlu_high_school_us_history | 0.2500 |
64
+ | mmlu_high_school_world_history | 0.2700 |
65
+ | mmlu_human_aging | 0.3139 |
66
+ | mmlu_human_sexuality | 0.2595 |
67
+ | mmlu_humanities | 0.2421 |
68
+ | mmlu_international_law | 0.2397 |
69
+ | mmlu_jurisprudence | 0.2593 |
70
+ | mmlu_logical_fallacies | 0.2209 |
71
+ | mmlu_machine_learning | 0.3125 |
72
+ | mmlu_management | 0.1748 |
73
+ | mmlu_marketing | 0.2906 |
74
+ | mmlu_medical_genetics | 0.3000 |
75
+ | mmlu_miscellaneous | 0.2375 |
76
+ | mmlu_moral_disputes | 0.2486 |
77
+ | mmlu_moral_scenarios | 0.2380 |
78
+ | mmlu_nutrition | 0.2255 |
79
+ | mmlu_other | 0.2398 |
80
+ | mmlu_philosophy | 0.1865 |
81
+ | mmlu_prehistory | 0.2160 |
82
+ | mmlu_professional_accounting | 0.2340 |
83
+ | mmlu_professional_law | 0.2458 |
84
+ | mmlu_professional_medicine | 0.1838 |
85
+ | mmlu_professional_psychology | 0.2500 |
86
+ | mmlu_public_relations | 0.2182 |
87
+ | mmlu_security_studies | 0.1878 |
88
+ | mmlu_social_sciences | 0.2171 |
89
+ | mmlu_sociology | 0.2438 |
90
+ | mmlu_stem | 0.2125 |
91
+ | mmlu_us_foreign_policy | 0.2800 |
92
+ | mmlu_virology | 0.2831 |
93
+ | mmlu_world_religions | 0.3216 |
94
+ | piqa | 0.5256 |
95
+
96
+ ## How to Use
97
+
98
+ ### HF Usage
99
+
100
+ **Step 1: Install [AutoRound](https://github.com/intel/auto-round)**
101
+
102
+ ```bash
103
+ pip install auto-round
104
+ ```
105
+
106
+ **Step 2: Load and run the quantized model**
107
+
108
+ ```python
109
+ from transformers import AutoModelForCausalLM, AutoTokenizer
110
+
111
+ model_name = "neo-3-1B-A90M-Base-AutoRound-W4A16-RTN"
112
+
113
+ # load the tokenizer and the model
114
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
115
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
116
+
117
+ # prepare the model input
118
+ prompt = "Write a quick sort algorithm."
119
+ messages = [{"role": "user", "content": prompt}]
120
+ text = tokenizer.apply_chat_template(
121
+ messages,
122
+ tokenize=False,
123
+ add_generation_prompt=True,
124
+ )
125
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
126
+
127
+ # conduct text completion
128
+ generated_ids = model.generate(**model_inputs, max_new_tokens=512)
129
+ output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :].tolist()
130
+
131
+ content = tokenizer.decode(output_ids, skip_special_tokens=True)
132
+ print("content:", content)
133
+ ```
134
+
135
+ ### VLLM Usage
136
+
137
+ ```bash
138
+ vllm serve neo-3-1B-A90M-Base-AutoRound-W4A16-RTN \
139
+ --trust-remote-code \
140
+ --dtype bfloat16 \
141
+ --tensor_parallel_size 1
142
+ ```
143
+
144
+ If you encounter any issues, feel free to open an issue on the [AutoRound GitHub repo](https://github.com/intel/auto-round/issues) or provide feedback on the [Low-Bit Open LLM Leaderboard](https://huggingface.co/spaces/Intel/low_bit_open_llm_leaderboard).
145
+
146
+ ## Ethical Considerations and Limitations
147
+
148
+ The model can produce factually incorrect output, and should not be relied on to produce factually accurate information. Because of the limitations of the pretrained model and the finetuning datasets, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
149
+ Therefore, before deploying any applications of the model, developers should perform safety testing.
150
+
151
+ ## Caveats and Recommendations
152
+
153
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
154
+ Here are a couple of useful links to learn more about Intel's AI software:
155
+
156
+ - [Intel Neural Compressor](https://github.com/intel/neural-compressor)
157
+ - [AutoRound](https://github.com/intel/auto-round)
158
+
159
+ ## Disclaimer
160
+
161
+ 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.
162
+
163
+ ## Cite
164
+
165
+ ```
166
+ @article{cheng2023optimize,
167
+ title={Optimize weight rounding via signed gradient descent for the quantization of llms},
168
+ author={Cheng, Wenhua and Zhang, Weiwei and Shen, Haihao and Cai, Yiyang and He, Xin and Lv, Kaokao and Liu, Yi},
169
+ journal={arXiv preprint arXiv:2309.05516},
170
+ year={2023}
171
+ }
172
+ ```
173
+
174
+ [arxiv](https://arxiv.org/abs/2309.05516) [github](https://github.com/intel/auto-round)
175
+
176
+ ---
177
+
178
+ *This model is part of the [Intel Low-Bit Open LLM Leaderboard](https://huggingface.co/spaces/Intel/low_bit_open_llm_leaderboard) initiative.*
config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MixtralForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dtype": "float16",
9
+ "eos_token_id": 0,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 576,
13
+ "initializer_range": 0.041666666666666664,
14
+ "intermediate_size": 1536,
15
+ "is_llama_config": true,
16
+ "max_position_embeddings": 8192,
17
+ "mlp_bias": false,
18
+ "model_type": "mixtral",
19
+ "num_attention_heads": 9,
20
+ "num_experts_per_tok": 1,
21
+ "num_hidden_layers": 30,
22
+ "num_key_value_heads": 3,
23
+ "num_local_experts": 16,
24
+ "output_router_logits": false,
25
+ "pad_token_id": 0,
26
+ "pretraining_tp": 1,
27
+ "quantization_config": {
28
+ "autoround_version": "0.13.0",
29
+ "bits": 4,
30
+ "block_name_to_quantize": "model.layers",
31
+ "data_type": "int",
32
+ "enable_quanted_input": false,
33
+ "extra_config": {
34
+ ".*model\\.layers\\.[0-29]\\.mlp\\.gate.*": {
35
+ "bits": 16,
36
+ "data_type": "float"
37
+ }
38
+ },
39
+ "group_size": 128,
40
+ "iters": 0,
41
+ "low_gpu_mem_usage": true,
42
+ "packing_format": "auto_round:auto_gptq",
43
+ "quant_method": "auto-round",
44
+ "sym": true
45
+ },
46
+ "rms_norm_eps": 1e-05,
47
+ "rope_interleaved": false,
48
+ "rope_parameters": {
49
+ "rope_theta": 100000,
50
+ "rope_type": "default"
51
+ },
52
+ "router_aux_loss_coef": 0.001,
53
+ "router_jitter_noise": 0.0,
54
+ "sliding_window": null,
55
+ "tie_word_embeddings": true,
56
+ "transformers_version": "5.11.0",
57
+ "unsloth_version": "2025.11.6",
58
+ "use_cache": true,
59
+ "vocab_size": 49152
60
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "do_sample": true,
5
+ "eos_token_id": 0,
6
+ "transformers_version": "5.11.0"
7
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03e446c3b15836e78782d6cec0686e6fc4b5634a8a61c0c5a8653e1b919fe150
3
+ size 735391496
quantization_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "data_type": "int",
4
+ "group_size": 128,
5
+ "sym": true,
6
+ "enable_quanted_input": false,
7
+ "iters": 0,
8
+ "low_gpu_mem_usage": true,
9
+ "autoround_version": "0.13.0",
10
+ "block_name_to_quantize": "model.layers",
11
+ "quant_method": "auto-round",
12
+ "packing_format": "auto_round:auto_gptq",
13
+ "extra_config": {
14
+ ".*model\\.layers\\.[0-29]\\.mlp\\.gate.*": {
15
+ "bits": 16,
16
+ "data_type": "float"
17
+ }
18
+ }
19
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|endoftext|>",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 8192,
10
+ "tokenizer_class": "TokenizersBackend",
11
+ "unk_token": "<|endoftext|>",
12
+ "vocab_size": 49152
13
+ }