sharpenb commited on
Commit
2c59eb8
·
verified ·
1 Parent(s): aac252e

Upload folder using huggingface_hub (#2)

Browse files

- b76cceb59f4719104ea87eb2ab0e275020c7f8da415a25c532d40201e58c151b (03f81a3a46ca536bcde0f42ffb47c74a90bd92c8)
- 58712546fd9fc7bc2653f80abcd3e58aed7a96c974f67a3e03c61b56ff5ad16e (e3819492a96715555f9272b73183f8ec3cd30c6c)

Files changed (4) hide show
  1. README.md +5 -5
  2. config.json +24 -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: NexaAIDev/Octopus-v2
4
  metrics:
5
  - memory_disk
6
  - memory_inference
@@ -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 NexaAIDev/Octopus-v2 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/NexaAIDev-Octopus-v2-HQQ-4bit-smashed", device_map='auto')
68
  except:
69
  model = AutoHQQHFModel.from_quantized("PrunaAI/NexaAIDev-Octopus-v2-HQQ-4bit-smashed")
70
- tokenizer = AutoTokenizer.from_pretrained("NexaAIDev/Octopus-v2")
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 NexaAIDev/Octopus-v2 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
 
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/NexaAIDev-Octopus-v2-HQQ-4bit-smashed", device_map='auto')
68
  except:
69
  model = AutoHQQHFModel.from_quantized("PrunaAI/NexaAIDev-Octopus-v2-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": "NexaAIDev/Octopus-v2",
 
3
  "architectures": [
4
  "GemmaForCausalLM"
5
  ],
@@ -9,7 +10,7 @@
9
  "eos_token_id": 1,
10
  "head_dim": 256,
11
  "hidden_act": "gelu",
12
- "hidden_activation": "gelu_pytorch_tanh",
13
  "hidden_size": 2048,
14
  "initializer_range": 0.02,
15
  "intermediate_size": 16384,
@@ -19,11 +20,31 @@
19
  "num_hidden_layers": 18,
20
  "num_key_value_heads": 1,
21
  "pad_token_id": 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  "rms_norm_eps": 1e-06,
23
  "rope_scaling": null,
24
  "rope_theta": 10000.0,
25
  "torch_dtype": "bfloat16",
26
- "transformers_version": "4.42.4",
27
  "use_cache": true,
28
  "vocab_size": 256022
29
  }
 
1
  {
2
+ "_attn_implementation_autoset": true,
3
+ "_name_or_path": "/tmp/models/tmpf3dzelyo/tmp_142zvua",
4
  "architectures": [
5
  "GemmaForCausalLM"
6
  ],
 
10
  "eos_token_id": 1,
11
  "head_dim": 256,
12
  "hidden_act": "gelu",
13
+ "hidden_activation": null,
14
  "hidden_size": 2048,
15
  "initializer_range": 0.02,
16
  "intermediate_size": 16384,
 
20
  "num_hidden_layers": 18,
21
  "num_key_value_heads": 1,
22
  "pad_token_id": 0,
23
+ "quantization_config": {
24
+ "quant_config": {
25
+ "offload_meta": false,
26
+ "scale_quant_params": null,
27
+ "weight_quant_params": {
28
+ "axis": 1,
29
+ "channel_wise": true,
30
+ "group_size": 64,
31
+ "nbits": 4,
32
+ "optimize": true,
33
+ "round_zero": true,
34
+ "view_as_float": false
35
+ },
36
+ "zero_quant_params": null
37
+ },
38
+ "quant_method": "hqq",
39
+ "skip_modules": [
40
+ "lm_head"
41
+ ]
42
+ },
43
  "rms_norm_eps": 1e-06,
44
  "rope_scaling": null,
45
  "rope_theta": 10000.0,
46
  "torch_dtype": "bfloat16",
47
+ "transformers_version": "4.48.2",
48
  "use_cache": true,
49
  "vocab_size": 256022
50
  }
qmodel.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:05b7a8c5c0ced02eb5108328835af327005610ffdd024cf41488d382dd7eaca3
3
- size 2086380826
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d8a235079ba7422ed3c5e27ad36bb71b5329ca3aca949ee7ec671f1e059cf3c
3
+ size 3336393102
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/modelsibj3ky1c",
18
- "batch_size": 1,
19
- "model_name": "NexaAIDev/Octopus-v2",
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/tmpf3dzelyo",
15
+ "task": "",
16
+ "save_load_fn": "hqq",
17
+ "save_load_fn_args": {},
18
+ "api_key": null
 
 
 
 
 
 
 
 
 
 
 
 
19
  }