End of training
Browse files- README.md +159 -0
- config.json +39 -0
- generation_config.json +6 -0
- logs/attn_loss_fn=raw_mse, attn_weight=5, layer_mapper=all, projector=miles/events.out.tfevents.1724395676.3cea3f0a07ac +3 -0
- logs/attn_loss_fn=raw_mse, attn_weight=5, layer_mapper=all, projector=miles/events.out.tfevents.1724411041.3cea3f0a07ac +3 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- special_tokens_map.json +6 -0
- tokenizer.json +0 -0
- tokenizer_config.json +20 -0
- training_args.bin +3 -0
- vocab.json +0 -0
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_miles_projector_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** | | 36.25 | 77.0 | | | | | 11.75 | 21.375 |
|
47 |
+
| 0 | 0 | 1486058684416.0 | 34084860461056.0 | 20.1302 | 40.0525 | 62.418 | 7.815 | 2281701376.0 | 15874199126016.0 |
|
48 |
+
| 2500 | 0.0404 | 756.0 | 3440.0 | 2.4552 | 40.0832 | 62.37 | 7.809 | 404.0 | 1560.0 |
|
49 |
+
| 5000 | 0.0808 | 352.0 | 1288.0 | 1.7734 | 42.1208 | 59.353 | 7.431 | 246.0 | 290.0 |
|
50 |
+
| 7500 | 0.1212 | 227.0 | 688.0 | 1.4859 | 44.2818 | 56.457 | 7.068 | 177.0 | 214.0 |
|
51 |
+
| 10000 | 0.1616 | 176.0 | 624.0 | 1.2995 | 40.5384 | 61.67 | 7.721 | 129.0 | 225.0 |
|
52 |
+
| 12500 | 0.2020 | 122.0 | 446.0 | 1.0558 | 43.2882 | 57.752 | 7.231 | 93.5 | 231.0 |
|
53 |
+
| 15000 | 0.2424 | 102.5 | 412.0 | 0.9530 | 40.2067 | 62.179 | 7.785 | 80.0 | 175.0 |
|
54 |
+
| 17500 | 0.2828 | 92.0 | 342.0 | 0.8613 | 42.4322 | 58.918 | 7.376 | 77.5 | 165.0 |
|
55 |
+
| 20000 | 0.3232 | 78.0 | 266.0 | 0.8054 | 42.4876 | 58.841 | 7.367 | 64.5 | 110.0 |
|
56 |
+
| 22500 | 0.3636 | 66.5 | 228.0 | 0.6962 | 40.1977 | 62.193 | 7.787 | 58.0 | 185.0 |
|
57 |
+
| 25000 | 0.4040 | 64.0 | 200.0 | 0.6565 | 42.3516 | 59.03 | 7.391 | 52.75 | 115.5 |
|
58 |
+
| 27500 | 0.4444 | 61.25 | 190.0 | 0.6213 | 42.9602 | 58.193 | 7.286 | 50.75 | 101.0 |
|
59 |
+
| 30000 | 0.4848 | 62.75 | 211.0 | 0.6318 | 44.9016 | 55.677 | 6.971 | 50.25 | 184.0 |
|
60 |
+
| 32500 | 0.5253 | 57.5 | 194.0 | 0.6184 | 43.9215 | 56.92 | 7.126 | 50.25 | 89.5 |
|
61 |
+
| 35000 | 0.5657 | 57.0 | 177.0 | 0.5768 | 42.6805 | 58.575 | 7.334 | 44.0 | 107.0 |
|
62 |
+
| 37500 | 0.6061 | 54.5 | 168.0 | 0.5596 | 44.1546 | 56.619 | 7.089 | 43.5 | 81.0 |
|
63 |
+
| 40000 | 0.6465 | 54.0 | 159.0 | 0.5345 | 42.0172 | 59.499 | 7.449 | 42.75 | 77.5 |
|
64 |
+
| 42500 | 0.6869 | 53.5 | 169.0 | 0.5260 | 41.7231 | 59.919 | 7.502 | 39.5 | 61.25 |
|
65 |
+
| 45000 | 0.7273 | 48.5 | 152.0 | 0.4414 | 40.3349 | 61.981 | 7.76 | 35.25 | 50.25 |
|
66 |
+
| 47500 | 0.7677 | 47.25 | 142.0 | 0.4216 | 41.3204 | 60.503 | 7.575 | 34.5 | 44.25 |
|
67 |
+
| 50000 | 0.8081 | 46.5 | 137.0 | 0.4085 | 43.1383 | 57.953 | 7.256 | 32.25 | 41.25 |
|
68 |
+
| 52500 | 0.8485 | 46.0 | 141.0 | 0.4018 | 42.0641 | 59.433 | 7.441 | 33.0 | 38.75 |
|
69 |
+
| 55000 | 0.8889 | 45.0 | 138.0 | 0.3859 | 40.373 | 61.923 | 7.753 | 31.875 | 35.75 |
|
70 |
+
| 57500 | 0.9293 | 44.75 | 133.0 | 0.3810 | 40.3972 | 61.885 | 7.748 | 31.625 | 36.0 |
|
71 |
+
| 60000 | 0.9697 | 44.75 | 132.0 | 0.3782 | 42.2203 | 59.213 | 7.413 | 31.625 | 35.5 |
|
72 |
+
| 61875 | 1.0 | 44.75 | 133.0 | 0.3778 | 44.5224 | 56.151 | 7.03 | 31.5 | 35.5 |
|
73 |
+
|
74 |
+
# Resource Usage Comparison
|
75 |
+
|
76 |
+
- VRAM Use: 7.7831 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,697,117 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=raw_mse, 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=raw_mse, layer_mapper=layer-2))`
|
124 |
+
- train_embeddings: `True`
|
125 |
+
- lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7fd776b0cd90>`
|
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.2
|
158 |
+
- Pytorch 2.3.0
|
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.2",
|
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.2"
|
6 |
+
}
|
logs/attn_loss_fn=raw_mse, attn_weight=5, layer_mapper=all, projector=miles/events.out.tfevents.1724395676.3cea3f0a07ac
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a89f41b5d92ea9e3ea03959182b199832a495ba7ac051d7a2f1692f8bd31b899
|
3 |
+
size 13256381
|
logs/attn_loss_fn=raw_mse, attn_weight=5, layer_mapper=all, projector=miles/events.out.tfevents.1724411041.3cea3f0a07ac
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b1fbcec31a113737fce76ab47a76e89b622e73286b23af7704141063db26e6ea
|
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:f2531a692162123967b5d24d12b37d82a9bbd53d73017eac4c308fdb3facc215
|
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:05c1864796c5f7a1f6f1a76483496e41a2043c702121e4fe9fc13c75651ea82d
|
3 |
+
size 5368
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|