lapp0 commited on
Commit
9b8a399
·
verified ·
1 Parent(s): c0693b4

End of training

Browse files
README.md ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: gpt2
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_verify_update8
13
+ results: []
14
+ ---
15
+
16
+
17
+ # Summary
18
+
19
+ Distilled with [Distily](https://github.com/lapp0/distily) library
20
+ using teacher model [gpt2](https://huggingface.co/gpt2)
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**: `GPT2LMHeadModel`
37
+ - **Total Parameters**: 81,912,576
38
+ - **Data Type (dtype)**: torch.bfloat16
39
+ - **Model Size**: 0.16 GB
40
+
41
+ <details>
42
+ <summary>Student Model Details</summary>
43
+
44
+ ```
45
+ GPT2LMHeadModel(
46
+ (transformer): GPT2Model(
47
+ (wte): Embedding(50257, 768)
48
+ (wpe): Embedding(1024, 768)
49
+ (drop): Dropout(p=0.1, inplace=False)
50
+ (h): ModuleList(
51
+ (0-5): 6 x GPT2Block(
52
+ (ln_1): LayerNorm((768,), eps=1e-05, elementwise_affine=True)
53
+ (attn): GPT2FlashAttention2(
54
+ (c_attn): Conv1D()
55
+ (c_proj): Conv1D()
56
+ (attn_dropout): Dropout(p=0.1, inplace=False)
57
+ (resid_dropout): Dropout(p=0.1, inplace=False)
58
+ )
59
+ (ln_2): LayerNorm((768,), eps=1e-05, elementwise_affine=True)
60
+ (mlp): GPT2MLP(
61
+ (c_fc): Conv1D()
62
+ (c_proj): Conv1D()
63
+ (act): NewGELUActivation()
64
+ (dropout): Dropout(p=0.1, inplace=False)
65
+ )
66
+ )
67
+ )
68
+ (ln_f): LayerNorm((768,), eps=1e-05, elementwise_affine=True)
69
+ )
70
+ (lm_head): Linear(in_features=768, out_features=50257, bias=False)
71
+ )
72
+ ```
73
+
74
+ </details>
75
+ <br/>
76
+
77
+
78
+
79
+ # Resource Usage
80
+
81
+ - Max Train VRAM Use: 15.7096 GB
82
+ - Available VRAM: 23.6497 GB
83
+ - GPUs: NVIDIA GeForce RTX 4090
84
+ - CPUs: 28
85
+ - CPU Memory: 62.6429 GB
86
+ - CPU Memory Bandwidth: 700 GB/s
87
+
88
+ # Distillation (Teacher -> Student) Architecture Difference:
89
+
90
+ - **Architecture**: `GPT2LMHeadModel` -> `GPT2LMHeadModel`
91
+ - **Total Parameters**: 124,439,808 -> 81,912,576
92
+ - **Data Type (dtype)**: torch.bfloat16 -> torch.bfloat16
93
+ - **Model Size**: 0.24 GB -> 0.16 GB
94
+
95
+ <details>
96
+ <summary>Module Diff Details</summary>
97
+
98
+ ```diff
99
+ --- teacher model modules
100
+ +++ student model modules
101
+ @@ -4,7 +4,7 @@
102
+ (wpe): Embedding(1024, 768)
103
+ (drop): Dropout(p=0.1, inplace=False)
104
+ (h): ModuleList(
105
+ - (0-11): 12 x GPT2Block(
106
+ + (0-5): 6 x GPT2Block(
107
+ (ln_1): LayerNorm((768,), eps=1e-05, elementwise_affine=True)
108
+ (attn): GPT2FlashAttention2(
109
+ (c_attn): Conv1D()
110
+
111
+ ```
112
+
113
+ </details>
114
+ <br/>
115
+
116
+ # Train Dataset
117
+ Trained on 3,221,571 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
118
+
119
+ - Num Samples: `3,960`
120
+ - Subset: `20231101.en`
121
+ - Split: `train`
122
+
123
+
124
+ # Training Objective
125
+
126
+ ```
127
+ DistillationObjective(logits_loss_component=LossComponent(label=logits, weight=1, loss_fn=kl), attn_loss_component=LossComponent(label=attn, weight=5.0, loss_fn=raw_mse, layer_mapper=layer-2, norm=layernorm_teacher_only_affine, projector=orthogonal))
128
+ ```
129
+
130
+ # Hyperparameters
131
+ The following hyperparameters were used during training:
132
+
133
+ <details>
134
+ <summary>Expand</summary>
135
+
136
+ - learning_rate: `0.0002`
137
+ - train_batch_size: `16`
138
+ - eval_batch_size: `8`
139
+ - seed: `42`
140
+ - optimizer: `Adam with betas=(0.9,0.999) and epsilon=1e-08`
141
+ - lr_scheduler_type: `polynomial`
142
+ - num_epochs: `1.0`
143
+ - distillation_objective: `DistillationObjective(logits_loss_component=LossComponent(label=logits, weight=1, loss_fn=kl), attn_loss_component=LossComponent(label=attn, weight=5.0, loss_fn=raw_mse, layer_mapper=layer-2, norm=layernorm_teacher_only_affine, projector=orthogonal))`
144
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7feff1761870>`
145
+ - student_model_name_or_path: `None`
146
+ - student_config_name_or_path: `distilbert/distilgpt2`
147
+ - student_model_config: `None`
148
+ - reinitialize_weights: `None`
149
+ - copy_teacher_modules: `[('lm_head', False)]`
150
+ - student_model_as_bitnet: `False`
151
+ - teacher_model_name_or_path: `gpt2`
152
+ - teacher_load_in_8bit: `False`
153
+ - teacher_load_in_4bit: `False`
154
+ - dataset_uri: `wikimedia/wikipedia`
155
+ - dataset_subset: `20231101.en`
156
+ - dataset_split: `train`
157
+ - dataset_column_name: `text`
158
+ - dataset_sample_size: `4000`
159
+ - dataset_test_size: `0.01`
160
+ - gradient_accumulation_steps: `1`
161
+ - weight_decay: `0.0`
162
+ - max_grad_norm: `1.0`
163
+ - warmup_ratio: `0.0`
164
+ - warmup_steps: `0`
165
+ - gradient_checkpointing: `True`
166
+
167
+ </details>
168
+ <br/>
169
+
170
+
171
+ # Framework Versions
172
+ - Distily 0.5.0
173
+ - Transformers 4.44.2
174
+ - Pytorch 2.3.0
175
+ - 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,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 50256,
4
+ "eos_token_id": 50256,
5
+ "transformers_version": "4.44.2"
6
+ }
logs/events.out.tfevents.1725467645.261a4d6fb516 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:169ce2f1d7fe0b4e6313e9ab04683fccd502cc4fb8cccff9b6dc9e1f9c3889a3
3
+ size 249