lapp0 commited on
Commit
fca8285
1 Parent(s): 1faf0f4

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_distsmollm_long
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.4793 GB
81
+ - Available VRAM: 23.6497 GB
82
+ - GPUs:
83
+ - 1x NVIDIA GeForce RTX 4090
84
+ - CPUs: 48
85
+ - CPU Memory: 251.5386 GB
86
+ - CPU Memory Bandwidth: 1200 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 706,573,563 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.0002`
170
+ - train_batch_size: `4`
171
+ - eval_batch_size: `2`
172
+ - seed: `42`
173
+ - gradient_accumulation_steps: `2`
174
+ - total_train_batch_size: `8`
175
+ - optimizer: `Adam with betas=(0.9,0.999) and epsilon=1e-08`
176
+ - lr_scheduler_type: `polynomial`
177
+ - num_epochs: `1.0`
178
+ - distillation_objective: `DistillationObjective(
179
+ logits_loss_component=LossComponent(
180
+ weight=1,
181
+ loss_fn='kl'
182
+ ),
183
+ hs_loss_component=LossComponent(
184
+ weight=0
185
+ ),
186
+ attn_loss_component=LossComponent(
187
+ weight=0
188
+ )
189
+ )`
190
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x718c02862f80>`
191
+ - student_model_name_or_path: `None`
192
+ - student_config_name_or_path: `None`
193
+ - student_model_config: `{'num_hidden_layers': 15}`
194
+ - reinitialize_weights: `None`
195
+ - copy_teacher_modules: `[('lm_head', False)]`
196
+ - student_model_as_bitnet: `False`
197
+ - student_use_liger_kernel: `True`
198
+ - teacher_model_name_or_path: `HuggingFaceTB/SmolLM-135M`
199
+ - teacher_load_in_8bit: `False`
200
+ - teacher_load_in_4bit: `False`
201
+ - dataset_uri: `wikimedia/wikipedia`
202
+ - dataset_subset: `20231101.en`
203
+ - dataset_split: `train`
204
+ - dataset_column_name: `text`
205
+ - dataset_sample_size: `1000000`
206
+ - dataset_test_size: `0.002`
207
+ - dataset_shuffle: `False`
208
+ - dataset_shuffle_seed: `42`
209
+ - dataset_trust_remote_code: `False`
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.44.2
223
+ - Pytorch 2.4.1+cu121
224
+ - Datasets 3.0.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.44.2",
6
+ "use_cache": false
7
+ }
logs/gradient_accumulation_steps=2, per_device_train_batch_size=4, run_name=baseline/events.out.tfevents.1726274303.7eb020c3c65f ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be86ae9c34e977e4b0ce84bc2a9f9b24ec0dd05b32fef075b9c5bb38e671ac0f
3
+ size 529