AINovice2005 commited on
Commit
5e66914
·
verified ·
1 Parent(s): f008f63

Add files using upload-large-folder tool

Browse files
Files changed (4) hide show
  1. README.md +95 -0
  2. config.json +32 -0
  3. qmodel.pt +3 -0
  4. smash_config.json +42 -0
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: transformers
5
+ license: apache-2.0
6
+ tags:
7
+ - pruna-ai
8
+ - safetensors
9
+ ---
10
+
11
+ # Model Card for AINovice2005/SmolLM2-360M-smashed
12
+
13
+ This model was created using the [pruna](https://github.com/PrunaAI/pruna) library. Pruna is a model optimization framework built for developers, enabling you to deliver more efficient models with minimal implementation overhead.
14
+
15
+ ## Usage
16
+
17
+ First things first, you need to install the pruna library:
18
+
19
+ ```bash
20
+ pip install pruna
21
+ ```
22
+
23
+ You can [use the transformers library to load the model](https://huggingface.co/AINovice2005/SmolLM2-360M-smashed?library=transformers) but this might not include all optimizations by default.
24
+
25
+ To ensure that all optimizations are applied, use the pruna library to load the model using the following code:
26
+
27
+ ```python
28
+ from pruna import PrunaModel
29
+
30
+ loaded_model = PrunaModel.from_pretrained(
31
+ "AINovice2005/SmolLM2-360M-smashed"
32
+ )
33
+ # we can then run inference using the methods supported by the base model
34
+ ```
35
+
36
+
37
+ For inference, you can use the inference methods of the original model like shown in [the original model card](https://huggingface.co/HuggingFaceTB/SmolLM2-360M?library=transformers).
38
+ Alternatively, you can visit [the Pruna documentation](https://docs.pruna.ai/en/stable/) for more information.
39
+
40
+ ## Smash Configuration
41
+
42
+ The compression configuration of the model is stored in the `smash_config.json` file, which describes the optimization methods that were applied to the model.
43
+
44
+ ```bash
45
+ {
46
+ "batcher": null,
47
+ "cacher": null,
48
+ "compiler": "torch_compile",
49
+ "factorizer": null,
50
+ "kernel": null,
51
+ "pruner": null,
52
+ "quantizer": "hqq",
53
+ "hqq_backend": "torchao_int4",
54
+ "hqq_compute_dtype": "torch.bfloat16",
55
+ "hqq_force_hf_implementation": false,
56
+ "hqq_group_size": 64,
57
+ "hqq_use_torchao_kernels": true,
58
+ "hqq_weight_bits": 4,
59
+ "torch_compile_backend": "inductor",
60
+ "torch_compile_dynamic": false,
61
+ "torch_compile_fullgraph": true,
62
+ "torch_compile_make_portable": false,
63
+ "torch_compile_max_kv_cache_size": 400,
64
+ "torch_compile_mode": "max-autotune",
65
+ "torch_compile_seqlen_manual_cuda_graph": 200,
66
+ "torch_compile_target": "model",
67
+ "batch_size": 1,
68
+ "device": "cuda:0",
69
+ "device_map": null,
70
+ "save_fns": [
71
+ "hqq",
72
+ "save_before_apply"
73
+ ],
74
+ "load_fns": [
75
+ "hqq"
76
+ ],
77
+ "reapply_after_load": {
78
+ "factorizer": null,
79
+ "pruner": null,
80
+ "quantizer": null,
81
+ "kernel": null,
82
+ "cacher": null,
83
+ "compiler": "torch_compile",
84
+ "batcher": null
85
+ }
86
+ }
87
+ ```
88
+
89
+ ## 🌍 Join the Pruna AI community!
90
+
91
+ [![Twitter](https://img.shields.io/twitter/follow/PrunaAI?style=social)](https://twitter.com/PrunaAI)
92
+ [![GitHub](https://img.shields.io/github/followers/PrunaAI?label=Follow%20%40PrunaAI&style=social)](https://github.com/PrunaAI)
93
+ [![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue)](https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following)
94
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Us-blue?style=social&logo=discord)](https://discord.gg/JFQmtFKCjd)
95
+ [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/PrunaAI?style=social)](https://www.reddit.com/r/PrunaAI/)
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_attn_implementation_autoset": true,
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 0,
9
+ "eos_token_id": 0,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 960,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 2560,
15
+ "is_llama_config": true,
16
+ "max_position_embeddings": 8192,
17
+ "mlp_bias": false,
18
+ "model_type": "llama",
19
+ "num_attention_heads": 15,
20
+ "num_hidden_layers": 32,
21
+ "num_key_value_heads": 5,
22
+ "pretraining_tp": 1,
23
+ "rms_norm_eps": 1e-05,
24
+ "rope_interleaved": false,
25
+ "rope_scaling": null,
26
+ "rope_theta": 100000,
27
+ "tie_word_embeddings": true,
28
+ "torch_dtype": "float32",
29
+ "transformers_version": "4.51.0",
30
+ "use_cache": true,
31
+ "vocab_size": 49152
32
+ }
qmodel.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afc3d52dea8d9537dac693075b31e9f3c0e75ff1d0342823d42c577b6a9cc8ba
3
+ size 271683987
smash_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "batcher": null,
3
+ "cacher": null,
4
+ "compiler": "torch_compile",
5
+ "factorizer": null,
6
+ "kernel": null,
7
+ "pruner": null,
8
+ "quantizer": "hqq",
9
+ "hqq_backend": "torchao_int4",
10
+ "hqq_compute_dtype": "torch.bfloat16",
11
+ "hqq_force_hf_implementation": false,
12
+ "hqq_group_size": 64,
13
+ "hqq_use_torchao_kernels": true,
14
+ "hqq_weight_bits": 4,
15
+ "torch_compile_backend": "inductor",
16
+ "torch_compile_dynamic": false,
17
+ "torch_compile_fullgraph": true,
18
+ "torch_compile_make_portable": false,
19
+ "torch_compile_max_kv_cache_size": 400,
20
+ "torch_compile_mode": "max-autotune",
21
+ "torch_compile_seqlen_manual_cuda_graph": 200,
22
+ "torch_compile_target": "model",
23
+ "batch_size": 1,
24
+ "device": "cuda:0",
25
+ "device_map": null,
26
+ "save_fns": [
27
+ "hqq",
28
+ "save_before_apply"
29
+ ],
30
+ "load_fns": [
31
+ "hqq"
32
+ ],
33
+ "reapply_after_load": {
34
+ "factorizer": null,
35
+ "pruner": null,
36
+ "quantizer": null,
37
+ "kernel": null,
38
+ "cacher": null,
39
+ "compiler": "torch_compile",
40
+ "batcher": null
41
+ }
42
+ }