sharpenb commited on
Commit
935f98c
·
verified ·
1 Parent(s): b5e5f52

Upload folder using huggingface_hub (#2)

Browse files

- 7c2fd48476aee257ddc66bd2d2b93f6d9592e731654e288ca5f1e5f232327602 (699cfbfb112b240e3be257531556a69df78c0271)
- 78e238a16db6e71081f784bb8a50d5b715536ed86fa4c3b79c481708f51414e6 (2d8bbe588a6df7638a8be5bef2a50fc5ffe4594b)

Files changed (4) hide show
  1. README.md +5 -5
  2. config.json +2 -1
  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: google/gemma-2-2b-it
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 google/gemma-2-2b-it 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/google-gemma-2-2b-it-HQQ-4bit-smashed", device_map='auto')
68
  except:
69
  model = AutoHQQHFModel.from_quantized("PrunaAI/google-gemma-2-2b-it-HQQ-4bit-smashed")
70
- tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-2b-it")
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 google/gemma-2-2b-it 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/google-gemma-2-2b-it-HQQ-4bit-smashed", device_map='auto')
68
  except:
69
  model = AutoHQQHFModel.from_quantized("PrunaAI/google-gemma-2-2b-it-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,4 +1,5 @@
1
  {
 
2
  "_name_or_path": "google/gemma-2-2b-it",
3
  "architectures": [
4
  "Gemma2ForCausalLM"
@@ -30,7 +31,7 @@
30
  "rope_theta": 10000.0,
31
  "sliding_window": 4096,
32
  "torch_dtype": "bfloat16",
33
- "transformers_version": "4.42.4",
34
  "use_cache": true,
35
  "vocab_size": 256000
36
  }
 
1
  {
2
+ "_attn_implementation_autoset": true,
3
  "_name_or_path": "google/gemma-2-2b-it",
4
  "architectures": [
5
  "Gemma2ForCausalLM"
 
31
  "rope_theta": 10000.0,
32
  "sliding_window": 4096,
33
  "torch_dtype": "bfloat16",
34
+ "transformers_version": "4.48.2",
35
  "use_cache": true,
36
  "vocab_size": 256000
37
  }
qmodel.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:29677f81e446d534ddbb44704be6226bbddc440432a3c6f32b939ac0b63d68b7
3
- size 2240036054
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e340e16e22c752bcadb364e206f53ae536c5a8e2c1f5fa935079d9b3f85cd3ca
3
+ size 2318999562
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/modelswozln36g",
18
- "batch_size": 1,
19
- "model_name": "google/gemma-2-2b-it",
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/tmpogyn7q5z",
15
+ "task": "",
16
+ "save_load_fn": "hqq",
17
+ "save_load_fn_args": {},
18
+ "api_key": null
 
 
 
 
 
 
 
 
 
 
 
 
19
  }