lapp0 commited on
Commit
4f8883f
1 Parent(s): 9b2e13a

End of training

Browse files
README.md ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: HuggingFaceTB/SmolLM-135M
3
+ datasets:
4
+ - wikimedia/wikipedia
5
+ library_name: Distily
6
+ license: creativeml-openrail-m
7
+ tags:
8
+ - generated_from_trainer
9
+ - Distily
10
+ base_model_relation: finetune
11
+ model-index:
12
+ - name: distily_learning_params
13
+ results: []
14
+ ---
15
+
16
+
17
+ # Summary
18
+
19
+ Distilled with [Distily](https://github.com/lapp0/distily) library
20
+ using teacher model [HuggingFaceTB/SmolLM-135M](https://huggingface.co/HuggingFaceTB/SmolLM-135M)
21
+ on dataset [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia).
22
+
23
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
24
+ should probably proofread and complete it, then remove this comment.
25
+
26
+ # Model description
27
+
28
+ More information needed
29
+
30
+ # Intended uses & limitations
31
+
32
+ More information needed
33
+ -->
34
+
35
+ # Model Architecture:
36
+ - **Architecture**: `LlamaForCausalLM`
37
+ - **Total Parameters**: 81,413,568
38
+ - **Data Type (dtype)**: torch.float32
39
+ - **Model Size**: 0.30 GB
40
+
41
+ <details>
42
+ <summary>Student Model Details</summary>
43
+
44
+ ```
45
+ LlamaForCausalLM(
46
+ (model): LlamaModel(
47
+ (embed_tokens): Embedding(49152, 576)
48
+ (layers): ModuleList(
49
+ (0-14): 15 x LlamaDecoderLayer(
50
+ (self_attn): LlamaSdpaAttention(
51
+ (q_proj): Linear(in_features=576, out_features=576, bias=False)
52
+ (k_proj): Linear(in_features=576, out_features=192, bias=False)
53
+ (v_proj): Linear(in_features=576, out_features=192, bias=False)
54
+ (o_proj): Linear(in_features=576, out_features=576, bias=False)
55
+ (rotary_emb): LlamaRotaryEmbedding()
56
+ )
57
+ (mlp): LigerSwiGLUMLP(
58
+ (gate_proj): Linear(in_features=576, out_features=1536, bias=False)
59
+ (up_proj): Linear(in_features=576, out_features=1536, bias=False)
60
+ (down_proj): Linear(in_features=1536, out_features=576, bias=False)
61
+ )
62
+ (input_layernorm): LigerRMSNorm((576,), eps=1e-05, offset=0.0)
63
+ (post_attention_layernorm): LigerRMSNorm((576,), eps=1e-05, offset=0.0)
64
+ )
65
+ )
66
+ (norm): LigerRMSNorm((576,), eps=1e-05, offset=0.0)
67
+ (rotary_emb): LlamaRotaryEmbedding()
68
+ )
69
+ (lm_head): Linear(in_features=576, out_features=49152, bias=False)
70
+ )
71
+ ```
72
+
73
+ </details>
74
+ <br/>
75
+
76
+
77
+
78
+ # Resource Usage
79
+
80
+ - Max Train VRAM Use: 13.1269 GB
81
+ - Available VRAM: 23.4329 GB
82
+ - GPUs:
83
+ - 1x NVIDIA GeForce RTX 4090
84
+ - CPUs: 64
85
+ - CPU Memory: 251.7299 GB
86
+ - CPU Memory Bandwidth: 1600 GB/s
87
+
88
+ # Distillation (Teacher -> Student) Architecture Difference:
89
+
90
+ - **Architecture**: `LlamaForCausalLM` -> `LlamaForCausalLM`
91
+ - **Total Parameters**: 134,515,008 -> 81,413,568
92
+ - **Data Type (dtype)**: torch.float32 -> torch.float32
93
+ - **Model Size**: 0.25 GB -> 0.30 GB
94
+
95
+ <details>
96
+ <summary>Module Diff Details</summary>
97
+
98
+ ```diff
99
+ --- teacher model modules
100
+ +++ student model modules
101
+ @@ -2,7 +2,7 @@
102
+ (model): LlamaModel(
103
+ (embed_tokens): Embedding(49152, 576)
104
+ (layers): ModuleList(
105
+ - (0-29): 30 x LlamaDecoderLayer(
106
+ + (0-14): 15 x LlamaDecoderLayer(
107
+ (self_attn): LlamaSdpaAttention(
108
+ (q_proj): Linear(in_features=576, out_features=576, bias=False)
109
+ (k_proj): Linear(in_features=576, out_features=192, bias=False)
110
+ @@ -10,17 +10,16 @@
111
+ (o_proj): Linear(in_features=576, out_features=576, bias=False)
112
+ (rotary_emb): LlamaRotaryEmbedding()
113
+ )
114
+ - (mlp): LlamaMLP(
115
+ + (mlp): LigerSwiGLUMLP(
116
+ (gate_proj): Linear(in_features=576, out_features=1536, bias=False)
117
+ (up_proj): Linear(in_features=576, out_features=1536, bias=False)
118
+ (down_proj): Linear(in_features=1536, out_features=576, bias=False)
119
+ - (act_fn): SiLU()
120
+ )
121
+ - (input_layernorm): LlamaRMSNorm((576,), eps=1e-05)
122
+ - (post_attention_layernorm): LlamaRMSNorm((576,), eps=1e-05)
123
+ + (input_layernorm): LigerRMSNorm((576,), eps=1e-05, offset=0.0)
124
+ + (post_attention_layernorm): LigerRMSNorm((576,), eps=1e-05, offset=0.0)
125
+ )
126
+ )
127
+ - (norm): LlamaRMSNorm((576,), eps=1e-05)
128
+ + (norm): LigerRMSNorm((576,), eps=1e-05, offset=0.0)
129
+ (rotary_emb): LlamaRotaryEmbedding()
130
+ )
131
+ (lm_head): Linear(in_features=576, out_features=49152, bias=False)
132
+
133
+ ```
134
+
135
+ </details>
136
+ <br/>
137
+
138
+ # Train Dataset
139
+ Trained on 553,289,312 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
140
+
141
+ - Num Samples: `998,000`
142
+ - Subset: `20231101.en`
143
+ - Split: `train`
144
+
145
+
146
+ # Training Objective
147
+
148
+ ```
149
+ DistillationObjective(
150
+ logits_loss_component=LossComponent(
151
+ weight=1,
152
+ loss_fn='kl'
153
+ ),
154
+ hs_loss_component=LossComponent(
155
+ weight=0
156
+ ),
157
+ attn_loss_component=LossComponent(
158
+ weight=0
159
+ )
160
+ )
161
+ ```
162
+
163
+ # Hyperparameters
164
+ The following hyperparameters were used during training:
165
+
166
+ <details>
167
+ <summary>Expand</summary>
168
+
169
+ - learning_rate: `0.0001`
170
+ - train_batch_size: `8`
171
+ - eval_batch_size: `2`
172
+ - seed: `42`
173
+ - optimizer: `Adam with betas=(0.9,0.999) and epsilon=1e-08`
174
+ - lr_scheduler_type: `polynomial`
175
+ - num_epochs: `1.0`
176
+ - distillation_objective: `DistillationObjective(
177
+ logits_loss_component=LossComponent(
178
+ weight=1,
179
+ loss_fn='kl'
180
+ ),
181
+ hs_loss_component=LossComponent(
182
+ weight=0
183
+ ),
184
+ attn_loss_component=LossComponent(
185
+ weight=0
186
+ )
187
+ )`
188
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x777e85f7fee0>`
189
+ - student_model_name_or_path: `None`
190
+ - student_config_name_or_path: `None`
191
+ - student_model_config: `{'num_hidden_layers': 15}`
192
+ - reinitialize_weights: `None`
193
+ - copy_teacher_modules: `[('lm_head', False)]`
194
+ - student_model_as_bitnet: `False`
195
+ - student_use_liger_kernel: `True`
196
+ - teacher_model_name_or_path: `HuggingFaceTB/SmolLM-135M`
197
+ - teacher_load_in_8bit: `False`
198
+ - teacher_load_in_4bit: `False`
199
+ - dataset_uri: `wikimedia/wikipedia`
200
+ - dataset_subset: `20231101.en`
201
+ - dataset_split: `train`
202
+ - dataset_column_name: `text`
203
+ - dataset_sample_size: `1000000`
204
+ - dataset_max_seq_length: `1024`
205
+ - dataset_test_size: `0.002`
206
+ - dataset_shuffle: `False`
207
+ - dataset_shuffle_seed: `42`
208
+ - dataset_trust_remote_code: `False`
209
+ - gradient_accumulation_steps: `1`
210
+ - weight_decay: `0.0`
211
+ - max_grad_norm: `1.0`
212
+ - warmup_ratio: `0.0`
213
+ - warmup_steps: `0`
214
+ - gradient_checkpointing: `True`
215
+
216
+ </details>
217
+ <br/>
218
+
219
+
220
+ # Framework Versions
221
+ - Distily 0.5.0
222
+ - Transformers 4.45.0.dev0
223
+ - Pytorch 2.5.0.dev20240910+cu121
224
+ - Datasets 2.21.0
benchmarks.shelve.bak ADDED
File without changes
benchmarks.shelve.dat ADDED
File without changes
benchmarks.shelve.dir ADDED
File without changes
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "transformers_version": "4.45.0.dev0",
6
+ "use_cache": false
7
+ }
logs/learning_rate=0.0001, lr_scheduler_kwargs=__power___0.7___lr_end___2e-05_, lr_scheduler_type=polynomial, per_device_train_batch_size=8/events.out.tfevents.1726627600.1c1a426a2fee ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60bfc251d038618c895f3936bea9ce3d2cf0d9c211adf48714d0c08a763cdbba
3
+ size 529