sharpenb commited on
Commit
ef93784
·
verified ·
1 Parent(s): 4b43867

Upload folder using huggingface_hub (#2)

Browse files

- 6b74596c6378c99285400dc8a526592eb54fd8611d02b0be0582aebccc770e75 (c4b55fb63ba70daf191f57d4a43b4eabe0b4c77f)
- c9767f67b63793d1fa283e54f92b5ce182b37ac72d6cd74ea18d8202a7ee65f5 (8cc929ce038ec0be338348b5eb156061a5924676)

Files changed (4) hide show
  1. README.md +6 -6
  2. config.json +26 -3
  3. qmodel.pt +2 -2
  4. smash_config.json +17 -29
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
3
- base_model: 01-ai/Yi-6B
4
  metrics:
5
  - memory_disk
6
  - memory_inference
@@ -31,7 +31,7 @@ tags:
31
  - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
32
  - Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
33
  - Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
34
- - Join Pruna AI community on Discord [here](https://discord.gg/rskEr4BZJx) to share feedback/suggestions or get help.
35
 
36
  ## Results
37
 
@@ -40,7 +40,7 @@ tags:
40
  **Frequently Asked Questions**
41
  - ***How does the compression work?*** The model is compressed with hqq.
42
  - ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
43
- - ***How is the model efficiency evaluated?*** These results were obtained on HARDWARE_NAME with configuration described in `model/smash_config.json` and are obtained after a hardware warmup. The smashed model is directly compared to the original base model. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...). We recommend to directly run them in the use-case conditions to know if the smashed model can benefit you.
44
  - ***What is the model format?*** We use safetensors.
45
  - ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
46
  - ***What is the naming convention for Pruna Huggingface models?*** We take the original model name and append "turbo", "tiny", or "green" if the smashed model has a measured inference speed, inference memory, or inference energy consumption which is less than 90% of the original base model.
@@ -52,7 +52,7 @@ tags:
52
 
53
  You can run the smashed model with these steps:
54
 
55
- 0. Check requirements from the original repo 01-ai/Yi-6B installed. In particular, check python, cuda, and transformers versions.
56
  1. Make sure that you have installed quantization related packages.
57
  ```bash
58
  pip install hqq
@@ -67,7 +67,7 @@ You can run the smashed model with these steps:
67
  model = HQQModelForCausalLM.from_quantized("PrunaAI/01-ai-Yi-6B-HQQ-4bit-smashed", device_map='auto')
68
  except:
69
  model = AutoHQQHFModel.from_quantized("PrunaAI/01-ai-Yi-6B-HQQ-4bit-smashed")
70
- tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-6B")
71
 
72
  input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
73
 
@@ -81,7 +81,7 @@ The configuration info are in `smash_config.json`.
81
 
82
  ## Credits & License
83
 
84
- The license of the smashed model follows the license of the original model. Please check the license of the original model 01-ai/Yi-6B before using this model which provided the base model. The license of the `pruna-engine` is [here](https://pypi.org/project/pruna-engine/) on Pypi.
85
 
86
  ## Want to compress other models?
87
 
 
1
  ---
2
  thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
3
+ base_model: ORIGINAL_REPO_NAME
4
  metrics:
5
  - memory_disk
6
  - memory_inference
 
31
  - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
32
  - Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
33
  - Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
34
+ - Join Pruna AI community on Discord [here](https://discord.gg/CP4VSgck) to share feedback/suggestions or get help.
35
 
36
  ## Results
37
 
 
40
  **Frequently Asked Questions**
41
  - ***How does the compression work?*** The model is compressed with hqq.
42
  - ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
43
+ - ***How is the model efficiency evaluated?*** These results were obtained with configuration described in `model/smash_config.json` and are obtained after a hardware warmup. The smashed model is directly compared to the original base model. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...). We recommend to directly run them in the use-case conditions to know if the smashed model can benefit you.
44
  - ***What is the model format?*** We use safetensors.
45
  - ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
46
  - ***What is the naming convention for Pruna Huggingface models?*** We take the original model name and append "turbo", "tiny", or "green" if the smashed model has a measured inference speed, inference memory, or inference energy consumption which is less than 90% of the original base model.
 
52
 
53
  You can run the smashed model with these steps:
54
 
55
+ 0. Check requirements from the original repo ORIGINAL_REPO_NAME installed. In particular, check python, cuda, and transformers versions.
56
  1. Make sure that you have installed quantization related packages.
57
  ```bash
58
  pip install hqq
 
67
  model = HQQModelForCausalLM.from_quantized("PrunaAI/01-ai-Yi-6B-HQQ-4bit-smashed", device_map='auto')
68
  except:
69
  model = AutoHQQHFModel.from_quantized("PrunaAI/01-ai-Yi-6B-HQQ-4bit-smashed")
70
+ tokenizer = AutoTokenizer.from_pretrained("ORIGINAL_REPO_NAME")
71
 
72
  input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
73
 
 
81
 
82
  ## Credits & License
83
 
84
+ The license of the smashed model follows the license of the original model. Please check the license of the original model ORIGINAL_REPO_NAME before using this model which provided the base model. The license of the `pruna-engine` is [here](https://pypi.org/project/pruna-engine/) on Pypi.
85
 
86
  ## Want to compress other models?
87
 
config.json CHANGED
@@ -1,5 +1,6 @@
1
  {
2
- "_name_or_path": "/tmp/tmpwd81rsjm",
 
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
@@ -7,23 +8,45 @@
7
  "attention_dropout": 0.0,
8
  "bos_token_id": 1,
9
  "eos_token_id": 2,
 
10
  "hidden_act": "silu",
11
  "hidden_size": 4096,
12
  "initializer_range": 0.02,
13
  "intermediate_size": 11008,
14
  "max_position_embeddings": 4096,
 
15
  "model_type": "llama",
16
  "num_attention_heads": 32,
17
  "num_hidden_layers": 32,
18
  "num_key_value_heads": 4,
19
  "pad_token_id": 0,
20
  "pretraining_tp": 1,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  "rms_norm_eps": 1e-05,
22
  "rope_scaling": null,
23
  "rope_theta": 5000000.0,
24
  "tie_word_embeddings": false,
25
- "torch_dtype": "float16",
26
- "transformers_version": "4.40.0",
27
  "use_cache": true,
28
  "vocab_size": 64000
29
  }
 
1
  {
2
+ "_attn_implementation_autoset": true,
3
+ "_name_or_path": "/tmp/models/tmp6gmfzz0k/tmpx116_w60",
4
  "architectures": [
5
  "LlamaForCausalLM"
6
  ],
 
8
  "attention_dropout": 0.0,
9
  "bos_token_id": 1,
10
  "eos_token_id": 2,
11
+ "head_dim": 128,
12
  "hidden_act": "silu",
13
  "hidden_size": 4096,
14
  "initializer_range": 0.02,
15
  "intermediate_size": 11008,
16
  "max_position_embeddings": 4096,
17
+ "mlp_bias": false,
18
  "model_type": "llama",
19
  "num_attention_heads": 32,
20
  "num_hidden_layers": 32,
21
  "num_key_value_heads": 4,
22
  "pad_token_id": 0,
23
  "pretraining_tp": 1,
24
+ "quantization_config": {
25
+ "quant_config": {
26
+ "offload_meta": false,
27
+ "scale_quant_params": null,
28
+ "weight_quant_params": {
29
+ "axis": 1,
30
+ "channel_wise": true,
31
+ "group_size": 64,
32
+ "nbits": 4,
33
+ "optimize": true,
34
+ "round_zero": true,
35
+ "view_as_float": false
36
+ },
37
+ "zero_quant_params": null
38
+ },
39
+ "quant_method": "hqq",
40
+ "skip_modules": [
41
+ "lm_head"
42
+ ]
43
+ },
44
  "rms_norm_eps": 1e-05,
45
  "rope_scaling": null,
46
  "rope_theta": 5000000.0,
47
  "tie_word_embeddings": false,
48
+ "torch_dtype": "bfloat16",
49
+ "transformers_version": "4.48.2",
50
  "use_cache": true,
51
  "vocab_size": 64000
52
  }
qmodel.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fff1040b22c1f6c8f4985e7a01d2140b91309c3577da55907b0f94a6464c5958
3
- size 3947487936
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ffcf2b8523c7101eeceee261b84664d6dd4ee6b3e3229816f2ceea955124d55
3
+ size 5034463405
smash_config.json CHANGED
@@ -1,31 +1,19 @@
1
  {
2
- "api_key": null,
3
- "verify_url": "http://johnrachwan.pythonanywhere.com",
4
- "smash_config": {
5
- "pruners": "None",
6
- "pruning_ratio": 0.0,
7
- "factorizers": "None",
8
- "quantizers": "['hqq']",
9
- "weight_quantization_bits": 4,
10
- "output_deviation": 0.005,
11
- "compilers": "None",
12
- "static_batch": true,
13
- "static_shape": true,
14
- "controlnet": "None",
15
- "unet_dim": 4,
16
- "device": "cuda",
17
- "cache_dir": "/ceph/hdd/staff/charpent/.cache/modelswd9n1bvl",
18
- "batch_size": 1,
19
- "model_name": "01-ai/Yi-6B",
20
- "task": "text_text_generation",
21
- "max_batch_size": 1,
22
- "qtype_weight": "torch.qint8",
23
- "qtype_activation": "torch.quint8",
24
- "qobserver": "<class 'torch.ao.quantization.observer.MinMaxObserver'>",
25
- "qscheme": "torch.per_tensor_symmetric",
26
- "qconfig": "x86",
27
- "group_size": 128,
28
- "damp_percent": 0.1,
29
- "save_load_fn": "hqq"
30
- }
31
  }
 
1
  {
2
+ "batchers": null,
3
+ "cachers": null,
4
+ "compilers": null,
5
+ "distillers": null,
6
+ "pruners": null,
7
+ "quantizers": "hqq",
8
+ "recoverers": null,
9
+ "quant_hqq_backend": "torchao_int4",
10
+ "quant_hqq_group_size": 64,
11
+ "quant_hqq_weight_bits": 4,
12
+ "max_batch_size": 1,
13
+ "device": "cuda",
14
+ "cache_dir": "/tmp/models/tmp6gmfzz0k",
15
+ "task": "",
16
+ "save_load_fn": "hqq",
17
+ "save_load_fn_args": {},
18
+ "api_key": null
 
 
 
 
 
 
 
 
 
 
 
 
19
  }