lapp0 commited on
Commit
1fef0b3
·
verified ·
1 Parent(s): 6f0a841

End of training

Browse files
README.md ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: gpt2
3
+ datasets:
4
+ - wikimedia/wikipedia
5
+ library_name: Distily
6
+ license: mit
7
+ tags:
8
+ - bitnet
9
+ - 1.58b
10
+ - generated_from_trainer
11
+ model-index:
12
+ - name: distily_multi_experiment
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**: 124,439,808
38
+ - **Data Type (dtype)**: torch.bfloat16
39
+ - **Model Size**: 0.24 GB
40
+
41
+
42
+ # Evaluation Metrics Comparison
43
+
44
+ | step | epoch | enwikippl | frwikippl | loss | runtime | samples_per_second | steps_per_second | tinystoriesppl | zhwikippl |
45
+ | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
46
+ | **teacher eval** | | 43.25 | 61.25 | | | | | 11.6875 | 19.125 |
47
+ | 0 | 0 | 2130303778816.0 | 135239930216448.0 | 25.4492 | 25.2159 | 99.144 | 12.413 | 10334765056.0 | 38482906972160.0 |
48
+ | 2500 | 0.0404 | 892.0 | 6624.0 | 6.0041 | 25.2726 | 98.921 | 12.385 | 572.0 | 7200.0 |
49
+ | 5000 | 0.0808 | 372.0 | 1912.0 | 5.0307 | 25.3204 | 98.734 | 12.362 | 294.0 | 298.0 |
50
+ | 7500 | 0.1212 | 228.0 | 856.0 | 4.5171 | 25.3333 | 98.684 | 12.355 | 199.0 | 182.0 |
51
+ | 10000 | 0.1616 | 181.0 | 696.0 | 4.2020 | 25.3363 | 98.673 | 12.354 | 152.0 | 171.0 |
52
+ | 12500 | 0.2020 | 125.0 | 478.0 | 3.8242 | 25.3199 | 98.737 | 12.362 | 98.0 | 141.0 |
53
+ | 15000 | 0.2424 | 114.5 | 414.0 | 3.6365 | 25.3181 | 98.744 | 12.363 | 81.0 | 143.0 |
54
+ | 17500 | 0.2828 | 97.5 | 346.0 | 3.5083 | 25.3564 | 98.595 | 12.344 | 79.0 | 102.0 |
55
+ | 20000 | 0.3232 | 76.0 | 290.0 | 3.3324 | 25.2953 | 98.833 | 12.374 | 66.5 | 106.0 |
56
+ | 22500 | 0.3636 | 66.5 | 215.0 | 3.1472 | 25.3749 | 98.523 | 12.335 | 50.5 | 82.0 |
57
+ | 25000 | 0.4040 | 60.0 | 197.0 | 3.0655 | 25.3266 | 98.711 | 12.359 | 47.25 | 65.0 |
58
+ | 27500 | 0.4444 | 61.75 | 197.0 | 3.0053 | 25.3492 | 98.622 | 12.348 | 43.0 | 80.0 |
59
+ | 30000 | 0.4848 | 60.0 | 182.0 | 2.9949 | 25.3186 | 98.741 | 12.362 | 43.5 | 68.5 |
60
+ | 32500 | 0.5253 | 59.75 | 179.0 | 2.9704 | 25.3443 | 98.642 | 12.35 | 40.25 | 83.5 |
61
+ | 35000 | 0.5657 | 57.5 | 175.0 | 2.9129 | 25.3354 | 98.676 | 12.354 | 38.25 | 64.5 |
62
+ | 37500 | 0.6061 | 58.75 | 183.0 | 2.8906 | 25.3463 | 98.634 | 12.349 | 36.75 | 62.5 |
63
+ | 40000 | 0.6465 | 54.75 | 157.0 | 2.8612 | 25.3397 | 98.659 | 12.352 | 37.25 | 56.5 |
64
+ | 42500 | 0.6869 | 55.25 | 168.0 | 2.8460 | 25.3447 | 98.64 | 12.35 | 36.5 | 54.75 |
65
+ | 45000 | 0.7273 | 50.5 | 135.0 | 2.7442 | 25.34 | 98.658 | 12.352 | 30.125 | 42.5 |
66
+ | 47500 | 0.7677 | 50.25 | 129.0 | 2.7166 | 25.3456 | 98.637 | 12.349 | 30.75 | 39.5 |
67
+ | 50000 | 0.8081 | 49.75 | 132.0 | 2.7034 | 25.2334 | 99.075 | 12.404 | 29.5 | 41.75 |
68
+ | 52500 | 0.8485 | 48.5 | 129.0 | 2.6925 | 25.3023 | 98.805 | 12.37 | 28.875 | 37.25 |
69
+ | 55000 | 0.8889 | 48.5 | 127.5 | 2.6764 | 25.2784 | 98.898 | 12.382 | 28.25 | 34.5 |
70
+ | 57500 | 0.9293 | 48.25 | 122.0 | 2.6696 | 25.3217 | 98.729 | 12.361 | 28.25 | 33.75 |
71
+ | 60000 | 0.9697 | 48.25 | 121.5 | 2.6663 | 25.3402 | 98.657 | 12.352 | 28.0 | 33.5 |
72
+ | 61875 | 1.0 | 48.25 | 121.5 | 2.6658 | 25.2795 | 98.895 | 12.382 | 28.0 | 33.5 |
73
+
74
+ # Resource Usage Comparison
75
+
76
+ - VRAM Use: 7.7830 GB
77
+
78
+ # Distillation (Teacher -> Student) Architecture Difference:
79
+
80
+ - **Architecture**: `GPT2LMHeadModel` -> `GPT2LMHeadModel`
81
+ - **Total Parameters**: 124,439,808 -> 124,439,808
82
+ - **Data Type (dtype)**: torch.bfloat16 -> torch.bfloat16
83
+ - **Model Size**: 0.24 GB -> 0.24 GB
84
+
85
+ <details>
86
+ <summary>Module Diff Details</summary>
87
+
88
+ ```diff
89
+
90
+ ```
91
+
92
+ </details>
93
+ <br/>
94
+
95
+ # Train Dataset
96
+ Trained on 145,721,245 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
97
+
98
+ - Num Samples: `247,500`
99
+ - Subset: `20231101.en`
100
+ - Split: `train`
101
+
102
+
103
+ # Training Objective
104
+
105
+ ```
106
+ DistillationObjective(logits_loss_component=LossComponent(label=logits, weight=1, loss_fn=kl), attn_loss_component=LossComponent(label=attn, weight=5, loss_fn=cos, layer_mapper=layer-2))
107
+ ```
108
+
109
+ # Hyperparameters
110
+ The following hyperparameters were used during training:
111
+
112
+ <details>
113
+ <summary>Expand</summary>
114
+
115
+ - learning_rate: `0.0001`
116
+ - train_batch_size: `4`
117
+ - eval_batch_size: `8`
118
+ - seed: `42`
119
+ - optimizer: `Adam with betas=(0.9,0.999) and epsilon=1e-08`
120
+ - lr_scheduler_type: `linear`
121
+ - lr_scheduler_warmup_ratio: `0.5`
122
+ - num_epochs: `1.0`
123
+ - distillation_objective: `DistillationObjective(logits_loss_component=LossComponent(label=logits, weight=1, loss_fn=kl), attn_loss_component=LossComponent(label=attn, weight=5, loss_fn=cos, layer_mapper=layer-2))`
124
+ - train_embeddings: `True`
125
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7f148c97c340>`
126
+ - student_model_name_or_path: `None`
127
+ - student_config_name_or_path: `None`
128
+ - student_model_config: `None`
129
+ - reinitialize_weights: `None`
130
+ - copy_teacher_modules: `[('lm_head', False)]`
131
+ - student_model_as_bitnet: `True`
132
+ - student_model_compile: `False`
133
+ - dropout: `None`
134
+ - teacher_model_name_or_path: `gpt2`
135
+ - teacher_load_in_8bit: `False`
136
+ - teacher_load_in_4bit: `False`
137
+ - teacher_model_compile: `False`
138
+ - dataset_uri: `wikimedia/wikipedia`
139
+ - dataset_subset: `20231101.en`
140
+ - dataset_split: `train`
141
+ - dataset_column_name: `text`
142
+ - dataset_sample_size: `250000`
143
+ - dataset_test_size: `0.01`
144
+ - gradient_accumulation_steps: `1`
145
+ - weight_decay: `0.0`
146
+ - max_grad_norm: `1.0`
147
+ - warmup_ratio: `0.5`
148
+ - warmup_steps: `0`
149
+ - gradient_checkpointing: `True`
150
+
151
+ </details>
152
+ <br/>
153
+
154
+
155
+ # Framework Versions
156
+ - Distily 0.2.0
157
+ - Transformers 4.44.1
158
+ - Pytorch 2.5.0.dev20240821+cu121
159
+ - Datasets 2.21.0
config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "gpt2",
3
+ "activation_function": "gelu_new",
4
+ "architectures": [
5
+ "GPT2LMHeadModel"
6
+ ],
7
+ "attn_pdrop": 0.1,
8
+ "bos_token_id": 50256,
9
+ "embd_pdrop": 0.1,
10
+ "eos_token_id": 50256,
11
+ "initializer_range": 0.02,
12
+ "layer_norm_epsilon": 1e-05,
13
+ "model_type": "gpt2",
14
+ "n_ctx": 1024,
15
+ "n_embd": 768,
16
+ "n_head": 12,
17
+ "n_inner": null,
18
+ "n_layer": 12,
19
+ "n_positions": 1024,
20
+ "reorder_and_upcast_attn": false,
21
+ "resid_pdrop": 0.1,
22
+ "scale_attn_by_inverse_layer_idx": false,
23
+ "scale_attn_weights": true,
24
+ "summary_activation": null,
25
+ "summary_first_dropout": 0.1,
26
+ "summary_proj_to_labels": true,
27
+ "summary_type": "cls_index",
28
+ "summary_use_proj": true,
29
+ "task_specific_params": {
30
+ "text-generation": {
31
+ "do_sample": true,
32
+ "max_length": 50
33
+ }
34
+ },
35
+ "torch_dtype": "bfloat16",
36
+ "transformers_version": "4.44.1",
37
+ "use_cache": true,
38
+ "vocab_size": 50257
39
+ }
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.1"
6
+ }
logs/attn_loss_fn=cos, attn_weight=5, layer_mapper=all, projector=linear/events.out.tfevents.1724328160.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05dad35c99258461ac33fc992a31dabcba620bcf413bf373c55ea245b2e5e67d
3
+ size 29632518
logs/attn_loss_fn=cos, attn_weight=5, layer_mapper=all, projector=linear/events.out.tfevents.1724336143.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccfd2dce65e9a287d432a9dde8a01d9a70d73b8074bb3623aaae033d43a29707
3
+ size 588
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aae092078a5b402522145bad70a12befe5210fc62d5d716b43fbc4f509a106a6
3
+ size 248894656
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "pad_token": "<|endoftext|>",
5
+ "unk_token": "<|endoftext|>"
6
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "50256": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ }
12
+ },
13
+ "bos_token": "<|endoftext|>",
14
+ "clean_up_tokenization_spaces": true,
15
+ "eos_token": "<|endoftext|>",
16
+ "model_max_length": 1024,
17
+ "pad_token": "<|endoftext|>",
18
+ "tokenizer_class": "GPT2Tokenizer",
19
+ "unk_token": "<|endoftext|>"
20
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2fb3d5da88967f1ed5116304fea35df3e1b2c3d53282881d90add42c834afba
3
+ size 1017899144
vocab.json ADDED
The diff for this file is too large to render. See raw diff