lapp0 commited on
Commit
bd05b9a
1 Parent(s): 92467bd

End of training

Browse files
README.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: distilbert/distilgpt2
3
+ datasets:
4
+ - wikimedia/wikipedia
5
+ library_name: Distily
6
+ license: apache-2.0
7
+ tags:
8
+ - generated_from_trainer
9
+ model-index:
10
+ - name: distily_norm_distilgpt2_sweep_extended
11
+ results: []
12
+ ---
13
+
14
+
15
+ # Summary
16
+
17
+ Distilled with [Distily](https://github.com/lapp0/distily) library
18
+ using teacher model [gpt2](https://huggingface.co/gpt2)
19
+ on dataset [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia).
20
+
21
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
22
+ should probably proofread and complete it, then remove this comment.
23
+
24
+ # Model description
25
+
26
+ More information needed
27
+
28
+ # Intended uses & limitations
29
+
30
+ More information needed
31
+ -->
32
+
33
+ # Model Architecture:
34
+ - **Architecture**: `GPT2LMHeadModel`
35
+ - **Total Parameters**: 81,912,576
36
+ - **Data Type (dtype)**: torch.bfloat16
37
+ - **Model Size**: 0.16 GB
38
+
39
+
40
+ # Benchmark Metrics Comparison
41
+
42
+ | Metric | |
43
+ | :--- |
44
+
45
+ # Resource Usage Comparison
46
+
47
+ - VRAM Use: 15.6998 GB
48
+
49
+ # Distillation (Teacher -> Student) Architecture Difference:
50
+
51
+ - **Architecture**: `GPT2LMHeadModel` -> `GPT2LMHeadModel`
52
+ - **Total Parameters**: 124,439,808 -> 81,912,576
53
+ - **Data Type (dtype)**: torch.bfloat16 -> torch.bfloat16
54
+ - **Model Size**: 0.24 GB -> 0.16 GB
55
+
56
+ <details>
57
+ <summary>Module Diff Details</summary>
58
+
59
+ ```diff
60
+ --- teacher model modules
61
+ +++ student model modules
62
+ @@ -4,7 +4,7 @@
63
+ (wpe): Embedding(1024, 768)
64
+ (drop): Dropout(p=0.1, inplace=False)
65
+ (h): ModuleList(
66
+ - (0-11): 12 x GPT2Block(
67
+ + (0-5): 6 x GPT2Block(
68
+ (ln_1): LayerNorm((768,), eps=1e-05, elementwise_affine=True)
69
+ (attn): GPT2FlashAttention2(
70
+ (c_attn): Conv1D()
71
+
72
+ ```
73
+
74
+ </details>
75
+ <br/>
76
+
77
+ # Train Dataset
78
+ Trained on 521,346,447 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
79
+
80
+ - Num Samples: `990,000`
81
+ - Subset: `20231101.en`
82
+ - Split: `train`
83
+
84
+
85
+ # Training Objective
86
+
87
+ ```
88
+ 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, norm=layernorm_teacher_only, projector=orthogonal))
89
+ ```
90
+
91
+ # Hyperparameters
92
+ The following hyperparameters were used during training:
93
+
94
+ <details>
95
+ <summary>Expand</summary>
96
+
97
+ - learning_rate: `0.0002`
98
+ - train_batch_size: `16`
99
+ - eval_batch_size: `8`
100
+ - seed: `42`
101
+ - optimizer: `Adam with betas=(0.9,0.999) and epsilon=1e-08`
102
+ - lr_scheduler_type: `polynomial`
103
+ - num_epochs: `1.0`
104
+ - 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, norm=layernorm_teacher_only, projector=orthogonal))`
105
+ - train_embeddings: `True`
106
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7fc354bdc1c0>`
107
+ - student_model_name_or_path: `None`
108
+ - student_config_name_or_path: `distilbert/distilgpt2`
109
+ - student_model_config: `None`
110
+ - reinitialize_weights: `None`
111
+ - copy_teacher_modules: `[('lm_head', False)]`
112
+ - student_model_as_bitnet: `False`
113
+ - dropout: `None`
114
+ - teacher_model_name_or_path: `gpt2`
115
+ - teacher_load_in_8bit: `False`
116
+ - teacher_load_in_4bit: `False`
117
+ - dataset_uri: `wikimedia/wikipedia`
118
+ - dataset_subset: `20231101.en`
119
+ - dataset_split: `train`
120
+ - dataset_column_name: `text`
121
+ - dataset_sample_size: `1000000`
122
+ - dataset_test_size: `0.01`
123
+ - gradient_accumulation_steps: `1`
124
+ - weight_decay: `0.0`
125
+ - max_grad_norm: `1.0`
126
+ - warmup_ratio: `0`
127
+ - warmup_steps: `0`
128
+ - gradient_checkpointing: `True`
129
+
130
+ </details>
131
+ <br/>
132
+
133
+
134
+ # Framework Versions
135
+ - Distily 0.4.1
136
+ - Transformers 4.44.1
137
+ - Pytorch 2.4.0+cu121
138
+ - 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
config.json ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "distilbert/distilgpt2",
3
+ "_num_labels": 1,
4
+ "activation_function": "gelu_new",
5
+ "architectures": [
6
+ "GPT2LMHeadModel"
7
+ ],
8
+ "attn_pdrop": 0.1,
9
+ "bos_token_id": 50256,
10
+ "embd_pdrop": 0.1,
11
+ "eos_token_id": 50256,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "label2id": {
17
+ "LABEL_0": 0
18
+ },
19
+ "layer_norm_epsilon": 1e-05,
20
+ "model_type": "gpt2",
21
+ "n_ctx": 1024,
22
+ "n_embd": 768,
23
+ "n_head": 12,
24
+ "n_inner": null,
25
+ "n_layer": 6,
26
+ "n_positions": 1024,
27
+ "reorder_and_upcast_attn": false,
28
+ "resid_pdrop": 0.1,
29
+ "scale_attn_by_inverse_layer_idx": false,
30
+ "scale_attn_weights": true,
31
+ "summary_activation": null,
32
+ "summary_first_dropout": 0.1,
33
+ "summary_proj_to_labels": true,
34
+ "summary_type": "cls_index",
35
+ "summary_use_proj": true,
36
+ "task_specific_params": {
37
+ "text-generation": {
38
+ "do_sample": true,
39
+ "max_length": 50
40
+ }
41
+ },
42
+ "torch_dtype": "bfloat16",
43
+ "transformers_version": "4.44.1",
44
+ "use_cache": true,
45
+ "vocab_size": 50257
46
+ }
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_norm=layernorm_teacher_only, attn_projector=orthogonal, attn_weight=5, learning_rate=0.0002, per_device_train_batch_size=16, warmup_ratio=0/events.out.tfevents.1725178578.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9511d9a2760cf0e680c1e79aae3f3c7e2bf6bca770f806b608108caf4f727542
3
+ size 29625562
logs/attn_norm=layernorm_teacher_only, attn_projector=orthogonal, attn_weight=5, learning_rate=0.0002, per_device_train_batch_size=16, warmup_ratio=0/events.out.tfevents.1725194921.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f76554078eef360227094026586dd8812aa5cb3c2c647c11898fdc008e78b9eb
3
+ size 529
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:6318f9b2822e502bfafc3ad445305539c4863f2ecd2d7f62dc8f90dbee699c24
3
+ size 163832792
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:a963627fe44f0185f6f7c2a07eb6c2ae9ad612ad008a54151f48f4ea9ec70130
3
+ size 5624
vocab.json ADDED
The diff for this file is too large to render. See raw diff