LiamCarter commited on
Commit
c3cb185
·
verified ·
1 Parent(s): 9a107be

Add files using upload-large-folder tool

Browse files
Files changed (6) hide show
  1. README.md +75 -0
  2. SHA256SUMS +1 -0
  3. layer_mask_report.csv +41 -0
  4. meta.json +249 -0
  5. provenance.json +17 -0
  6. pruned_state_dict.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama2
3
+ base_model:
4
+ - meta-llama/Llama-2-13b-hf
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - grasprune
8
+ - structured-pruning
9
+ - pruning
10
+ - llama-2
11
+ ---
12
+
13
+ # Llama-2-13B — original GRASPrune, pruning ratio 0.5
14
+
15
+ This is a structurally pruned derivative of [`meta-llama/Llama-2-13b-hf`](https://huggingface.co/meta-llama/Llama-2-13b-hf).
16
+
17
+ ## Model provenance
18
+
19
+ **This checkpoint was produced by the original GRASPrune pruning pipeline in `methods/GRASPrune`, not by `new_method_2`.** The local `new_method_2` code was used only for downstream evaluation and did not produce or alter the pruned weights.
20
+
21
+ - Method: [GRASPrune: Global Gating for Budgeted Structured Pruning of Large Language Models](https://arxiv.org/abs/2604.19398)
22
+ - Original implementation: [ZiY-Wang/GRASPrune](https://github.com/ZiY-Wang/GRASPrune)
23
+ - Upstream source revision recorded with this release: `666f4f04ec9e5e3218904df4d0935841bbd570fc`
24
+ - Base model: `meta-llama/Llama-2-13b-hf`
25
+ - Target pruning ratio: `0.5`
26
+ - GRASPrune retained budget: `keep_ratio=0.5`
27
+ - Export dtype/format: `torch.bfloat16`, materialized state dict
28
+ - Rescale compensation: `rescale_alpha=0.5`
29
+
30
+ The 50% ratio is the target reduction of GRASPrune's global prunable structural budget across FFN intermediate channels and attention KV groups. It is not a uniform per-layer sparsity ratio or a file-size reduction ratio.
31
+
32
+ ## Files and loading
33
+
34
+ This is not a standard Transformers `save_pretrained` directory and cannot be loaded directly with `AutoModelForCausalLM.from_pretrained()`.
35
+
36
+ - `pruned_state_dict.safetensors`: materialized pruned weights
37
+ - `meta.json`: layer-specific shapes required to rebuild the architecture
38
+ - `layer_mask_report.csv`: layer-wise retention report
39
+ - `provenance.json`: release provenance and artifact identity
40
+ - `SHA256SUMS`: checksum for the weight file
41
+
42
+ Clone the original GRASPrune repository, run from its root, and use its `rebuild.py` loader. Loading also requires authorized access to the gated Llama-2-13B base model:
43
+
44
+ ```python
45
+ import os
46
+ import torch
47
+ from huggingface_hub import snapshot_download
48
+ from rebuild import load_pruned_model
49
+
50
+ checkpoint_dir = snapshot_download("LiamCarter/grasprune_llama2-13b_ratio0.5")
51
+ model, tokenizer, meta = load_pruned_model(
52
+ model_id="meta-llama/Llama-2-13b-hf",
53
+ state_dict_path=os.path.join(checkpoint_dir, "pruned_state_dict.safetensors"),
54
+ meta_path=os.path.join(checkpoint_dir, "meta.json"),
55
+ torch_dtype=torch.bfloat16,
56
+ device="cuda:0",
57
+ local_only=False,
58
+ )
59
+ ```
60
+
61
+ ## Local evaluation
62
+
63
+ The weights were evaluated read-only with the local `new_method_2` evaluation flow. Percentages:
64
+
65
+ | Common-sense 5-task macro avg | ICL 0-shot | ICL 1-shot | ICL 4-shot | ICL 8-shot |
66
+ |---:|---:|---:|---:|---:|
67
+ | 49.636 | 22.36 | 18.91 | 21.96 | 28.53 |
68
+
69
+ These are local benchmark results, not upstream GRASPrune claims.
70
+
71
+ ## Intended use, limitations, and license
72
+
73
+ This checkpoint is intended for structured-pruning and benchmark research. It has not been validated for production deployment, safety, factual reliability, bias, multilingual robustness, or long-context behavior. Performance can be substantially lower than the parent model, especially at this pruning ratio.
74
+
75
+ This is a derivative of Llama 2 and remains subject to the [Llama 2 Community License](https://ai.meta.com/llama/license/) and [Acceptable Use Policy](https://ai.meta.com/llama/use-policy/). Llama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved. Users must separately obtain access to the gated base model.
SHA256SUMS ADDED
@@ -0,0 +1 @@
 
 
1
+ 2b799eed9589316d580af59b898403f1638583eaa88c25756d44419cc2b4d63b pruned_state_dict.safetensors
layer_mask_report.csv ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ layer,ffn_keep,ffn_total,ffn_ratio,kv_keep,kv_total,kv_ratio,head_keep_eq,head_total,head_ratio_eq,~params_kept
2
+ 0,7789,13824,0.5634403935185185,26,40,0.65,26,40,0.65,12226
3
+ 1,7871,13824,0.5693721064814815,12,40,0.3,12,40,0.3,9919
4
+ 2,8537,13824,0.6175491898148148,26,40,0.65,26,40,0.65,12974
5
+ 3,8267,13824,0.5980179398148148,26,40,0.65,26,40,0.65,12704
6
+ 4,7714,13824,0.5580150462962963,26,40,0.65,26,40,0.65,12151
7
+ 5,7416,13824,0.5364583333333334,22,40,0.55,22,40,0.55,11170
8
+ 6,6990,13824,0.5056423611111112,24,40,0.6,24,40,0.6,11086
9
+ 7,7045,13824,0.5096209490740741,25,40,0.625,25,40,0.625,11311
10
+ 8,6849,13824,0.4954427083333333,28,40,0.7,28,40,0.7,11627
11
+ 9,6660,13824,0.4817708333333333,24,40,0.6,24,40,0.6,10756
12
+ 10,6934,13824,0.5015914351851852,24,40,0.6,24,40,0.6,11030
13
+ 11,6992,13824,0.5057870370370371,26,40,0.65,26,40,0.65,11429
14
+ 12,7294,13824,0.5276331018518519,26,40,0.65,26,40,0.65,11731
15
+ 13,7485,13824,0.5414496527777778,24,40,0.6,24,40,0.6,11581
16
+ 14,7568,13824,0.5474537037037037,26,40,0.65,26,40,0.65,12005
17
+ 15,7577,13824,0.5481047453703703,27,40,0.675,27,40,0.675,12185
18
+ 16,7678,13824,0.5554108796296297,24,40,0.6,24,40,0.6,11774
19
+ 17,7828,13824,0.5662615740740741,22,40,0.55,22,40,0.55,11582
20
+ 18,7736,13824,0.5596064814814815,19,40,0.475,19,40,0.475,10978
21
+ 19,7779,13824,0.5627170138888888,25,40,0.625,25,40,0.625,12045
22
+ 20,7895,13824,0.5711082175925926,17,40,0.425,17,40,0.425,10796
23
+ 21,7992,13824,0.578125,16,40,0.4,16,40,0.4,10722
24
+ 22,7654,13824,0.5536747685185185,7,40,0.175,7,40,0.175,8848
25
+ 23,7694,13824,0.5565682870370371,9,40,0.225,9,40,0.225,9230
26
+ 24,7722,13824,0.55859375,7,40,0.175,7,40,0.175,8916
27
+ 25,7660,13824,0.5541087962962963,7,40,0.175,7,40,0.175,8854
28
+ 26,7554,13824,0.5464409722222222,10,40,0.25,10,40,0.25,9260
29
+ 27,7655,13824,0.5537471064814815,7,40,0.175,7,40,0.175,8849
30
+ 28,7369,13824,0.5330584490740741,7,40,0.175,7,40,0.175,8563
31
+ 29,7145,13824,0.5168547453703703,9,40,0.225,9,40,0.225,8681
32
+ 30,7089,13824,0.5128038194444444,9,40,0.225,9,40,0.225,8625
33
+ 31,6965,13824,0.5038339120370371,9,40,0.225,9,40,0.225,8501
34
+ 32,6934,13824,0.5015914351851852,10,40,0.25,10,40,0.25,8640
35
+ 33,6851,13824,0.49558738425925924,10,40,0.25,10,40,0.25,8557
36
+ 34,6763,13824,0.48922164351851855,7,40,0.175,7,40,0.175,7957
37
+ 35,6488,13824,0.4693287037037037,13,40,0.325,13,40,0.325,8706
38
+ 36,6724,13824,0.48640046296296297,12,40,0.3,12,40,0.3,8772
39
+ 37,6990,13824,0.5056423611111112,12,40,0.3,12,40,0.3,9038
40
+ 38,7318,13824,0.5293692129629629,9,40,0.225,9,40,0.225,8854
41
+ 39,7990,13824,0.5779803240740741,13,40,0.325,13,40,0.325,10208
meta.json ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_id": "meta-llama/Llama-2-13b-hf",
3
+ "model_family": "llama",
4
+ "dtype": "torch.bfloat16",
5
+ "export_format": "materialized",
6
+ "rescale_alpha": 0.5,
7
+ "layers": [
8
+ {
9
+ "ffn_intermediate_size": 7789,
10
+ "num_heads": 26,
11
+ "num_key_value_heads": 26,
12
+ "head_dim": 128
13
+ },
14
+ {
15
+ "ffn_intermediate_size": 7871,
16
+ "num_heads": 12,
17
+ "num_key_value_heads": 12,
18
+ "head_dim": 128
19
+ },
20
+ {
21
+ "ffn_intermediate_size": 8537,
22
+ "num_heads": 26,
23
+ "num_key_value_heads": 26,
24
+ "head_dim": 128
25
+ },
26
+ {
27
+ "ffn_intermediate_size": 8267,
28
+ "num_heads": 26,
29
+ "num_key_value_heads": 26,
30
+ "head_dim": 128
31
+ },
32
+ {
33
+ "ffn_intermediate_size": 7714,
34
+ "num_heads": 26,
35
+ "num_key_value_heads": 26,
36
+ "head_dim": 128
37
+ },
38
+ {
39
+ "ffn_intermediate_size": 7416,
40
+ "num_heads": 22,
41
+ "num_key_value_heads": 22,
42
+ "head_dim": 128
43
+ },
44
+ {
45
+ "ffn_intermediate_size": 6990,
46
+ "num_heads": 24,
47
+ "num_key_value_heads": 24,
48
+ "head_dim": 128
49
+ },
50
+ {
51
+ "ffn_intermediate_size": 7045,
52
+ "num_heads": 25,
53
+ "num_key_value_heads": 25,
54
+ "head_dim": 128
55
+ },
56
+ {
57
+ "ffn_intermediate_size": 6849,
58
+ "num_heads": 28,
59
+ "num_key_value_heads": 28,
60
+ "head_dim": 128
61
+ },
62
+ {
63
+ "ffn_intermediate_size": 6660,
64
+ "num_heads": 24,
65
+ "num_key_value_heads": 24,
66
+ "head_dim": 128
67
+ },
68
+ {
69
+ "ffn_intermediate_size": 6934,
70
+ "num_heads": 24,
71
+ "num_key_value_heads": 24,
72
+ "head_dim": 128
73
+ },
74
+ {
75
+ "ffn_intermediate_size": 6992,
76
+ "num_heads": 26,
77
+ "num_key_value_heads": 26,
78
+ "head_dim": 128
79
+ },
80
+ {
81
+ "ffn_intermediate_size": 7294,
82
+ "num_heads": 26,
83
+ "num_key_value_heads": 26,
84
+ "head_dim": 128
85
+ },
86
+ {
87
+ "ffn_intermediate_size": 7485,
88
+ "num_heads": 24,
89
+ "num_key_value_heads": 24,
90
+ "head_dim": 128
91
+ },
92
+ {
93
+ "ffn_intermediate_size": 7568,
94
+ "num_heads": 26,
95
+ "num_key_value_heads": 26,
96
+ "head_dim": 128
97
+ },
98
+ {
99
+ "ffn_intermediate_size": 7577,
100
+ "num_heads": 27,
101
+ "num_key_value_heads": 27,
102
+ "head_dim": 128
103
+ },
104
+ {
105
+ "ffn_intermediate_size": 7678,
106
+ "num_heads": 24,
107
+ "num_key_value_heads": 24,
108
+ "head_dim": 128
109
+ },
110
+ {
111
+ "ffn_intermediate_size": 7828,
112
+ "num_heads": 22,
113
+ "num_key_value_heads": 22,
114
+ "head_dim": 128
115
+ },
116
+ {
117
+ "ffn_intermediate_size": 7736,
118
+ "num_heads": 19,
119
+ "num_key_value_heads": 19,
120
+ "head_dim": 128
121
+ },
122
+ {
123
+ "ffn_intermediate_size": 7779,
124
+ "num_heads": 25,
125
+ "num_key_value_heads": 25,
126
+ "head_dim": 128
127
+ },
128
+ {
129
+ "ffn_intermediate_size": 7895,
130
+ "num_heads": 17,
131
+ "num_key_value_heads": 17,
132
+ "head_dim": 128
133
+ },
134
+ {
135
+ "ffn_intermediate_size": 7992,
136
+ "num_heads": 16,
137
+ "num_key_value_heads": 16,
138
+ "head_dim": 128
139
+ },
140
+ {
141
+ "ffn_intermediate_size": 7654,
142
+ "num_heads": 7,
143
+ "num_key_value_heads": 7,
144
+ "head_dim": 128
145
+ },
146
+ {
147
+ "ffn_intermediate_size": 7694,
148
+ "num_heads": 9,
149
+ "num_key_value_heads": 9,
150
+ "head_dim": 128
151
+ },
152
+ {
153
+ "ffn_intermediate_size": 7722,
154
+ "num_heads": 7,
155
+ "num_key_value_heads": 7,
156
+ "head_dim": 128
157
+ },
158
+ {
159
+ "ffn_intermediate_size": 7660,
160
+ "num_heads": 7,
161
+ "num_key_value_heads": 7,
162
+ "head_dim": 128
163
+ },
164
+ {
165
+ "ffn_intermediate_size": 7554,
166
+ "num_heads": 10,
167
+ "num_key_value_heads": 10,
168
+ "head_dim": 128
169
+ },
170
+ {
171
+ "ffn_intermediate_size": 7655,
172
+ "num_heads": 7,
173
+ "num_key_value_heads": 7,
174
+ "head_dim": 128
175
+ },
176
+ {
177
+ "ffn_intermediate_size": 7369,
178
+ "num_heads": 7,
179
+ "num_key_value_heads": 7,
180
+ "head_dim": 128
181
+ },
182
+ {
183
+ "ffn_intermediate_size": 7145,
184
+ "num_heads": 9,
185
+ "num_key_value_heads": 9,
186
+ "head_dim": 128
187
+ },
188
+ {
189
+ "ffn_intermediate_size": 7089,
190
+ "num_heads": 9,
191
+ "num_key_value_heads": 9,
192
+ "head_dim": 128
193
+ },
194
+ {
195
+ "ffn_intermediate_size": 6965,
196
+ "num_heads": 9,
197
+ "num_key_value_heads": 9,
198
+ "head_dim": 128
199
+ },
200
+ {
201
+ "ffn_intermediate_size": 6934,
202
+ "num_heads": 10,
203
+ "num_key_value_heads": 10,
204
+ "head_dim": 128
205
+ },
206
+ {
207
+ "ffn_intermediate_size": 6851,
208
+ "num_heads": 10,
209
+ "num_key_value_heads": 10,
210
+ "head_dim": 128
211
+ },
212
+ {
213
+ "ffn_intermediate_size": 6763,
214
+ "num_heads": 7,
215
+ "num_key_value_heads": 7,
216
+ "head_dim": 128
217
+ },
218
+ {
219
+ "ffn_intermediate_size": 6488,
220
+ "num_heads": 13,
221
+ "num_key_value_heads": 13,
222
+ "head_dim": 128
223
+ },
224
+ {
225
+ "ffn_intermediate_size": 6724,
226
+ "num_heads": 12,
227
+ "num_key_value_heads": 12,
228
+ "head_dim": 128
229
+ },
230
+ {
231
+ "ffn_intermediate_size": 6990,
232
+ "num_heads": 12,
233
+ "num_key_value_heads": 12,
234
+ "head_dim": 128
235
+ },
236
+ {
237
+ "ffn_intermediate_size": 7318,
238
+ "num_heads": 9,
239
+ "num_key_value_heads": 9,
240
+ "head_dim": 128
241
+ },
242
+ {
243
+ "ffn_intermediate_size": 7990,
244
+ "num_heads": 13,
245
+ "num_key_value_heads": 13,
246
+ "head_dim": 128
247
+ }
248
+ ]
249
+ }
provenance.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_model": "meta-llama/Llama-2-13b-hf",
3
+ "method": "GRASPrune",
4
+ "producer": "original methods/GRASPrune pruning pipeline",
5
+ "method_repository": "https://github.com/ZiY-Wang/GRASPrune",
6
+ "method_paper": "https://arxiv.org/abs/2604.19398",
7
+ "upstream_source_revision": "666f4f04ec9e5e3218904df4d0935841bbd570fc",
8
+ "pruning_ratio": 0.5,
9
+ "keep_ratio": 0.5,
10
+ "dtype": "torch.bfloat16",
11
+ "export_format": "materialized",
12
+ "rescale_alpha": 0.5,
13
+ "weight_file": "pruned_state_dict.safetensors",
14
+ "weight_size_bytes": 13339157792,
15
+ "weight_sha256": "2b799eed9589316d580af59b898403f1638583eaa88c25756d44419cc2b4d63b",
16
+ "downstream_evaluation_only": "new_method_2"
17
+ }
pruned_state_dict.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b799eed9589316d580af59b898403f1638583eaa88c25756d44419cc2b4d63b
3
+ size 13339157792