sharpenb commited on
Commit
8a7e06b
1 Parent(s): aa81348

Upload folder using huggingface_hub (#3)

Browse files

- 34378a73095e6fceb5eaa987d919dc01c9230e1e99b82e9b35d0b906dba3c2e3 (ddbb5b827af098148016296bae5ddd5585d5a61b)
- 5208d9ad63f21c2da0c084ced6a29fc305907855fc0b5bc1437cd388e91ba7d8 (e4926cde0b0f141eb796735ff2cf2756a773d8b0)

Files changed (2) hide show
  1. README.md +9 -9
  2. results.json +15 -30
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/codegemma-2b
4
  metrics:
5
  - memory_disk
6
  - memory_inference
@@ -38,9 +38,9 @@ tags:
38
  ![image info](./plots.png)
39
 
40
  **Frequently Asked Questions**
41
- - ***How does the compression work?*** The model is compressed with awq.
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 NVIDIA A100-PCIE-40GB 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,18 +52,18 @@ tags:
52
 
53
  You can run the smashed model with these steps:
54
 
55
- 0. Check requirements from the original repo google/codegemma-2b 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 autoawq
59
  ```
60
  2. Load & run the model.
61
  ```python
62
  from transformers import AutoModelForCausalLM, AutoTokenizer
63
- from awq import AutoAWQForCausalLM
64
 
65
- model = AutoAWQForCausalLM.from_quantized("PrunaAI/google-codegemma-2b-AWQ-4bit-smashed", trust_remote_code=True, device_map='auto')
66
- tokenizer = AutoTokenizer.from_pretrained("google/codegemma-2b")
67
 
68
  input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
69
 
@@ -77,7 +77,7 @@ The configuration info are in `smash_config.json`.
77
 
78
  ## Credits & License
79
 
80
- The license of the smashed model follows the license of the original model. Please check the license of the original model google/codegemma-2b 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.
81
 
82
  ## Want to compress other models?
83
 
 
1
  ---
2
  thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
3
+ base_model: PrunaAI/google-codegemma-2b-AWQ-4bit-smashed
4
  metrics:
5
  - memory_disk
6
  - memory_inference
 
38
  ![image info](./plots.png)
39
 
40
  **Frequently Asked Questions**
41
+ - ***How does the compression work?*** The model is compressed with [.
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
 
53
  You can run the smashed model with these steps:
54
 
55
+ 0. Check requirements from the original repo PrunaAI/google-codegemma-2b-AWQ-4bit-smashed installed. In particular, check python, cuda, and transformers versions.
56
  1. Make sure that you have installed quantization related packages.
57
  ```bash
58
+ REQUIREMENTS_INSTRUCTIONS
59
  ```
60
  2. Load & run the model.
61
  ```python
62
  from transformers import AutoModelForCausalLM, AutoTokenizer
63
+ IMPORTS
64
 
65
+ MODEL_LOAD
66
+ tokenizer = AutoTokenizer.from_pretrained("PrunaAI/google-codegemma-2b-AWQ-4bit-smashed")
67
 
68
  input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
69
 
 
77
 
78
  ## Credits & License
79
 
80
+ The license of the smashed model follows the license of the original model. Please check the license of the original model PrunaAI/google-codegemma-2b-AWQ-4bit-smashed 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.
81
 
82
  ## Want to compress other models?
83
 
results.json CHANGED
@@ -1,32 +1,17 @@
1
  {
2
- "base_current_gpu_type": "NVIDIA A100-PCIE-40GB",
3
- "base_current_gpu_total_memory": 40339.3125,
4
- "base_perplexity": Infinity,
5
- "base_token_generation_latency_sync": 19.835946083068848,
6
- "base_token_generation_latency_async": 20.04348710179329,
7
- "base_token_generation_throughput_sync": 0.0504135268271151,
8
- "base_token_generation_throughput_async": 0.049891518123636784,
9
- "base_token_generation_CO2_emissions": null,
10
- "base_token_generation_energy_consumption": null,
11
- "base_inference_latency_sync": 41.10581817626953,
12
- "base_inference_latency_async": 16.791272163391113,
13
- "base_inference_throughput_sync": 0.024327456412905117,
14
- "base_inference_throughput_async": 0.05955474905470433,
15
- "base_inference_CO2_emissions": null,
16
- "base_inference_energy_consumption": null,
17
- "smashed_current_gpu_type": "NVIDIA A100-PCIE-40GB",
18
- "smashed_current_gpu_total_memory": 40339.3125,
19
- "smashed_perplexity": Infinity,
20
- "smashed_token_generation_latency_sync": 23.63898696899414,
21
- "smashed_token_generation_latency_async": 23.484380170702934,
22
- "smashed_token_generation_throughput_sync": 0.042302997218605046,
23
- "smashed_token_generation_throughput_async": 0.04258149428391186,
24
- "smashed_token_generation_CO2_emissions": null,
25
- "smashed_token_generation_energy_consumption": null,
26
- "smashed_inference_latency_sync": 52.26373176574707,
27
- "smashed_inference_latency_async": 23.98686408996582,
28
- "smashed_inference_throughput_sync": 0.019133727466728395,
29
- "smashed_inference_throughput_async": 0.04168948455493687,
30
- "smashed_inference_CO2_emissions": null,
31
- "smashed_inference_energy_consumption": null
32
  }
 
1
  {
2
+ "current_gpu_type": "NVIDIA A100-PCIE-40GB",
3
+ "current_gpu_total_memory": 40339.3125,
4
+ "perplexity": Infinity,
5
+ "token_generation_latency_sync": 9.927025508880615,
6
+ "token_generation_latency_async": 9.78469680994749,
7
+ "token_generation_throughput_sync": 0.10073510933415153,
8
+ "token_generation_throughput_async": 0.10220040737321186,
9
+ "token_generation_CO2_emissions": null,
10
+ "token_generation_energy_consumption": null,
11
+ "inference_latency_sync": 54.19745292663574,
12
+ "inference_latency_async": 17.0029878616333,
13
+ "inference_throughput_sync": 0.01845105159007468,
14
+ "inference_throughput_async": 0.05881319260695751,
15
+ "inference_CO2_emissions": null,
16
+ "inference_energy_consumption": null
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }