End of training
Browse files- README.md +130 -0
- benchmarks.shelve.bak +0 -0
- benchmarks.shelve.dat +0 -0
- benchmarks.shelve.dir +0 -0
- config.json +39 -0
- generation_config.json +6 -0
- logs/attn_layer_mapper=all, attn_loss_fn=raw_mse, attn_projector=mlp/events.out.tfevents.1724600288.e3f806ea38c9 +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,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_test_attn_mlp
|
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 |
+
# Benchmark Metrics Comparison
|
43 |
+
|
44 |
+
| Metric | |
|
45 |
+
| :--- |
|
46 |
+
|
47 |
+
# Resource Usage Comparison
|
48 |
+
|
49 |
+
- VRAM Use: 7.7845 GB
|
50 |
+
|
51 |
+
# Distillation (Teacher -> Student) Architecture Difference:
|
52 |
+
|
53 |
+
- **Architecture**: `GPT2LMHeadModel` -> `GPT2LMHeadModel`
|
54 |
+
- **Total Parameters**: 124,439,808 -> 124,439,808
|
55 |
+
- **Data Type (dtype)**: torch.bfloat16 -> torch.bfloat16
|
56 |
+
- **Model Size**: 0.24 GB -> 0.24 GB
|
57 |
+
|
58 |
+
<details>
|
59 |
+
<summary>Module Diff Details</summary>
|
60 |
+
|
61 |
+
```diff
|
62 |
+
|
63 |
+
```
|
64 |
+
|
65 |
+
</details>
|
66 |
+
<br/>
|
67 |
+
|
68 |
+
# Train Dataset
|
69 |
+
Trained on 145,738,108 tokens from the [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) dataset.
|
70 |
+
|
71 |
+
- Num Samples: `247,500`
|
72 |
+
- Subset: `20231101.en`
|
73 |
+
- Split: `train`
|
74 |
+
|
75 |
+
|
76 |
+
# Training Objective
|
77 |
+
|
78 |
+
```
|
79 |
+
DistillationObjective(logits_loss_component=LossComponent(label=logits, weight=1, loss_fn=kl), attn_loss_component=LossComponent(label=attn, weight=25.0, loss_fn=raw_mse, layer_mapper=all, projector=mlp))
|
80 |
+
```
|
81 |
+
|
82 |
+
# Hyperparameters
|
83 |
+
The following hyperparameters were used during training:
|
84 |
+
|
85 |
+
<details>
|
86 |
+
<summary>Expand</summary>
|
87 |
+
|
88 |
+
- learning_rate: `0.0001`
|
89 |
+
- train_batch_size: `4`
|
90 |
+
- eval_batch_size: `8`
|
91 |
+
- seed: `42`
|
92 |
+
- optimizer: `Adam with betas=(0.9,0.999) and epsilon=1e-08`
|
93 |
+
- lr_scheduler_type: `cosine_with_min_lr`
|
94 |
+
- lr_scheduler_warmup_ratio: `0.5`
|
95 |
+
- num_epochs: `1.0`
|
96 |
+
- distillation_objective: `DistillationObjective(logits_loss_component=LossComponent(label=logits, weight=1, loss_fn=kl), attn_loss_component=LossComponent(label=attn, weight=25.0, loss_fn=raw_mse, layer_mapper=all, projector=mlp))`
|
97 |
+
- train_embeddings: `True`
|
98 |
+
- lr_scheduler: `<torch.optim.lr_scheduler.LambdaLR object at 0x7fde37bf8df0>`
|
99 |
+
- student_model_name_or_path: `None`
|
100 |
+
- student_config_name_or_path: `None`
|
101 |
+
- student_model_config: `None`
|
102 |
+
- reinitialize_weights: `None`
|
103 |
+
- copy_teacher_modules: `[('lm_head', False)]`
|
104 |
+
- student_model_as_bitnet: `True`
|
105 |
+
- dropout: `None`
|
106 |
+
- teacher_model_name_or_path: `gpt2`
|
107 |
+
- teacher_load_in_8bit: `False`
|
108 |
+
- teacher_load_in_4bit: `False`
|
109 |
+
- dataset_uri: `wikimedia/wikipedia`
|
110 |
+
- dataset_subset: `20231101.en`
|
111 |
+
- dataset_split: `train`
|
112 |
+
- dataset_column_name: `text`
|
113 |
+
- dataset_sample_size: `250000`
|
114 |
+
- dataset_test_size: `0.01`
|
115 |
+
- gradient_accumulation_steps: `1`
|
116 |
+
- weight_decay: `0.0`
|
117 |
+
- max_grad_norm: `1.0`
|
118 |
+
- warmup_ratio: `0.5`
|
119 |
+
- warmup_steps: `0`
|
120 |
+
- gradient_checkpointing: `True`
|
121 |
+
|
122 |
+
</details>
|
123 |
+
<br/>
|
124 |
+
|
125 |
+
|
126 |
+
# Framework Versions
|
127 |
+
- Distily 0.3.0
|
128 |
+
- Transformers 4.44.1
|
129 |
+
- Pytorch 2.4.0+cu121
|
130 |
+
- 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,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.1",
|
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.1"
|
6 |
+
}
|
logs/attn_layer_mapper=all, attn_loss_fn=raw_mse, attn_projector=mlp/events.out.tfevents.1724600288.e3f806ea38c9
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:859c4bb2bcf29bc0983cdb184f1a994342ab7503e6e3bafc3ce538af92dfeba4
|
3 |
+
size 29625273
|
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:8e9faae978a05408ab2bfd92ac4c4c80c628da9b54adbbb2d5b7be826c17ebf9
|
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:2cb326353387e09fd1fb6f2a6c9d3c5718471b4d4551bccf34af78705979a2e7
|
3 |
+
size 5432
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|