lapp0 commited on
Commit
492a2fd
1 Parent(s): 176af50

End of training

Browse files
README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_affine_distilgpt2_sweep2
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.7087 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,366,153 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=mlp))
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=mlp))`
105
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7f6d9cec8700>`
106
+ - student_model_name_or_path: `None`
107
+ - student_config_name_or_path: `distilbert/distilgpt2`
108
+ - student_model_config: `None`
109
+ - reinitialize_weights: `None`
110
+ - copy_teacher_modules: `[('lm_head', False)]`
111
+ - student_model_as_bitnet: `False`
112
+ - teacher_model_name_or_path: `gpt2`
113
+ - teacher_load_in_8bit: `False`
114
+ - teacher_load_in_4bit: `False`
115
+ - dataset_uri: `wikimedia/wikipedia`
116
+ - dataset_subset: `20231101.en`
117
+ - dataset_split: `train`
118
+ - dataset_column_name: `text`
119
+ - dataset_sample_size: `1000000`
120
+ - dataset_test_size: `0.01`
121
+ - gradient_accumulation_steps: `1`
122
+ - weight_decay: `0.0`
123
+ - max_grad_norm: `1.0`
124
+ - warmup_ratio: `0`
125
+ - warmup_steps: `0`
126
+ - gradient_checkpointing: `True`
127
+
128
+ </details>
129
+ <br/>
130
+
131
+
132
+ # Framework Versions
133
+ - Distily 0.5.0
134
+ - Transformers 4.44.1
135
+ - Pytorch 2.4.0+cu121
136
+ - 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=mlp, attn_weight=5, learning_rate=0.0002, per_device_train_batch_size=16, warmup_ratio=0/events.out.tfevents.1725398382.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:145de467095a15f363121e41756b9f3bc843197a3de5f8438f981ea959a9e100
3
+ size 1590693
logs/attn_norm=layernorm_teacher_only, attn_projector=mlp, attn_weight=5, learning_rate=0.0002, per_device_train_batch_size=16, warmup_ratio=0/events.out.tfevents.1725399446.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a4b17bfd32f0275dd243461606e1cfb4359f33d484691358930a4e135250dfd
3
+ size 31109618
logs/attn_norm=layernorm_teacher_only, attn_projector=mlp, attn_weight=5, learning_rate=0.0002, per_device_train_batch_size=16, warmup_ratio=0/events.out.tfevents.1725417403.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba0082aa08dec0e7429555bc899f04b9b738ea158315c4013ee7e7a7e7640dea
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:8b8bc8867741060375c29817a9030fc0ba98fe9caced21b7b442b89d74e64d0a
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:7f1ce721961440ac0f5789adcc223ce6f8106036c303d4a5af8d7192af2b71d0
3
+ size 5560
vocab.json ADDED
The diff for this file is too large to render. See raw diff