sharpenb commited on
Commit
28b1ad4
1 Parent(s): a564370

970eff8f1514d4a34b9200026374868b28019c49bccdbc24026cbe60c3bc30b3

Browse files
README.md CHANGED
@@ -1,5 +1,6 @@
1
  ---
2
  thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
 
3
  metrics:
4
  - memory_disk
5
  - memory_inference
@@ -39,7 +40,7 @@ tags:
39
  **Frequently Asked Questions**
40
  - ***How does the compression work?*** The model is compressed with llm-int8.
41
  - ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
42
- - ***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.
43
  - ***What is the model format?*** We use safetensors.
44
  - ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
45
  - ***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.
@@ -59,15 +60,15 @@ You can run the smashed model with these steps:
59
  2. Load & run the model.
60
  ```python
61
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
62
 
63
- model = AutoModelForCausalLM.from_pretrained("PrunaAI/rinna-japanese-gpt2-small-bnb-4bit-smashed",
64
- trust_remote_code=True, device_map='auto')
65
- tokenizer = AutoTokenizer.from_pretrained("rinna/japanese-gpt2-small")
66
 
67
- input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
68
 
69
- outputs = model.generate(input_ids, max_new_tokens=216)
70
- tokenizer.decode(outputs[0])
71
  ```
72
 
73
  ## Configurations
 
1
  ---
2
  thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
3
+ base_model: rinna/japanese-gpt2-small
4
  metrics:
5
  - memory_disk
6
  - memory_inference
 
40
  **Frequently Asked Questions**
41
  - ***How does the compression work?*** The model is compressed with llm-int8.
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.
 
60
  2. Load & run the model.
61
  ```python
62
  from transformers import AutoModelForCausalLM, AutoTokenizer
63
+
64
 
65
+ model = AutoModelForCausalLM.from_pretrained("PrunaAI/rinna-japanese-gpt2-small-bnb-4bit-smashed", trust_remote_code=True, device_map='auto')
66
+ tokenizer = AutoTokenizer.from_pretrained("rinna/japanese-gpt2-small")
 
67
 
68
+ input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
69
 
70
+ outputs = model.generate(input_ids, max_new_tokens=216)
71
+ tokenizer.decode(outputs[0])
72
  ```
73
 
74
  ## Configurations
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "/tmp/tmpdv5c7kbh",
3
  "activation_function": "gelu_new",
4
  "architectures": [
5
  "GPT2LMHeadModel"
@@ -19,7 +19,10 @@
19
  "n_layer": 12,
20
  "n_positions": 1024,
21
  "quantization_config": {
 
 
22
  "bnb_4bit_compute_dtype": "bfloat16",
 
23
  "bnb_4bit_quant_type": "fp4",
24
  "bnb_4bit_use_double_quant": false,
25
  "llm_int8_enable_fp32_cpu_offload": false,
@@ -48,7 +51,7 @@
48
  }
49
  },
50
  "torch_dtype": "float16",
51
- "transformers_version": "4.37.1",
52
  "use_cache": true,
53
  "vocab_size": 32000
54
  }
 
1
  {
2
+ "_name_or_path": "/ceph/hdd/staff/charpent/.cache/modelspg3vvjdsgf_6cp51",
3
  "activation_function": "gelu_new",
4
  "architectures": [
5
  "GPT2LMHeadModel"
 
19
  "n_layer": 12,
20
  "n_positions": 1024,
21
  "quantization_config": {
22
+ "_load_in_4bit": true,
23
+ "_load_in_8bit": false,
24
  "bnb_4bit_compute_dtype": "bfloat16",
25
+ "bnb_4bit_quant_storage": "uint8",
26
  "bnb_4bit_quant_type": "fp4",
27
  "bnb_4bit_use_double_quant": false,
28
  "llm_int8_enable_fp32_cpu_offload": false,
 
51
  }
52
  },
53
  "torch_dtype": "float16",
54
+ "transformers_version": "4.40.0",
55
  "use_cache": true,
56
  "vocab_size": 32000
57
  }
generation_config.json CHANGED
@@ -2,5 +2,5 @@
2
  "_from_model_config": true,
3
  "bos_token_id": 1,
4
  "eos_token_id": 2,
5
- "transformers_version": "4.37.1"
6
  }
 
2
  "_from_model_config": true,
3
  "bos_token_id": 1,
4
  "eos_token_id": 2,
5
+ "transformers_version": "4.40.0"
6
  }
smash_config.json CHANGED
@@ -3,17 +3,21 @@
3
  "verify_url": "http://johnrachwan.pythonanywhere.com",
4
  "smash_config": {
5
  "pruners": "None",
 
6
  "factorizers": "None",
7
  "quantizers": "['llm-int8']",
 
 
8
  "compilers": "None",
9
- "task": "text_text_generation",
 
 
 
10
  "device": "cuda",
11
- "cache_dir": "/ceph/hdd/staff/charpent/.cache/modelsq2bbftiu",
12
  "batch_size": 1,
13
  "model_name": "rinna/japanese-gpt2-small",
14
- "pruning_ratio": 0.0,
15
- "n_quantization_bits": 4,
16
- "output_deviation": 0.005,
17
  "max_batch_size": 1,
18
  "qtype_weight": "torch.qint8",
19
  "qtype_activation": "torch.quint8",
 
3
  "verify_url": "http://johnrachwan.pythonanywhere.com",
4
  "smash_config": {
5
  "pruners": "None",
6
+ "pruning_ratio": 0.0,
7
  "factorizers": "None",
8
  "quantizers": "['llm-int8']",
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/modelspg3vvjds",
18
  "batch_size": 1,
19
  "model_name": "rinna/japanese-gpt2-small",
20
+ "task": "text_text_generation",
 
 
21
  "max_batch_size": 1,
22
  "qtype_weight": "torch.qint8",
23
  "qtype_activation": "torch.quint8",
special_tokens_map.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": {
5
+ "content": "</s>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false
10
+ },
11
+ "mask_token": "[MASK]",
12
+ "pad_token": {
13
+ "content": "[PAD]",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false
18
+ },
19
+ "sep_token": "[SEP]",
20
+ "unk_token": {
21
+ "content": "<unk>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ }
27
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<unk>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<s>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "[PAD]",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "[CLS]",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": "[SEP]",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": "[MASK]",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ }
60
+ },
61
+ "additional_special_tokens": [],
62
+ "bos_token": "<s>",
63
+ "clean_up_tokenization_spaces": true,
64
+ "cls_token": "[CLS]",
65
+ "do_lower_case": true,
66
+ "eos_token": "</s>",
67
+ "extra_ids": 0,
68
+ "legacy": false,
69
+ "mask_token": "[MASK]",
70
+ "model_max_length": 1000000000000000019884624838656,
71
+ "pad_token": "[PAD]",
72
+ "sep_token": "[SEP]",
73
+ "sp_model_kwargs": {},
74
+ "tokenizer_class": "T5Tokenizer",
75
+ "unk_token": "<unk>"
76
+ }