fbaldassarri commited on
Commit
be236f1
·
verified ·
1 Parent(s): fe11b52

Initial Upload

Browse files
README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - intel
18
+ - pytorch
19
+ - falcon3
20
+ model_name: Falcon3 3B Instruct
21
+ base_model:
22
+ - tiiuae/Falcon3-3B-Instruct
23
+ inference: false
24
+ library_name: transformers
25
+ model_creator: tiiuae
26
+ prompt_template: '{prompt} '
27
+ quantized_by: fbaldassarri
28
+ ---
29
+
30
+ ## Model Information
31
+
32
+ Quantized version of [tiiuae/Falcon3-3B-Instruct](https://huggingface.co/tiiuae/Falcon3-3B-Instruct) using torch.float32 for quantization tuning.
33
+ - 4 bits (INT4)
34
+ - group size = 128
35
+ - Asymmetrical Quantization
36
+ - Method WoQ (AutoRound format)
37
+
38
+ Fast and low memory, 2-3X speedup (slight accuracy drop at W4G128)
39
+
40
+ Quantization framework: [Intel AutoRound](https://github.com/intel/auto-round) v0.4.4
41
+
42
+ Note: this INT4 version of Falcon3-3B-Instruct has been quantized to run inference through CPU.
43
+
44
+ ## Replication Recipe
45
+
46
+ ### Step 1 Install Requirements
47
+
48
+ I suggest to install requirements into a dedicated python-virtualenv or a conda enviroment.
49
+
50
+ ```
51
+ wget https://github.com/intel/auto-round/archive/refs/tags/v0.4.4.tar.gz
52
+ tar -xvzf v0.4.4.tar.gz
53
+ cd auto-round-0.4.4
54
+ pip install -r requirements-cpu.txt --upgrade
55
+ ```
56
+
57
+ ### Step 2 Build Intel AutoRound wheel from sources
58
+
59
+ ```
60
+ pip install -vvv --no-build-isolation -e .[cpu]
61
+ ```
62
+
63
+ ### Step 3 Script for Quantization
64
+
65
+ ```
66
+ from transformers import AutoModelForCausalLM, AutoTokenizer
67
+ model_name = "tiiuae/Falcon3-3B-Instruct"
68
+ model = AutoModelForCausalLM.from_pretrained(model_name)
69
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
70
+ from auto_round import AutoRound
71
+ bits, group_size, sym, device, amp = 4, 128, False, 'cpu', False
72
+ 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)
73
+ autoround.quantize()
74
+ output_dir = "./AutoRound/tiiuae_Falcon3-3B-Instruct-autoround-int4-gs128-asym"
75
+ autoround.save_quantized(output_dir, format='auto_round', inplace=True)
76
+ ```
77
+
78
+ ## License
79
+
80
+ [Falcon3 License](https://falconllm.tii.ae/falcon-terms-and-conditions.html)
81
+
82
+ ## Disclaimer
83
+
84
+ This quantized model comes with no warranty. It has been developed only for research purposes.
config.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "tiiuae/Falcon3-3B-Instruct",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "eos_token_id": 11,
10
+ "head_dim": 256,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 3072,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 9216,
15
+ "max_position_embeddings": 32768,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 22,
20
+ "num_key_value_heads": 4,
21
+ "pretraining_tp": 1,
22
+ "quantization_config": {
23
+ "amp": false,
24
+ "autoround_version": "0.4.4",
25
+ "backend": "auto_round:exllamav2",
26
+ "batch_size": 4,
27
+ "bits": 4,
28
+ "data_type": "int",
29
+ "dataset": "NeelNanda/pile-10k",
30
+ "enable_minmax_tuning": true,
31
+ "enable_norm_bias_tuning": false,
32
+ "enable_quanted_input": true,
33
+ "gradient_accumulate_steps": 1,
34
+ "group_size": 128,
35
+ "iters": 200,
36
+ "low_gpu_mem_usage": false,
37
+ "lr": 0.005,
38
+ "minmax_lr": 0.005,
39
+ "nsamples": 128,
40
+ "quant_method": "intel/auto-round",
41
+ "scale_dtype": "torch.float16",
42
+ "seqlen": 512,
43
+ "sym": false,
44
+ "to_quant_block_names": null
45
+ },
46
+ "rms_norm_eps": 1e-06,
47
+ "rope_scaling": null,
48
+ "rope_theta": 1000042,
49
+ "tie_word_embeddings": false,
50
+ "torch_dtype": "float32",
51
+ "transformers_version": "4.48.0",
52
+ "use_cache": true,
53
+ "vocab_size": 131072
54
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 11,
4
+ "eos_token_id": 11,
5
+ "transformers_version": "4.48.0"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b5d985f721779ec4e3ec0331d6452e2afd1e501a57eccf635b5fc1ad8b7d468
3
+ size 4482700120
quantization_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": 128,
4
+ "sym": false,
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
+ "dataset": "NeelNanda/pile-10k",
21
+ "autoround_version": "0.4.4",
22
+ "quant_method": "intel/auto-round",
23
+ "backend": "auto_round:exllamav2"
24
+ }
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