lapp0 commited on
Commit
7c01e5b
1 Parent(s): 71feede

End of training

Browse files
README.md CHANGED
@@ -1,7 +1,9 @@
1
  ---
2
- library_name: transformers
3
- license: apache-2.0
4
  base_model: distilbert/distilgpt2
 
 
 
 
5
  tags:
6
  - generated_from_trainer
7
  model-index:
@@ -9,50 +11,126 @@ model-index:
9
  results: []
10
  ---
11
 
12
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
- should probably proofread and complete it, then remove this comment. -->
14
 
15
- # distily_validate_extra_grad_stats
16
 
17
- This model is a fine-tuned version of [distilbert/distilgpt2](https://huggingface.co/distilbert/distilgpt2) on an unknown dataset.
18
- It achieves the following results on the evaluation set:
19
- - Loss: 1.7150
 
 
 
20
 
21
- ## Model description
22
 
23
  More information needed
24
 
25
- ## Intended uses & limitations
26
 
27
  More information needed
 
28
 
29
- ## Training and evaluation data
 
 
 
 
30
 
31
- More information needed
32
 
33
- ## Training procedure
34
 
35
- ### Training hyperparameters
 
36
 
37
- The following hyperparameters were used during training:
38
- - learning_rate: 0.0002
39
- - train_batch_size: 4
40
- - eval_batch_size: 8
41
- - seed: 42
42
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
43
- - lr_scheduler_type: polynomial
44
- - num_epochs: 1.0
45
 
46
- ### Training results
 
 
 
47
 
48
- | Training Loss | Epoch | Step | Validation Loss |
49
- |:-------------:|:-----:|:----:|:---------------:|
50
- | No log | 0 | 0 | 21.3700 |
51
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
- ### Framework versions
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  - Transformers 4.44.2
56
  - Pytorch 2.3.0
57
  - Datasets 2.21.0
58
- - Tokenizers 0.19.1
 
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:
 
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.4259 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 6,813,447 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
79
+
80
+ - Num Samples: `9,900`
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, 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, projector=orthogonal))`
105
+ - lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7feee8b1d330>`
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: `10000`
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.4.1
134
  - Transformers 4.44.2
135
  - Pytorch 2.3.0
136
  - Datasets 2.21.0
 
logs/attn_projector=orthogonal, attn_weight=5, extra_grad_stats=True, learning_rate=0.0002, per_device_train_batch_size=4, warmup_ratio=0/events.out.tfevents.1725293781.261a4d6fb516 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:147595160dca32431da2e8b342abb2fe84f01be7c8fd6ccdeb2c71bf1ad57cde
3
+ size 249