lapp0 commited on
Commit
4ccaeff
1 Parent(s): 132946a

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_attn_distilgpt2_sweep
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: 7.4176 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 226,166,457 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
79
+
80
+ - Num Samples: `396,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, 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: `4`
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, projector=orthogonal))`
105
+ - train_embeddings: `True`
106
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7f9c492b5d80>`
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: `400000`
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
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, attn_projector=orthogonal, attn_weight=5, learning_rate=0.0002, per_device_train_batch_size=4, warmup_ratio=0/events.out.tfevents.1724981639.e3f806ea38c9 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9505fa007893389af791ac3cfff7b9cee3bbacf40383a79b77f5bb8bd5136d7d
3
+ size 253