fbaldassarri commited on
Commit
d69100d
·
verified ·
1 Parent(s): de57cbc

Initial Upload

Browse files
README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: falcon-llm-license
4
+ license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
5
+ language:
6
+ - en
7
+ - fr
8
+ - es
9
+ - pt
10
+ pipeline_tag: text-generation
11
+ tags:
12
+ - causal-lm
13
+ - autoround
14
+ - auto-round
15
+ - intel-autoround
16
+ - woq
17
+ - autogptq
18
+ - auto-gptq
19
+ - gptq
20
+ - intel
21
+ - pytorch
22
+ - falcon3
23
+ model_name: Falcon3 3B Base
24
+ base_model:
25
+ - tiiuae/Falcon3-3B-Base
26
+ inference: false
27
+ library_name: transformers
28
+ model_creator: tiiuae
29
+ prompt_template: '{prompt} '
30
+ quantized_by: fbaldassarri
31
+ ---
32
+
33
+ ## Model Information
34
+
35
+ Quantized version of [tiiuae/Falcon3-3B-Base](https://huggingface.co/tiiuae/Falcon3-3B-Base) using torch.float32 for quantization tuning.
36
+ - 4 bits (INT4)
37
+ - group size = 128
38
+ - Symmetrical Quantization
39
+ - Method AutoGPTQ
40
+
41
+ Quantization framework: [Intel AutoRound](https://github.com/intel/auto-round) v0.4.4
42
+
43
+ Note: this INT4 version of Falcon3-3B-Base has been quantized to run inference through CPU.
44
+
45
+ ## Replication Recipe
46
+
47
+ ### Step 1 Install Requirements
48
+
49
+ I suggest to install requirements into a dedicated python-virtualenv or a conda enviroment.
50
+
51
+ ```
52
+ wget https://github.com/intel/auto-round/archive/refs/tags/v0.4.4.tar.gz
53
+ tar -xvzf v0.4.4.tar.gz
54
+ cd auto-round-0.4.4
55
+ pip install -r requirements-cpu.txt --upgrade
56
+ ```
57
+
58
+ ### Step 2 Build Intel AutoRound wheel from sources
59
+
60
+ ```
61
+ pip install -vvv --no-build-isolation -e .[cpu]
62
+ ```
63
+
64
+ ### Step 3 Script for Quantization
65
+
66
+ ```
67
+ from transformers import AutoModelForCausalLM, AutoTokenizer
68
+ model_name = "tiiuae/Falcon3-3B-Base"
69
+ model = AutoModelForCausalLM.from_pretrained(model_name)
70
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
71
+ from auto_round import AutoRound
72
+ bits, group_size, sym, device, amp = 4, 128, True, 'cpu', False
73
+ autoround = AutoRound(model, tokenizer, nsamples=128, iters=200, seqlen=512, batch_size=4, bits=bits, group_size=group_size, sym=sym, device=device, amp=amp)
74
+ autoround.quantize()
75
+ output_dir = "./AutoRound/tiiuae_Falcon3-3B-Base-autogptq-int4-gs128-sym"
76
+ autoround.save_quantized(output_dir, format='auto_gptq', inplace=True)
77
+ ```
78
+
79
+ ## License
80
+
81
+ [Falcon3 License](https://falconllm.tii.ae/falcon-terms-and-conditions.html)
82
+
83
+ ## Disclaimer
84
+
85
+ This quantized model comes with no warranty. It has been developed only for research purposes.
config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "tiiuae/Falcon3-3B-Base",
3
+ "activation": "swiglu",
4
+ "architectures": [
5
+ "LlamaForCausalLM"
6
+ ],
7
+ "attention_bias": false,
8
+ "attention_dropout": 0.0,
9
+ "bos_token_id": 1,
10
+ "eos_token_id": 11,
11
+ "head_dim": 256,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 3072,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 9216,
16
+ "max_position_embeddings": 32768,
17
+ "mlp_bias": false,
18
+ "model_type": "llama",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 22,
21
+ "num_key_value_heads": 4,
22
+ "pretraining_tp": 1,
23
+ "quantization_config": {
24
+ "amp": false,
25
+ "autoround_version": "0.4.3",
26
+ "batch_size": 4,
27
+ "bits": 4,
28
+ "damp_percent": 0.01,
29
+ "data_type": "int",
30
+ "desc_act": false,
31
+ "enable_minmax_tuning": true,
32
+ "enable_norm_bias_tuning": false,
33
+ "enable_quanted_input": true,
34
+ "gradient_accumulate_steps": 1,
35
+ "group_size": 128,
36
+ "iters": 200,
37
+ "low_gpu_mem_usage": false,
38
+ "lr": 0.005,
39
+ "minmax_lr": 0.005,
40
+ "nsamples": 128,
41
+ "quant_method": "gptq",
42
+ "scale_dtype": "torch.float16",
43
+ "seqlen": 512,
44
+ "sym": true,
45
+ "to_quant_block_names": null,
46
+ "true_sequential": false
47
+ },
48
+ "rms_norm_eps": 1e-06,
49
+ "rope_scaling": null,
50
+ "rope_theta": 1000042,
51
+ "tie_word_embeddings": false,
52
+ "torch_dtype": "float32",
53
+ "transformers_version": "4.48.0",
54
+ "use_cache": true,
55
+ "vocab_size": 131072
56
+ }
generation_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 11,
4
+ "transformers_version": "4.48.0"
5
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3586c67e5e29d510b2ddc6ebf783924961cab1ad2b7174a880d3e46e48ec5436
3
+ size 4482700120
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
+ "batch_size": 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
+ "to_quant_block_names": null,
19
+ "enable_norm_bias_tuning": false,
20
+ "autoround_version": "0.4.3",
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,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ ">>TITLE<<",
4
+ ">>ABSTRACT<<",
5
+ ">>INTRODUCTION<<",
6
+ ">>SUMMARY<<",
7
+ ">>COMMENT<<",
8
+ ">>ANSWER<<",
9
+ ">>QUESTION<<",
10
+ ">>DOMAIN<<",
11
+ ">>EMAIL_ADDRESS<<",
12
+ ">>IP_ADDRESS<<",
13
+ "<|startoftext|>",
14
+ ">>IP_ADDRESS_0<<",
15
+ ">>IP_ADDRESS_1<<",
16
+ ">>IP_ADDRESS_2<<",
17
+ ">>IP_ADDRESS_3<<",
18
+ ">>IP_ADDRESS_4<<",
19
+ ">>IP_ADDRESS_5<<",
20
+ ">>IP_ADDRESS_6<<",
21
+ ">>IP_ADDRESS_7<<",
22
+ ">>IP_ADDRESS_8<<",
23
+ ">>IP_ADDRESS_9<<",
24
+ ">>PASSWORD<<",
25
+ ">>KEY<<"
26
+ ],
27
+ "eos_token": {
28
+ "content": "<|endoftext|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ },
34
+ "pad_token": {
35
+ "content": "<|pad|>",
36
+ "lstrip": false,
37
+ "normalized": false,
38
+ "rstrip": false,
39
+ "single_word": false
40
+ }
41
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff