ToastyPigeon
commited on
Commit
•
b86387d
1
Parent(s):
c351d37
Training in progress, step 177, checkpoint
Browse files- checkpoint-177/README.md +202 -0
- checkpoint-177/adapter_config.json +34 -0
- checkpoint-177/adapter_model.safetensors +3 -0
- checkpoint-177/global_step177/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- checkpoint-177/global_step177/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- checkpoint-177/global_step177/zero_pp_rank_0_mp_rank_00_model_states.pt +3 -0
- checkpoint-177/global_step177/zero_pp_rank_1_mp_rank_00_model_states.pt +3 -0
- checkpoint-177/latest +1 -0
- checkpoint-177/rng_state_0.pth +3 -0
- checkpoint-177/rng_state_1.pth +3 -0
- checkpoint-177/scheduler.pt +3 -0
- checkpoint-177/special_tokens_map.json +30 -0
- checkpoint-177/tokenizer.json +0 -0
- checkpoint-177/tokenizer.model +3 -0
- checkpoint-177/tokenizer_config.json +0 -0
- checkpoint-177/trainer_state.json +1304 -0
- checkpoint-177/training_args.bin +3 -0
- checkpoint-177/zero_to_fp32.py +604 -0
checkpoint-177/README.md
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: mistralai/Mistral-Small-Instruct-2409
|
3 |
+
library_name: peft
|
4 |
+
---
|
5 |
+
|
6 |
+
# Model Card for Model ID
|
7 |
+
|
8 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
## Model Details
|
13 |
+
|
14 |
+
### Model Description
|
15 |
+
|
16 |
+
<!-- Provide a longer summary of what this model is. -->
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
- **Developed by:** [More Information Needed]
|
21 |
+
- **Funded by [optional]:** [More Information Needed]
|
22 |
+
- **Shared by [optional]:** [More Information Needed]
|
23 |
+
- **Model type:** [More Information Needed]
|
24 |
+
- **Language(s) (NLP):** [More Information Needed]
|
25 |
+
- **License:** [More Information Needed]
|
26 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
+
|
28 |
+
### Model Sources [optional]
|
29 |
+
|
30 |
+
<!-- Provide the basic links for the model. -->
|
31 |
+
|
32 |
+
- **Repository:** [More Information Needed]
|
33 |
+
- **Paper [optional]:** [More Information Needed]
|
34 |
+
- **Demo [optional]:** [More Information Needed]
|
35 |
+
|
36 |
+
## Uses
|
37 |
+
|
38 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
+
|
40 |
+
### Direct Use
|
41 |
+
|
42 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
+
|
44 |
+
[More Information Needed]
|
45 |
+
|
46 |
+
### Downstream Use [optional]
|
47 |
+
|
48 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
+
|
50 |
+
[More Information Needed]
|
51 |
+
|
52 |
+
### Out-of-Scope Use
|
53 |
+
|
54 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
+
|
56 |
+
[More Information Needed]
|
57 |
+
|
58 |
+
## Bias, Risks, and Limitations
|
59 |
+
|
60 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Recommendations
|
65 |
+
|
66 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
+
|
68 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
+
|
70 |
+
## How to Get Started with the Model
|
71 |
+
|
72 |
+
Use the code below to get started with the model.
|
73 |
+
|
74 |
+
[More Information Needed]
|
75 |
+
|
76 |
+
## Training Details
|
77 |
+
|
78 |
+
### Training Data
|
79 |
+
|
80 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
+
|
82 |
+
[More Information Needed]
|
83 |
+
|
84 |
+
### Training Procedure
|
85 |
+
|
86 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
+
|
88 |
+
#### Preprocessing [optional]
|
89 |
+
|
90 |
+
[More Information Needed]
|
91 |
+
|
92 |
+
|
93 |
+
#### Training Hyperparameters
|
94 |
+
|
95 |
+
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
+
|
97 |
+
#### Speeds, Sizes, Times [optional]
|
98 |
+
|
99 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
+
|
101 |
+
[More Information Needed]
|
102 |
+
|
103 |
+
## Evaluation
|
104 |
+
|
105 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
+
|
107 |
+
### Testing Data, Factors & Metrics
|
108 |
+
|
109 |
+
#### Testing Data
|
110 |
+
|
111 |
+
<!-- This should link to a Dataset Card if possible. -->
|
112 |
+
|
113 |
+
[More Information Needed]
|
114 |
+
|
115 |
+
#### Factors
|
116 |
+
|
117 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
+
|
119 |
+
[More Information Needed]
|
120 |
+
|
121 |
+
#### Metrics
|
122 |
+
|
123 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
### Results
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
#### Summary
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
## Model Examination [optional]
|
136 |
+
|
137 |
+
<!-- Relevant interpretability work for the model goes here -->
|
138 |
+
|
139 |
+
[More Information Needed]
|
140 |
+
|
141 |
+
## Environmental Impact
|
142 |
+
|
143 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
+
|
145 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
+
|
147 |
+
- **Hardware Type:** [More Information Needed]
|
148 |
+
- **Hours used:** [More Information Needed]
|
149 |
+
- **Cloud Provider:** [More Information Needed]
|
150 |
+
- **Compute Region:** [More Information Needed]
|
151 |
+
- **Carbon Emitted:** [More Information Needed]
|
152 |
+
|
153 |
+
## Technical Specifications [optional]
|
154 |
+
|
155 |
+
### Model Architecture and Objective
|
156 |
+
|
157 |
+
[More Information Needed]
|
158 |
+
|
159 |
+
### Compute Infrastructure
|
160 |
+
|
161 |
+
[More Information Needed]
|
162 |
+
|
163 |
+
#### Hardware
|
164 |
+
|
165 |
+
[More Information Needed]
|
166 |
+
|
167 |
+
#### Software
|
168 |
+
|
169 |
+
[More Information Needed]
|
170 |
+
|
171 |
+
## Citation [optional]
|
172 |
+
|
173 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
+
|
175 |
+
**BibTeX:**
|
176 |
+
|
177 |
+
[More Information Needed]
|
178 |
+
|
179 |
+
**APA:**
|
180 |
+
|
181 |
+
[More Information Needed]
|
182 |
+
|
183 |
+
## Glossary [optional]
|
184 |
+
|
185 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
+
|
187 |
+
[More Information Needed]
|
188 |
+
|
189 |
+
## More Information [optional]
|
190 |
+
|
191 |
+
[More Information Needed]
|
192 |
+
|
193 |
+
## Model Card Authors [optional]
|
194 |
+
|
195 |
+
[More Information Needed]
|
196 |
+
|
197 |
+
## Model Card Contact
|
198 |
+
|
199 |
+
[More Information Needed]
|
200 |
+
### Framework versions
|
201 |
+
|
202 |
+
- PEFT 0.13.0
|
checkpoint-177/adapter_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "mistralai/Mistral-Small-Instruct-2409",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": null,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layer_replication": null,
|
10 |
+
"layers_pattern": null,
|
11 |
+
"layers_to_transform": null,
|
12 |
+
"loftq_config": {},
|
13 |
+
"lora_alpha": 32,
|
14 |
+
"lora_dropout": 0.125,
|
15 |
+
"megatron_config": null,
|
16 |
+
"megatron_core": "megatron.core",
|
17 |
+
"modules_to_save": null,
|
18 |
+
"peft_type": "LORA",
|
19 |
+
"r": 64,
|
20 |
+
"rank_pattern": {},
|
21 |
+
"revision": null,
|
22 |
+
"target_modules": [
|
23 |
+
"v_proj",
|
24 |
+
"q_proj",
|
25 |
+
"down_proj",
|
26 |
+
"k_proj",
|
27 |
+
"o_proj",
|
28 |
+
"up_proj",
|
29 |
+
"gate_proj"
|
30 |
+
],
|
31 |
+
"task_type": "CAUSAL_LM",
|
32 |
+
"use_dora": false,
|
33 |
+
"use_rslora": false
|
34 |
+
}
|
checkpoint-177/adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4aab6d525966384e299770c660bbc1a694cc435cc8f61690329aba858af9ce0a
|
3 |
+
size 763470136
|
checkpoint-177/global_step177/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4166f00acd4a8e9ab06dc98382ad3289e0df927dbb8da0e2753119f7e7ce0334
|
3 |
+
size 1152331664
|
checkpoint-177/global_step177/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0b8f1a0a6b1a7bfd07a4186f80172afd851c6291876b080d72542e8fd2ebd2bf
|
3 |
+
size 1152331664
|
checkpoint-177/global_step177/zero_pp_rank_0_mp_rank_00_model_states.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:33cbf0c931165e711e1629fc9f178eb547ef50988bed724c3cef8223b2f9d8a6
|
3 |
+
size 348711830
|
checkpoint-177/global_step177/zero_pp_rank_1_mp_rank_00_model_states.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f39a9d875f84b68190be0ac3a30bc4c3bd03257209a6d560e5e832772b46db6
|
3 |
+
size 348711830
|
checkpoint-177/latest
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
global_step177
|
checkpoint-177/rng_state_0.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:36fd52f115baab318e30a2a60b5c42cc1b1ac6875b9077a0356faa691b9a8b42
|
3 |
+
size 14512
|
checkpoint-177/rng_state_1.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e51974ac915473991dcc1935223715c4a56069ae31edec6425733676b0746ad
|
3 |
+
size 14512
|
checkpoint-177/scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f063f211035f6d0ac56b7f09a85e8cc0cf72870498c0626bd3dcf65436c13401
|
3 |
+
size 1064
|
checkpoint-177/special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
checkpoint-177/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
checkpoint-177/tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:59f95e28944c062244741268596badc900df86c7f5ded05088d2da22a7379e06
|
3 |
+
size 587583
|
checkpoint-177/tokenizer_config.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
checkpoint-177/trainer_state.json
ADDED
@@ -0,0 +1,1304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 0.612987012987013,
|
5 |
+
"eval_steps": 59,
|
6 |
+
"global_step": 177,
|
7 |
+
"is_hyper_param_search": false,
|
8 |
+
"is_local_process_zero": true,
|
9 |
+
"is_world_process_zero": true,
|
10 |
+
"log_history": [
|
11 |
+
{
|
12 |
+
"epoch": 0.003463203463203463,
|
13 |
+
"grad_norm": 0.26726240342863167,
|
14 |
+
"learning_rate": 5e-06,
|
15 |
+
"loss": 1.8182,
|
16 |
+
"step": 1
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"epoch": 0.003463203463203463,
|
20 |
+
"eval_loss": 2.1284499168395996,
|
21 |
+
"eval_runtime": 293.5739,
|
22 |
+
"eval_samples_per_second": 0.341,
|
23 |
+
"eval_steps_per_second": 0.17,
|
24 |
+
"step": 1
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.006926406926406926,
|
28 |
+
"grad_norm": 0.20034662456059837,
|
29 |
+
"learning_rate": 1e-05,
|
30 |
+
"loss": 1.9101,
|
31 |
+
"step": 2
|
32 |
+
},
|
33 |
+
{
|
34 |
+
"epoch": 0.01038961038961039,
|
35 |
+
"grad_norm": 0.23729183422165226,
|
36 |
+
"learning_rate": 1.5e-05,
|
37 |
+
"loss": 1.9238,
|
38 |
+
"step": 3
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"epoch": 0.013852813852813853,
|
42 |
+
"grad_norm": 0.1802988503389903,
|
43 |
+
"learning_rate": 2e-05,
|
44 |
+
"loss": 1.8901,
|
45 |
+
"step": 4
|
46 |
+
},
|
47 |
+
{
|
48 |
+
"epoch": 0.017316017316017316,
|
49 |
+
"grad_norm": 0.18865054609738205,
|
50 |
+
"learning_rate": 2.5e-05,
|
51 |
+
"loss": 1.9419,
|
52 |
+
"step": 5
|
53 |
+
},
|
54 |
+
{
|
55 |
+
"epoch": 0.02077922077922078,
|
56 |
+
"grad_norm": 0.2153919517946603,
|
57 |
+
"learning_rate": 3e-05,
|
58 |
+
"loss": 1.9561,
|
59 |
+
"step": 6
|
60 |
+
},
|
61 |
+
{
|
62 |
+
"epoch": 0.024242424242424242,
|
63 |
+
"grad_norm": 0.23646989547590208,
|
64 |
+
"learning_rate": 3.5e-05,
|
65 |
+
"loss": 1.9231,
|
66 |
+
"step": 7
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 0.027705627705627706,
|
70 |
+
"grad_norm": 0.1695483068973071,
|
71 |
+
"learning_rate": 4e-05,
|
72 |
+
"loss": 1.7199,
|
73 |
+
"step": 8
|
74 |
+
},
|
75 |
+
{
|
76 |
+
"epoch": 0.03116883116883117,
|
77 |
+
"grad_norm": 0.17169305240230742,
|
78 |
+
"learning_rate": 4.5e-05,
|
79 |
+
"loss": 1.9328,
|
80 |
+
"step": 9
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"epoch": 0.03463203463203463,
|
84 |
+
"grad_norm": 0.1769763038127782,
|
85 |
+
"learning_rate": 5e-05,
|
86 |
+
"loss": 1.794,
|
87 |
+
"step": 10
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"epoch": 0.0380952380952381,
|
91 |
+
"grad_norm": 0.2739291337489883,
|
92 |
+
"learning_rate": 5.500000000000001e-05,
|
93 |
+
"loss": 1.8976,
|
94 |
+
"step": 11
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"epoch": 0.04155844155844156,
|
98 |
+
"grad_norm": 0.1687629241124428,
|
99 |
+
"learning_rate": 6e-05,
|
100 |
+
"loss": 1.8382,
|
101 |
+
"step": 12
|
102 |
+
},
|
103 |
+
{
|
104 |
+
"epoch": 0.045021645021645025,
|
105 |
+
"grad_norm": 0.170449291833281,
|
106 |
+
"learning_rate": 6.500000000000001e-05,
|
107 |
+
"loss": 1.8339,
|
108 |
+
"step": 13
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"epoch": 0.048484848484848485,
|
112 |
+
"grad_norm": 0.13830013122227536,
|
113 |
+
"learning_rate": 7e-05,
|
114 |
+
"loss": 1.7958,
|
115 |
+
"step": 14
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 0.05194805194805195,
|
119 |
+
"grad_norm": 0.3120525656602162,
|
120 |
+
"learning_rate": 7.500000000000001e-05,
|
121 |
+
"loss": 1.8834,
|
122 |
+
"step": 15
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"epoch": 0.05541125541125541,
|
126 |
+
"grad_norm": 0.1740554404965808,
|
127 |
+
"learning_rate": 8e-05,
|
128 |
+
"loss": 1.643,
|
129 |
+
"step": 16
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"epoch": 0.05887445887445888,
|
133 |
+
"grad_norm": 0.13272024244803257,
|
134 |
+
"learning_rate": 8.5e-05,
|
135 |
+
"loss": 1.7635,
|
136 |
+
"step": 17
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"epoch": 0.06233766233766234,
|
140 |
+
"grad_norm": 0.13865354195619714,
|
141 |
+
"learning_rate": 9e-05,
|
142 |
+
"loss": 1.8596,
|
143 |
+
"step": 18
|
144 |
+
},
|
145 |
+
{
|
146 |
+
"epoch": 0.0658008658008658,
|
147 |
+
"grad_norm": 0.17558880062270332,
|
148 |
+
"learning_rate": 9.5e-05,
|
149 |
+
"loss": 2.0007,
|
150 |
+
"step": 19
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"epoch": 0.06926406926406926,
|
154 |
+
"grad_norm": 0.18945613013501378,
|
155 |
+
"learning_rate": 0.0001,
|
156 |
+
"loss": 1.8773,
|
157 |
+
"step": 20
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"epoch": 0.07272727272727272,
|
161 |
+
"grad_norm": 0.11111588495801177,
|
162 |
+
"learning_rate": 9.999697629917739e-05,
|
163 |
+
"loss": 1.8568,
|
164 |
+
"step": 21
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"epoch": 0.0761904761904762,
|
168 |
+
"grad_norm": 0.2167792483298019,
|
169 |
+
"learning_rate": 9.998790560305473e-05,
|
170 |
+
"loss": 1.7966,
|
171 |
+
"step": 22
|
172 |
+
},
|
173 |
+
{
|
174 |
+
"epoch": 0.07965367965367966,
|
175 |
+
"grad_norm": 0.17058063410322674,
|
176 |
+
"learning_rate": 9.997278913061298e-05,
|
177 |
+
"loss": 1.8296,
|
178 |
+
"step": 23
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"epoch": 0.08311688311688312,
|
182 |
+
"grad_norm": 0.22535134477990126,
|
183 |
+
"learning_rate": 9.995162891330504e-05,
|
184 |
+
"loss": 1.8398,
|
185 |
+
"step": 24
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"epoch": 0.08658008658008658,
|
189 |
+
"grad_norm": 0.13284807817034902,
|
190 |
+
"learning_rate": 9.992442779478275e-05,
|
191 |
+
"loss": 1.7536,
|
192 |
+
"step": 25
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"epoch": 0.09004329004329005,
|
196 |
+
"grad_norm": 0.1525380710864997,
|
197 |
+
"learning_rate": 9.989118943051471e-05,
|
198 |
+
"loss": 1.8267,
|
199 |
+
"step": 26
|
200 |
+
},
|
201 |
+
{
|
202 |
+
"epoch": 0.09350649350649351,
|
203 |
+
"grad_norm": 0.38389909659403076,
|
204 |
+
"learning_rate": 9.985191828729519e-05,
|
205 |
+
"loss": 1.7526,
|
206 |
+
"step": 27
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 0.09696969696969697,
|
210 |
+
"grad_norm": 0.1311981474834846,
|
211 |
+
"learning_rate": 9.98066196426436e-05,
|
212 |
+
"loss": 1.8789,
|
213 |
+
"step": 28
|
214 |
+
},
|
215 |
+
{
|
216 |
+
"epoch": 0.10043290043290043,
|
217 |
+
"grad_norm": 0.14321635310477376,
|
218 |
+
"learning_rate": 9.97552995840955e-05,
|
219 |
+
"loss": 1.8666,
|
220 |
+
"step": 29
|
221 |
+
},
|
222 |
+
{
|
223 |
+
"epoch": 0.1038961038961039,
|
224 |
+
"grad_norm": 0.131774192226824,
|
225 |
+
"learning_rate": 9.969796500838434e-05,
|
226 |
+
"loss": 1.8831,
|
227 |
+
"step": 30
|
228 |
+
},
|
229 |
+
{
|
230 |
+
"epoch": 0.10735930735930736,
|
231 |
+
"grad_norm": 0.13710505067770457,
|
232 |
+
"learning_rate": 9.963462362051473e-05,
|
233 |
+
"loss": 1.6771,
|
234 |
+
"step": 31
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"epoch": 0.11082251082251082,
|
238 |
+
"grad_norm": 0.14077801488589667,
|
239 |
+
"learning_rate": 9.956528393272697e-05,
|
240 |
+
"loss": 1.8743,
|
241 |
+
"step": 32
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"epoch": 0.11428571428571428,
|
245 |
+
"grad_norm": 0.1606260003339504,
|
246 |
+
"learning_rate": 9.94899552633531e-05,
|
247 |
+
"loss": 1.7463,
|
248 |
+
"step": 33
|
249 |
+
},
|
250 |
+
{
|
251 |
+
"epoch": 0.11774891774891776,
|
252 |
+
"grad_norm": 0.20844538767698467,
|
253 |
+
"learning_rate": 9.940864773556466e-05,
|
254 |
+
"loss": 1.8095,
|
255 |
+
"step": 34
|
256 |
+
},
|
257 |
+
{
|
258 |
+
"epoch": 0.12121212121212122,
|
259 |
+
"grad_norm": 0.13051717096877563,
|
260 |
+
"learning_rate": 9.932137227601224e-05,
|
261 |
+
"loss": 1.743,
|
262 |
+
"step": 35
|
263 |
+
},
|
264 |
+
{
|
265 |
+
"epoch": 0.12467532467532468,
|
266 |
+
"grad_norm": 0.1273670930785435,
|
267 |
+
"learning_rate": 9.922814061335716e-05,
|
268 |
+
"loss": 1.8164,
|
269 |
+
"step": 36
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"epoch": 0.12813852813852813,
|
273 |
+
"grad_norm": 0.14632843388917796,
|
274 |
+
"learning_rate": 9.912896527669518e-05,
|
275 |
+
"loss": 1.6922,
|
276 |
+
"step": 37
|
277 |
+
},
|
278 |
+
{
|
279 |
+
"epoch": 0.1316017316017316,
|
280 |
+
"grad_norm": 0.1877238002560958,
|
281 |
+
"learning_rate": 9.902385959387282e-05,
|
282 |
+
"loss": 1.8563,
|
283 |
+
"step": 38
|
284 |
+
},
|
285 |
+
{
|
286 |
+
"epoch": 0.13506493506493505,
|
287 |
+
"grad_norm": 0.12224962058562377,
|
288 |
+
"learning_rate": 9.891283768969633e-05,
|
289 |
+
"loss": 1.7657,
|
290 |
+
"step": 39
|
291 |
+
},
|
292 |
+
{
|
293 |
+
"epoch": 0.13852813852813853,
|
294 |
+
"grad_norm": 0.1552638716363645,
|
295 |
+
"learning_rate": 9.879591448403333e-05,
|
296 |
+
"loss": 1.9331,
|
297 |
+
"step": 40
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"epoch": 0.141991341991342,
|
301 |
+
"grad_norm": 0.3572833915022296,
|
302 |
+
"learning_rate": 9.867310568980802e-05,
|
303 |
+
"loss": 1.6578,
|
304 |
+
"step": 41
|
305 |
+
},
|
306 |
+
{
|
307 |
+
"epoch": 0.14545454545454545,
|
308 |
+
"grad_norm": 0.9532440952793683,
|
309 |
+
"learning_rate": 9.854442781088935e-05,
|
310 |
+
"loss": 1.8014,
|
311 |
+
"step": 42
|
312 |
+
},
|
313 |
+
{
|
314 |
+
"epoch": 0.14891774891774892,
|
315 |
+
"grad_norm": 0.23015183389227475,
|
316 |
+
"learning_rate": 9.840989813987326e-05,
|
317 |
+
"loss": 1.6852,
|
318 |
+
"step": 43
|
319 |
+
},
|
320 |
+
{
|
321 |
+
"epoch": 0.1523809523809524,
|
322 |
+
"grad_norm": 0.13909635416408656,
|
323 |
+
"learning_rate": 9.826953475575873e-05,
|
324 |
+
"loss": 1.7686,
|
325 |
+
"step": 44
|
326 |
+
},
|
327 |
+
{
|
328 |
+
"epoch": 0.15584415584415584,
|
329 |
+
"grad_norm": 0.14004251970994497,
|
330 |
+
"learning_rate": 9.812335652151818e-05,
|
331 |
+
"loss": 1.8545,
|
332 |
+
"step": 45
|
333 |
+
},
|
334 |
+
{
|
335 |
+
"epoch": 0.15930735930735931,
|
336 |
+
"grad_norm": 0.12804047264438845,
|
337 |
+
"learning_rate": 9.797138308156262e-05,
|
338 |
+
"loss": 1.8549,
|
339 |
+
"step": 46
|
340 |
+
},
|
341 |
+
{
|
342 |
+
"epoch": 0.16277056277056276,
|
343 |
+
"grad_norm": 0.15888098268224185,
|
344 |
+
"learning_rate": 9.781363485910162e-05,
|
345 |
+
"loss": 1.8095,
|
346 |
+
"step": 47
|
347 |
+
},
|
348 |
+
{
|
349 |
+
"epoch": 0.16623376623376623,
|
350 |
+
"grad_norm": 0.1753776918443242,
|
351 |
+
"learning_rate": 9.765013305339872e-05,
|
352 |
+
"loss": 1.7596,
|
353 |
+
"step": 48
|
354 |
+
},
|
355 |
+
{
|
356 |
+
"epoch": 0.1696969696969697,
|
357 |
+
"grad_norm": 0.1542382423932175,
|
358 |
+
"learning_rate": 9.748089963692256e-05,
|
359 |
+
"loss": 1.9146,
|
360 |
+
"step": 49
|
361 |
+
},
|
362 |
+
{
|
363 |
+
"epoch": 0.17316017316017315,
|
364 |
+
"grad_norm": 0.13847988655949817,
|
365 |
+
"learning_rate": 9.730595735239407e-05,
|
366 |
+
"loss": 1.7984,
|
367 |
+
"step": 50
|
368 |
+
},
|
369 |
+
{
|
370 |
+
"epoch": 0.17662337662337663,
|
371 |
+
"grad_norm": 0.4071014591163337,
|
372 |
+
"learning_rate": 9.712532970973013e-05,
|
373 |
+
"loss": 1.7578,
|
374 |
+
"step": 51
|
375 |
+
},
|
376 |
+
{
|
377 |
+
"epoch": 0.1800865800865801,
|
378 |
+
"grad_norm": 0.17428941847352164,
|
379 |
+
"learning_rate": 9.693904098288415e-05,
|
380 |
+
"loss": 1.8245,
|
381 |
+
"step": 52
|
382 |
+
},
|
383 |
+
{
|
384 |
+
"epoch": 0.18354978354978355,
|
385 |
+
"grad_norm": 0.12001384773806148,
|
386 |
+
"learning_rate": 9.674711620658393e-05,
|
387 |
+
"loss": 1.8891,
|
388 |
+
"step": 53
|
389 |
+
},
|
390 |
+
{
|
391 |
+
"epoch": 0.18701298701298702,
|
392 |
+
"grad_norm": 0.14927831515795748,
|
393 |
+
"learning_rate": 9.654958117296748e-05,
|
394 |
+
"loss": 1.7755,
|
395 |
+
"step": 54
|
396 |
+
},
|
397 |
+
{
|
398 |
+
"epoch": 0.19047619047619047,
|
399 |
+
"grad_norm": 0.1328911465672095,
|
400 |
+
"learning_rate": 9.634646242811673e-05,
|
401 |
+
"loss": 1.8446,
|
402 |
+
"step": 55
|
403 |
+
},
|
404 |
+
{
|
405 |
+
"epoch": 0.19393939393939394,
|
406 |
+
"grad_norm": 0.22985304080720362,
|
407 |
+
"learning_rate": 9.613778726849014e-05,
|
408 |
+
"loss": 1.8517,
|
409 |
+
"step": 56
|
410 |
+
},
|
411 |
+
{
|
412 |
+
"epoch": 0.1974025974025974,
|
413 |
+
"grad_norm": 0.20379099943758505,
|
414 |
+
"learning_rate": 9.592358373725448e-05,
|
415 |
+
"loss": 1.6363,
|
416 |
+
"step": 57
|
417 |
+
},
|
418 |
+
{
|
419 |
+
"epoch": 0.20086580086580086,
|
420 |
+
"grad_norm": 0.13109221546818925,
|
421 |
+
"learning_rate": 9.570388062051613e-05,
|
422 |
+
"loss": 1.7453,
|
423 |
+
"step": 58
|
424 |
+
},
|
425 |
+
{
|
426 |
+
"epoch": 0.20432900432900433,
|
427 |
+
"grad_norm": 0.2032056177408556,
|
428 |
+
"learning_rate": 9.547870744345262e-05,
|
429 |
+
"loss": 1.8279,
|
430 |
+
"step": 59
|
431 |
+
},
|
432 |
+
{
|
433 |
+
"epoch": 0.20432900432900433,
|
434 |
+
"eval_loss": 1.999111294746399,
|
435 |
+
"eval_runtime": 293.5683,
|
436 |
+
"eval_samples_per_second": 0.341,
|
437 |
+
"eval_steps_per_second": 0.17,
|
438 |
+
"step": 59
|
439 |
+
},
|
440 |
+
{
|
441 |
+
"epoch": 0.2077922077922078,
|
442 |
+
"grad_norm": 0.17529821502651677,
|
443 |
+
"learning_rate": 9.524809446634491e-05,
|
444 |
+
"loss": 1.6943,
|
445 |
+
"step": 60
|
446 |
+
},
|
447 |
+
{
|
448 |
+
"epoch": 0.21125541125541125,
|
449 |
+
"grad_norm": 0.12745995684364722,
|
450 |
+
"learning_rate": 9.501207268051065e-05,
|
451 |
+
"loss": 1.7711,
|
452 |
+
"step": 61
|
453 |
+
},
|
454 |
+
{
|
455 |
+
"epoch": 0.21471861471861473,
|
456 |
+
"grad_norm": 0.13389107026895525,
|
457 |
+
"learning_rate": 9.47706738041396e-05,
|
458 |
+
"loss": 1.7418,
|
459 |
+
"step": 62
|
460 |
+
},
|
461 |
+
{
|
462 |
+
"epoch": 0.21818181818181817,
|
463 |
+
"grad_norm": 0.121236748921413,
|
464 |
+
"learning_rate": 9.452393027803087e-05,
|
465 |
+
"loss": 1.7933,
|
466 |
+
"step": 63
|
467 |
+
},
|
468 |
+
{
|
469 |
+
"epoch": 0.22164502164502164,
|
470 |
+
"grad_norm": 0.2677114062718937,
|
471 |
+
"learning_rate": 9.427187526123349e-05,
|
472 |
+
"loss": 1.6282,
|
473 |
+
"step": 64
|
474 |
+
},
|
475 |
+
{
|
476 |
+
"epoch": 0.22510822510822512,
|
477 |
+
"grad_norm": 0.1315935010259272,
|
478 |
+
"learning_rate": 9.401454262659021e-05,
|
479 |
+
"loss": 1.8114,
|
480 |
+
"step": 65
|
481 |
+
},
|
482 |
+
{
|
483 |
+
"epoch": 0.22857142857142856,
|
484 |
+
"grad_norm": 0.3087874359247871,
|
485 |
+
"learning_rate": 9.375196695618541e-05,
|
486 |
+
"loss": 1.8901,
|
487 |
+
"step": 66
|
488 |
+
},
|
489 |
+
{
|
490 |
+
"epoch": 0.23203463203463204,
|
491 |
+
"grad_norm": 0.16625917755333441,
|
492 |
+
"learning_rate": 9.34841835366978e-05,
|
493 |
+
"loss": 1.7242,
|
494 |
+
"step": 67
|
495 |
+
},
|
496 |
+
{
|
497 |
+
"epoch": 0.2354978354978355,
|
498 |
+
"grad_norm": 0.18601871730414293,
|
499 |
+
"learning_rate": 9.321122835465832e-05,
|
500 |
+
"loss": 1.8886,
|
501 |
+
"step": 68
|
502 |
+
},
|
503 |
+
{
|
504 |
+
"epoch": 0.23896103896103896,
|
505 |
+
"grad_norm": 0.15023934879358058,
|
506 |
+
"learning_rate": 9.293313809161398e-05,
|
507 |
+
"loss": 1.9009,
|
508 |
+
"step": 69
|
509 |
+
},
|
510 |
+
{
|
511 |
+
"epoch": 0.24242424242424243,
|
512 |
+
"grad_norm": 0.1898870406241783,
|
513 |
+
"learning_rate": 9.264995011919842e-05,
|
514 |
+
"loss": 1.8542,
|
515 |
+
"step": 70
|
516 |
+
},
|
517 |
+
{
|
518 |
+
"epoch": 0.24588744588744588,
|
519 |
+
"grad_norm": 0.11719048639879068,
|
520 |
+
"learning_rate": 9.236170249410971e-05,
|
521 |
+
"loss": 1.7862,
|
522 |
+
"step": 71
|
523 |
+
},
|
524 |
+
{
|
525 |
+
"epoch": 0.24935064935064935,
|
526 |
+
"grad_norm": 0.17652226951092279,
|
527 |
+
"learning_rate": 9.206843395299582e-05,
|
528 |
+
"loss": 1.8578,
|
529 |
+
"step": 72
|
530 |
+
},
|
531 |
+
{
|
532 |
+
"epoch": 0.2528138528138528,
|
533 |
+
"grad_norm": 0.1587295825611423,
|
534 |
+
"learning_rate": 9.177018390724922e-05,
|
535 |
+
"loss": 1.7351,
|
536 |
+
"step": 73
|
537 |
+
},
|
538 |
+
{
|
539 |
+
"epoch": 0.25627705627705627,
|
540 |
+
"grad_norm": 0.15111228997710152,
|
541 |
+
"learning_rate": 9.146699243771024e-05,
|
542 |
+
"loss": 1.7845,
|
543 |
+
"step": 74
|
544 |
+
},
|
545 |
+
{
|
546 |
+
"epoch": 0.2597402597402597,
|
547 |
+
"grad_norm": 0.1476778598569357,
|
548 |
+
"learning_rate": 9.115890028928096e-05,
|
549 |
+
"loss": 1.7964,
|
550 |
+
"step": 75
|
551 |
+
},
|
552 |
+
{
|
553 |
+
"epoch": 0.2632034632034632,
|
554 |
+
"grad_norm": 0.13451846228173517,
|
555 |
+
"learning_rate": 9.084594886544947e-05,
|
556 |
+
"loss": 1.7537,
|
557 |
+
"step": 76
|
558 |
+
},
|
559 |
+
{
|
560 |
+
"epoch": 0.26666666666666666,
|
561 |
+
"grad_norm": 0.20501729418270834,
|
562 |
+
"learning_rate": 9.05281802227259e-05,
|
563 |
+
"loss": 1.7966,
|
564 |
+
"step": 77
|
565 |
+
},
|
566 |
+
{
|
567 |
+
"epoch": 0.2701298701298701,
|
568 |
+
"grad_norm": 0.1343051700663291,
|
569 |
+
"learning_rate": 9.020563706499054e-05,
|
570 |
+
"loss": 1.7432,
|
571 |
+
"step": 78
|
572 |
+
},
|
573 |
+
{
|
574 |
+
"epoch": 0.2735930735930736,
|
575 |
+
"grad_norm": 0.2576160107399793,
|
576 |
+
"learning_rate": 8.987836273775502e-05,
|
577 |
+
"loss": 1.7844,
|
578 |
+
"step": 79
|
579 |
+
},
|
580 |
+
{
|
581 |
+
"epoch": 0.27705627705627706,
|
582 |
+
"grad_norm": 0.1611750355342202,
|
583 |
+
"learning_rate": 8.954640122233717e-05,
|
584 |
+
"loss": 1.7335,
|
585 |
+
"step": 80
|
586 |
+
},
|
587 |
+
{
|
588 |
+
"epoch": 0.2805194805194805,
|
589 |
+
"grad_norm": 0.1535687636039628,
|
590 |
+
"learning_rate": 8.92097971299507e-05,
|
591 |
+
"loss": 1.8359,
|
592 |
+
"step": 81
|
593 |
+
},
|
594 |
+
{
|
595 |
+
"epoch": 0.283982683982684,
|
596 |
+
"grad_norm": 0.14335525291232706,
|
597 |
+
"learning_rate": 8.886859569570986e-05,
|
598 |
+
"loss": 1.5791,
|
599 |
+
"step": 82
|
600 |
+
},
|
601 |
+
{
|
602 |
+
"epoch": 0.28744588744588745,
|
603 |
+
"grad_norm": 0.12069704359106079,
|
604 |
+
"learning_rate": 8.852284277255054e-05,
|
605 |
+
"loss": 1.8349,
|
606 |
+
"step": 83
|
607 |
+
},
|
608 |
+
{
|
609 |
+
"epoch": 0.2909090909090909,
|
610 |
+
"grad_norm": 0.14265174894073543,
|
611 |
+
"learning_rate": 8.817258482506821e-05,
|
612 |
+
"loss": 1.6968,
|
613 |
+
"step": 84
|
614 |
+
},
|
615 |
+
{
|
616 |
+
"epoch": 0.2943722943722944,
|
617 |
+
"grad_norm": 0.15759187672377553,
|
618 |
+
"learning_rate": 8.781786892327372e-05,
|
619 |
+
"loss": 1.8609,
|
620 |
+
"step": 85
|
621 |
+
},
|
622 |
+
{
|
623 |
+
"epoch": 0.29783549783549784,
|
624 |
+
"grad_norm": 0.15630758183987872,
|
625 |
+
"learning_rate": 8.745874273626769e-05,
|
626 |
+
"loss": 1.6969,
|
627 |
+
"step": 86
|
628 |
+
},
|
629 |
+
{
|
630 |
+
"epoch": 0.3012987012987013,
|
631 |
+
"grad_norm": 0.23155350493633237,
|
632 |
+
"learning_rate": 8.70952545258344e-05,
|
633 |
+
"loss": 1.7134,
|
634 |
+
"step": 87
|
635 |
+
},
|
636 |
+
{
|
637 |
+
"epoch": 0.3047619047619048,
|
638 |
+
"grad_norm": 0.12867694140850763,
|
639 |
+
"learning_rate": 8.672745313995617e-05,
|
640 |
+
"loss": 1.7176,
|
641 |
+
"step": 88
|
642 |
+
},
|
643 |
+
{
|
644 |
+
"epoch": 0.30822510822510824,
|
645 |
+
"grad_norm": 0.14660527797094974,
|
646 |
+
"learning_rate": 8.635538800624865e-05,
|
647 |
+
"loss": 1.7618,
|
648 |
+
"step": 89
|
649 |
+
},
|
650 |
+
{
|
651 |
+
"epoch": 0.3116883116883117,
|
652 |
+
"grad_norm": 0.31739145146977316,
|
653 |
+
"learning_rate": 8.597910912531857e-05,
|
654 |
+
"loss": 1.7678,
|
655 |
+
"step": 90
|
656 |
+
},
|
657 |
+
{
|
658 |
+
"epoch": 0.3151515151515151,
|
659 |
+
"grad_norm": 0.12878964888578534,
|
660 |
+
"learning_rate": 8.559866706404422e-05,
|
661 |
+
"loss": 1.6939,
|
662 |
+
"step": 91
|
663 |
+
},
|
664 |
+
{
|
665 |
+
"epoch": 0.31861471861471863,
|
666 |
+
"grad_norm": 0.1294085657296158,
|
667 |
+
"learning_rate": 8.521411294877998e-05,
|
668 |
+
"loss": 1.9087,
|
669 |
+
"step": 92
|
670 |
+
},
|
671 |
+
{
|
672 |
+
"epoch": 0.3220779220779221,
|
673 |
+
"grad_norm": 0.13843213421574815,
|
674 |
+
"learning_rate": 8.482549845848562e-05,
|
675 |
+
"loss": 1.889,
|
676 |
+
"step": 93
|
677 |
+
},
|
678 |
+
{
|
679 |
+
"epoch": 0.3255411255411255,
|
680 |
+
"grad_norm": 0.11234571905653916,
|
681 |
+
"learning_rate": 8.443287581778132e-05,
|
682 |
+
"loss": 1.761,
|
683 |
+
"step": 94
|
684 |
+
},
|
685 |
+
{
|
686 |
+
"epoch": 0.329004329004329,
|
687 |
+
"grad_norm": 0.28802636544720606,
|
688 |
+
"learning_rate": 8.403629778992935e-05,
|
689 |
+
"loss": 1.7695,
|
690 |
+
"step": 95
|
691 |
+
},
|
692 |
+
{
|
693 |
+
"epoch": 0.33246753246753247,
|
694 |
+
"grad_norm": 0.17442102072693685,
|
695 |
+
"learning_rate": 8.363581766974347e-05,
|
696 |
+
"loss": 1.868,
|
697 |
+
"step": 96
|
698 |
+
},
|
699 |
+
{
|
700 |
+
"epoch": 0.3359307359307359,
|
701 |
+
"grad_norm": 0.18092190501025998,
|
702 |
+
"learning_rate": 8.323148927642676e-05,
|
703 |
+
"loss": 1.8138,
|
704 |
+
"step": 97
|
705 |
+
},
|
706 |
+
{
|
707 |
+
"epoch": 0.3393939393939394,
|
708 |
+
"grad_norm": 0.14180736758315962,
|
709 |
+
"learning_rate": 8.282336694633897e-05,
|
710 |
+
"loss": 1.7451,
|
711 |
+
"step": 98
|
712 |
+
},
|
713 |
+
{
|
714 |
+
"epoch": 0.34285714285714286,
|
715 |
+
"grad_norm": 0.1260334956751797,
|
716 |
+
"learning_rate": 8.241150552569461e-05,
|
717 |
+
"loss": 1.8159,
|
718 |
+
"step": 99
|
719 |
+
},
|
720 |
+
{
|
721 |
+
"epoch": 0.3463203463203463,
|
722 |
+
"grad_norm": 0.28483954218537194,
|
723 |
+
"learning_rate": 8.199596036319213e-05,
|
724 |
+
"loss": 1.8712,
|
725 |
+
"step": 100
|
726 |
+
},
|
727 |
+
{
|
728 |
+
"epoch": 0.3497835497835498,
|
729 |
+
"grad_norm": 0.3058596658282089,
|
730 |
+
"learning_rate": 8.157678730257599e-05,
|
731 |
+
"loss": 1.716,
|
732 |
+
"step": 101
|
733 |
+
},
|
734 |
+
{
|
735 |
+
"epoch": 0.35324675324675325,
|
736 |
+
"grad_norm": 0.14780337095271387,
|
737 |
+
"learning_rate": 8.115404267513189e-05,
|
738 |
+
"loss": 1.5771,
|
739 |
+
"step": 102
|
740 |
+
},
|
741 |
+
{
|
742 |
+
"epoch": 0.3567099567099567,
|
743 |
+
"grad_norm": 0.12983691765086658,
|
744 |
+
"learning_rate": 8.072778329211661e-05,
|
745 |
+
"loss": 1.7949,
|
746 |
+
"step": 103
|
747 |
+
},
|
748 |
+
{
|
749 |
+
"epoch": 0.3601731601731602,
|
750 |
+
"grad_norm": 0.16953000547808353,
|
751 |
+
"learning_rate": 8.029806643712335e-05,
|
752 |
+
"loss": 1.7907,
|
753 |
+
"step": 104
|
754 |
+
},
|
755 |
+
{
|
756 |
+
"epoch": 0.36363636363636365,
|
757 |
+
"grad_norm": 0.14609853698140796,
|
758 |
+
"learning_rate": 7.986494985838359e-05,
|
759 |
+
"loss": 1.8516,
|
760 |
+
"step": 105
|
761 |
+
},
|
762 |
+
{
|
763 |
+
"epoch": 0.3670995670995671,
|
764 |
+
"grad_norm": 0.22124945234658114,
|
765 |
+
"learning_rate": 7.942849176100647e-05,
|
766 |
+
"loss": 1.694,
|
767 |
+
"step": 106
|
768 |
+
},
|
769 |
+
{
|
770 |
+
"epoch": 0.37056277056277054,
|
771 |
+
"grad_norm": 0.15542150684527328,
|
772 |
+
"learning_rate": 7.898875079915673e-05,
|
773 |
+
"loss": 1.6885,
|
774 |
+
"step": 107
|
775 |
+
},
|
776 |
+
{
|
777 |
+
"epoch": 0.37402597402597404,
|
778 |
+
"grad_norm": 0.22905935117923695,
|
779 |
+
"learning_rate": 7.854578606817258e-05,
|
780 |
+
"loss": 1.7547,
|
781 |
+
"step": 108
|
782 |
+
},
|
783 |
+
{
|
784 |
+
"epoch": 0.3774891774891775,
|
785 |
+
"grad_norm": 0.1499752392806047,
|
786 |
+
"learning_rate": 7.809965709662383e-05,
|
787 |
+
"loss": 1.7788,
|
788 |
+
"step": 109
|
789 |
+
},
|
790 |
+
{
|
791 |
+
"epoch": 0.38095238095238093,
|
792 |
+
"grad_norm": 0.15569825335048748,
|
793 |
+
"learning_rate": 7.765042383831217e-05,
|
794 |
+
"loss": 1.6898,
|
795 |
+
"step": 110
|
796 |
+
},
|
797 |
+
{
|
798 |
+
"epoch": 0.38441558441558443,
|
799 |
+
"grad_norm": 0.23871935106992861,
|
800 |
+
"learning_rate": 7.719814666421421e-05,
|
801 |
+
"loss": 1.76,
|
802 |
+
"step": 111
|
803 |
+
},
|
804 |
+
{
|
805 |
+
"epoch": 0.3878787878787879,
|
806 |
+
"grad_norm": 0.1525667688507407,
|
807 |
+
"learning_rate": 7.674288635436826e-05,
|
808 |
+
"loss": 1.7709,
|
809 |
+
"step": 112
|
810 |
+
},
|
811 |
+
{
|
812 |
+
"epoch": 0.3913419913419913,
|
813 |
+
"grad_norm": 0.16436932375822805,
|
814 |
+
"learning_rate": 7.628470408970652e-05,
|
815 |
+
"loss": 1.8098,
|
816 |
+
"step": 113
|
817 |
+
},
|
818 |
+
{
|
819 |
+
"epoch": 0.3948051948051948,
|
820 |
+
"grad_norm": 0.14429830327760923,
|
821 |
+
"learning_rate": 7.582366144383298e-05,
|
822 |
+
"loss": 1.7326,
|
823 |
+
"step": 114
|
824 |
+
},
|
825 |
+
{
|
826 |
+
"epoch": 0.39826839826839827,
|
827 |
+
"grad_norm": 0.18442389673710763,
|
828 |
+
"learning_rate": 7.535982037474891e-05,
|
829 |
+
"loss": 1.878,
|
830 |
+
"step": 115
|
831 |
+
},
|
832 |
+
{
|
833 |
+
"epoch": 0.4017316017316017,
|
834 |
+
"grad_norm": 0.1606647287097204,
|
835 |
+
"learning_rate": 7.489324321652635e-05,
|
836 |
+
"loss": 1.8083,
|
837 |
+
"step": 116
|
838 |
+
},
|
839 |
+
{
|
840 |
+
"epoch": 0.4051948051948052,
|
841 |
+
"grad_norm": 0.21550638422267673,
|
842 |
+
"learning_rate": 7.442399267093145e-05,
|
843 |
+
"loss": 1.7426,
|
844 |
+
"step": 117
|
845 |
+
},
|
846 |
+
{
|
847 |
+
"epoch": 0.40865800865800866,
|
848 |
+
"grad_norm": 0.1398337195854571,
|
849 |
+
"learning_rate": 7.395213179899797e-05,
|
850 |
+
"loss": 1.8002,
|
851 |
+
"step": 118
|
852 |
+
},
|
853 |
+
{
|
854 |
+
"epoch": 0.40865800865800866,
|
855 |
+
"eval_loss": 1.9487916231155396,
|
856 |
+
"eval_runtime": 293.7231,
|
857 |
+
"eval_samples_per_second": 0.34,
|
858 |
+
"eval_steps_per_second": 0.17,
|
859 |
+
"step": 118
|
860 |
+
},
|
861 |
+
{
|
862 |
+
"epoch": 0.4121212121212121,
|
863 |
+
"grad_norm": 0.25611170557780655,
|
864 |
+
"learning_rate": 7.34777240125529e-05,
|
865 |
+
"loss": 1.6664,
|
866 |
+
"step": 119
|
867 |
+
},
|
868 |
+
{
|
869 |
+
"epoch": 0.4155844155844156,
|
870 |
+
"grad_norm": 0.17940479460583333,
|
871 |
+
"learning_rate": 7.300083306569465e-05,
|
872 |
+
"loss": 1.6816,
|
873 |
+
"step": 120
|
874 |
+
},
|
875 |
+
{
|
876 |
+
"epoch": 0.41904761904761906,
|
877 |
+
"grad_norm": 0.15017902454932838,
|
878 |
+
"learning_rate": 7.252152304622533e-05,
|
879 |
+
"loss": 1.8012,
|
880 |
+
"step": 121
|
881 |
+
},
|
882 |
+
{
|
883 |
+
"epoch": 0.4225108225108225,
|
884 |
+
"grad_norm": 0.14284666939949986,
|
885 |
+
"learning_rate": 7.203985836703833e-05,
|
886 |
+
"loss": 1.6545,
|
887 |
+
"step": 122
|
888 |
+
},
|
889 |
+
{
|
890 |
+
"epoch": 0.42597402597402595,
|
891 |
+
"grad_norm": 0.1559473771327877,
|
892 |
+
"learning_rate": 7.155590375746192e-05,
|
893 |
+
"loss": 1.7871,
|
894 |
+
"step": 123
|
895 |
+
},
|
896 |
+
{
|
897 |
+
"epoch": 0.42943722943722945,
|
898 |
+
"grad_norm": 0.14475597256584571,
|
899 |
+
"learning_rate": 7.106972425456059e-05,
|
900 |
+
"loss": 1.865,
|
901 |
+
"step": 124
|
902 |
+
},
|
903 |
+
{
|
904 |
+
"epoch": 0.4329004329004329,
|
905 |
+
"grad_norm": 0.14244658764044832,
|
906 |
+
"learning_rate": 7.058138519439493e-05,
|
907 |
+
"loss": 1.8481,
|
908 |
+
"step": 125
|
909 |
+
},
|
910 |
+
{
|
911 |
+
"epoch": 0.43636363636363634,
|
912 |
+
"grad_norm": 0.14693435900184554,
|
913 |
+
"learning_rate": 7.009095220324128e-05,
|
914 |
+
"loss": 1.8633,
|
915 |
+
"step": 126
|
916 |
+
},
|
917 |
+
{
|
918 |
+
"epoch": 0.43982683982683984,
|
919 |
+
"grad_norm": 0.3739649239005357,
|
920 |
+
"learning_rate": 6.959849118877247e-05,
|
921 |
+
"loss": 1.6491,
|
922 |
+
"step": 127
|
923 |
+
},
|
924 |
+
{
|
925 |
+
"epoch": 0.4432900432900433,
|
926 |
+
"grad_norm": 0.15353898219906464,
|
927 |
+
"learning_rate": 6.91040683312007e-05,
|
928 |
+
"loss": 1.7563,
|
929 |
+
"step": 128
|
930 |
+
},
|
931 |
+
{
|
932 |
+
"epoch": 0.44675324675324674,
|
933 |
+
"grad_norm": 0.17393666770414995,
|
934 |
+
"learning_rate": 6.860775007438383e-05,
|
935 |
+
"loss": 1.6639,
|
936 |
+
"step": 129
|
937 |
+
},
|
938 |
+
{
|
939 |
+
"epoch": 0.45021645021645024,
|
940 |
+
"grad_norm": 0.5088738245902021,
|
941 |
+
"learning_rate": 6.81096031168961e-05,
|
942 |
+
"loss": 1.6868,
|
943 |
+
"step": 130
|
944 |
+
},
|
945 |
+
{
|
946 |
+
"epoch": 0.4536796536796537,
|
947 |
+
"grad_norm": 0.14154446443655647,
|
948 |
+
"learning_rate": 6.760969440306488e-05,
|
949 |
+
"loss": 1.7063,
|
950 |
+
"step": 131
|
951 |
+
},
|
952 |
+
{
|
953 |
+
"epoch": 0.45714285714285713,
|
954 |
+
"grad_norm": 0.14714279411071443,
|
955 |
+
"learning_rate": 6.710809111397414e-05,
|
956 |
+
"loss": 1.6543,
|
957 |
+
"step": 132
|
958 |
+
},
|
959 |
+
{
|
960 |
+
"epoch": 0.46060606060606063,
|
961 |
+
"grad_norm": 0.1457931614410346,
|
962 |
+
"learning_rate": 6.66048606584362e-05,
|
963 |
+
"loss": 1.7306,
|
964 |
+
"step": 133
|
965 |
+
},
|
966 |
+
{
|
967 |
+
"epoch": 0.4640692640692641,
|
968 |
+
"grad_norm": 0.1820287707917239,
|
969 |
+
"learning_rate": 6.610007066393298e-05,
|
970 |
+
"loss": 1.7588,
|
971 |
+
"step": 134
|
972 |
+
},
|
973 |
+
{
|
974 |
+
"epoch": 0.4675324675324675,
|
975 |
+
"grad_norm": 0.13406985602901073,
|
976 |
+
"learning_rate": 6.559378896752764e-05,
|
977 |
+
"loss": 1.6295,
|
978 |
+
"step": 135
|
979 |
+
},
|
980 |
+
{
|
981 |
+
"epoch": 0.470995670995671,
|
982 |
+
"grad_norm": 0.1432972375320372,
|
983 |
+
"learning_rate": 6.508608360674825e-05,
|
984 |
+
"loss": 1.7229,
|
985 |
+
"step": 136
|
986 |
+
},
|
987 |
+
{
|
988 |
+
"epoch": 0.47445887445887447,
|
989 |
+
"grad_norm": 0.1428289854884471,
|
990 |
+
"learning_rate": 6.457702281044451e-05,
|
991 |
+
"loss": 1.7604,
|
992 |
+
"step": 137
|
993 |
+
},
|
994 |
+
{
|
995 |
+
"epoch": 0.4779220779220779,
|
996 |
+
"grad_norm": 0.19259569118792785,
|
997 |
+
"learning_rate": 6.406667498961853e-05,
|
998 |
+
"loss": 1.7896,
|
999 |
+
"step": 138
|
1000 |
+
},
|
1001 |
+
{
|
1002 |
+
"epoch": 0.48138528138528136,
|
1003 |
+
"grad_norm": 0.1864354045164866,
|
1004 |
+
"learning_rate": 6.355510872823144e-05,
|
1005 |
+
"loss": 1.7054,
|
1006 |
+
"step": 139
|
1007 |
+
},
|
1008 |
+
{
|
1009 |
+
"epoch": 0.48484848484848486,
|
1010 |
+
"grad_norm": 0.16126945970699844,
|
1011 |
+
"learning_rate": 6.304239277398663e-05,
|
1012 |
+
"loss": 1.617,
|
1013 |
+
"step": 140
|
1014 |
+
},
|
1015 |
+
{
|
1016 |
+
"epoch": 0.4883116883116883,
|
1017 |
+
"grad_norm": 0.16374325192757327,
|
1018 |
+
"learning_rate": 6.252859602909085e-05,
|
1019 |
+
"loss": 1.7218,
|
1020 |
+
"step": 141
|
1021 |
+
},
|
1022 |
+
{
|
1023 |
+
"epoch": 0.49177489177489175,
|
1024 |
+
"grad_norm": 0.1952160819129351,
|
1025 |
+
"learning_rate": 6.201378754099481e-05,
|
1026 |
+
"loss": 1.6761,
|
1027 |
+
"step": 142
|
1028 |
+
},
|
1029 |
+
{
|
1030 |
+
"epoch": 0.49523809523809526,
|
1031 |
+
"grad_norm": 0.21245873164185414,
|
1032 |
+
"learning_rate": 6.149803649311398e-05,
|
1033 |
+
"loss": 1.7334,
|
1034 |
+
"step": 143
|
1035 |
+
},
|
1036 |
+
{
|
1037 |
+
"epoch": 0.4987012987012987,
|
1038 |
+
"grad_norm": 0.26373074560690185,
|
1039 |
+
"learning_rate": 6.0981412195531394e-05,
|
1040 |
+
"loss": 1.7975,
|
1041 |
+
"step": 144
|
1042 |
+
},
|
1043 |
+
{
|
1044 |
+
"epoch": 0.5021645021645021,
|
1045 |
+
"grad_norm": 0.13130587484364126,
|
1046 |
+
"learning_rate": 6.046398407568321e-05,
|
1047 |
+
"loss": 1.6963,
|
1048 |
+
"step": 145
|
1049 |
+
},
|
1050 |
+
{
|
1051 |
+
"epoch": 0.5056277056277056,
|
1052 |
+
"grad_norm": 0.2946558079919653,
|
1053 |
+
"learning_rate": 5.994582166902862e-05,
|
1054 |
+
"loss": 1.6738,
|
1055 |
+
"step": 146
|
1056 |
+
},
|
1057 |
+
{
|
1058 |
+
"epoch": 0.509090909090909,
|
1059 |
+
"grad_norm": 0.1504401196101401,
|
1060 |
+
"learning_rate": 5.9426994609705167e-05,
|
1061 |
+
"loss": 1.7497,
|
1062 |
+
"step": 147
|
1063 |
+
},
|
1064 |
+
{
|
1065 |
+
"epoch": 0.5125541125541125,
|
1066 |
+
"grad_norm": 0.1699306898333981,
|
1067 |
+
"learning_rate": 5.890757262117092e-05,
|
1068 |
+
"loss": 1.7837,
|
1069 |
+
"step": 148
|
1070 |
+
},
|
1071 |
+
{
|
1072 |
+
"epoch": 0.516017316017316,
|
1073 |
+
"grad_norm": 0.17221685345492665,
|
1074 |
+
"learning_rate": 5.838762550683449e-05,
|
1075 |
+
"loss": 1.7598,
|
1076 |
+
"step": 149
|
1077 |
+
},
|
1078 |
+
{
|
1079 |
+
"epoch": 0.5194805194805194,
|
1080 |
+
"grad_norm": 0.14578009779117443,
|
1081 |
+
"learning_rate": 5.786722314067443e-05,
|
1082 |
+
"loss": 1.7327,
|
1083 |
+
"step": 150
|
1084 |
+
},
|
1085 |
+
{
|
1086 |
+
"epoch": 0.5229437229437229,
|
1087 |
+
"grad_norm": 0.12696754203014826,
|
1088 |
+
"learning_rate": 5.7346435457849077e-05,
|
1089 |
+
"loss": 1.8431,
|
1090 |
+
"step": 151
|
1091 |
+
},
|
1092 |
+
{
|
1093 |
+
"epoch": 0.5264069264069264,
|
1094 |
+
"grad_norm": 0.2762648056037374,
|
1095 |
+
"learning_rate": 5.68253324452982e-05,
|
1096 |
+
"loss": 1.8256,
|
1097 |
+
"step": 152
|
1098 |
+
},
|
1099 |
+
{
|
1100 |
+
"epoch": 0.5298701298701298,
|
1101 |
+
"grad_norm": 0.16006386814999288,
|
1102 |
+
"learning_rate": 5.630398413233771e-05,
|
1103 |
+
"loss": 1.5694,
|
1104 |
+
"step": 153
|
1105 |
+
},
|
1106 |
+
{
|
1107 |
+
"epoch": 0.5333333333333333,
|
1108 |
+
"grad_norm": 0.26526907326241866,
|
1109 |
+
"learning_rate": 5.5782460581248605e-05,
|
1110 |
+
"loss": 1.6618,
|
1111 |
+
"step": 154
|
1112 |
+
},
|
1113 |
+
{
|
1114 |
+
"epoch": 0.5367965367965368,
|
1115 |
+
"grad_norm": 0.16031072879740277,
|
1116 |
+
"learning_rate": 5.5260831877861595e-05,
|
1117 |
+
"loss": 1.7254,
|
1118 |
+
"step": 155
|
1119 |
+
},
|
1120 |
+
{
|
1121 |
+
"epoch": 0.5402597402597402,
|
1122 |
+
"grad_norm": 0.33676205223750044,
|
1123 |
+
"learning_rate": 5.473916812213843e-05,
|
1124 |
+
"loss": 1.6954,
|
1125 |
+
"step": 156
|
1126 |
+
},
|
1127 |
+
{
|
1128 |
+
"epoch": 0.5437229437229437,
|
1129 |
+
"grad_norm": 0.19851104745562503,
|
1130 |
+
"learning_rate": 5.421753941875139e-05,
|
1131 |
+
"loss": 1.6451,
|
1132 |
+
"step": 157
|
1133 |
+
},
|
1134 |
+
{
|
1135 |
+
"epoch": 0.5471861471861472,
|
1136 |
+
"grad_norm": 0.14860904648265985,
|
1137 |
+
"learning_rate": 5.369601586766231e-05,
|
1138 |
+
"loss": 1.6706,
|
1139 |
+
"step": 158
|
1140 |
+
},
|
1141 |
+
{
|
1142 |
+
"epoch": 0.5506493506493506,
|
1143 |
+
"grad_norm": 0.1918922225725335,
|
1144 |
+
"learning_rate": 5.3174667554701807e-05,
|
1145 |
+
"loss": 1.7438,
|
1146 |
+
"step": 159
|
1147 |
+
},
|
1148 |
+
{
|
1149 |
+
"epoch": 0.5541125541125541,
|
1150 |
+
"grad_norm": 0.14075522683093092,
|
1151 |
+
"learning_rate": 5.265356454215095e-05,
|
1152 |
+
"loss": 1.7224,
|
1153 |
+
"step": 160
|
1154 |
+
},
|
1155 |
+
{
|
1156 |
+
"epoch": 0.5575757575757576,
|
1157 |
+
"grad_norm": 0.15496076267116046,
|
1158 |
+
"learning_rate": 5.2132776859325595e-05,
|
1159 |
+
"loss": 1.782,
|
1160 |
+
"step": 161
|
1161 |
+
},
|
1162 |
+
{
|
1163 |
+
"epoch": 0.561038961038961,
|
1164 |
+
"grad_norm": 0.14206902015954567,
|
1165 |
+
"learning_rate": 5.161237449316553e-05,
|
1166 |
+
"loss": 1.7243,
|
1167 |
+
"step": 162
|
1168 |
+
},
|
1169 |
+
{
|
1170 |
+
"epoch": 0.5645021645021645,
|
1171 |
+
"grad_norm": 0.14890489490820047,
|
1172 |
+
"learning_rate": 5.109242737882909e-05,
|
1173 |
+
"loss": 1.7799,
|
1174 |
+
"step": 163
|
1175 |
+
},
|
1176 |
+
{
|
1177 |
+
"epoch": 0.567965367965368,
|
1178 |
+
"grad_norm": 0.16028268624898823,
|
1179 |
+
"learning_rate": 5.057300539029484e-05,
|
1180 |
+
"loss": 1.4963,
|
1181 |
+
"step": 164
|
1182 |
+
},
|
1183 |
+
{
|
1184 |
+
"epoch": 0.5714285714285714,
|
1185 |
+
"grad_norm": 0.2051022099288977,
|
1186 |
+
"learning_rate": 5.00541783309714e-05,
|
1187 |
+
"loss": 1.8039,
|
1188 |
+
"step": 165
|
1189 |
+
},
|
1190 |
+
{
|
1191 |
+
"epoch": 0.5748917748917749,
|
1192 |
+
"grad_norm": 0.15327061149973434,
|
1193 |
+
"learning_rate": 4.953601592431679e-05,
|
1194 |
+
"loss": 1.7388,
|
1195 |
+
"step": 166
|
1196 |
+
},
|
1197 |
+
{
|
1198 |
+
"epoch": 0.5783549783549784,
|
1199 |
+
"grad_norm": 0.16523339444574944,
|
1200 |
+
"learning_rate": 4.9018587804468616e-05,
|
1201 |
+
"loss": 1.729,
|
1202 |
+
"step": 167
|
1203 |
+
},
|
1204 |
+
{
|
1205 |
+
"epoch": 0.5818181818181818,
|
1206 |
+
"grad_norm": 0.1727169607709046,
|
1207 |
+
"learning_rate": 4.8501963506886026e-05,
|
1208 |
+
"loss": 1.6802,
|
1209 |
+
"step": 168
|
1210 |
+
},
|
1211 |
+
{
|
1212 |
+
"epoch": 0.5852813852813853,
|
1213 |
+
"grad_norm": 0.1597167200325283,
|
1214 |
+
"learning_rate": 4.798621245900522e-05,
|
1215 |
+
"loss": 1.6909,
|
1216 |
+
"step": 169
|
1217 |
+
},
|
1218 |
+
{
|
1219 |
+
"epoch": 0.5887445887445888,
|
1220 |
+
"grad_norm": 0.16533426273811605,
|
1221 |
+
"learning_rate": 4.747140397090915e-05,
|
1222 |
+
"loss": 1.7411,
|
1223 |
+
"step": 170
|
1224 |
+
},
|
1225 |
+
{
|
1226 |
+
"epoch": 0.5922077922077922,
|
1227 |
+
"grad_norm": 0.15690121637261828,
|
1228 |
+
"learning_rate": 4.6957607226013386e-05,
|
1229 |
+
"loss": 1.6433,
|
1230 |
+
"step": 171
|
1231 |
+
},
|
1232 |
+
{
|
1233 |
+
"epoch": 0.5956709956709957,
|
1234 |
+
"grad_norm": 0.14430263110279673,
|
1235 |
+
"learning_rate": 4.6444891271768585e-05,
|
1236 |
+
"loss": 1.4937,
|
1237 |
+
"step": 172
|
1238 |
+
},
|
1239 |
+
{
|
1240 |
+
"epoch": 0.5991341991341992,
|
1241 |
+
"grad_norm": 0.20258648466753146,
|
1242 |
+
"learning_rate": 4.593332501038149e-05,
|
1243 |
+
"loss": 1.7678,
|
1244 |
+
"step": 173
|
1245 |
+
},
|
1246 |
+
{
|
1247 |
+
"epoch": 0.6025974025974026,
|
1248 |
+
"grad_norm": 0.21379822253391412,
|
1249 |
+
"learning_rate": 4.542297718955552e-05,
|
1250 |
+
"loss": 1.7766,
|
1251 |
+
"step": 174
|
1252 |
+
},
|
1253 |
+
{
|
1254 |
+
"epoch": 0.6060606060606061,
|
1255 |
+
"grad_norm": 0.254670201330481,
|
1256 |
+
"learning_rate": 4.491391639325176e-05,
|
1257 |
+
"loss": 1.5055,
|
1258 |
+
"step": 175
|
1259 |
+
},
|
1260 |
+
{
|
1261 |
+
"epoch": 0.6095238095238096,
|
1262 |
+
"grad_norm": 0.14982857678293512,
|
1263 |
+
"learning_rate": 4.440621103247237e-05,
|
1264 |
+
"loss": 1.811,
|
1265 |
+
"step": 176
|
1266 |
+
},
|
1267 |
+
{
|
1268 |
+
"epoch": 0.612987012987013,
|
1269 |
+
"grad_norm": 0.3221501849805362,
|
1270 |
+
"learning_rate": 4.3899929336067026e-05,
|
1271 |
+
"loss": 1.7188,
|
1272 |
+
"step": 177
|
1273 |
+
},
|
1274 |
+
{
|
1275 |
+
"epoch": 0.612987012987013,
|
1276 |
+
"eval_loss": 1.9185175895690918,
|
1277 |
+
"eval_runtime": 293.6672,
|
1278 |
+
"eval_samples_per_second": 0.341,
|
1279 |
+
"eval_steps_per_second": 0.17,
|
1280 |
+
"step": 177
|
1281 |
+
}
|
1282 |
+
],
|
1283 |
+
"logging_steps": 1,
|
1284 |
+
"max_steps": 291,
|
1285 |
+
"num_input_tokens_seen": 0,
|
1286 |
+
"num_train_epochs": 1,
|
1287 |
+
"save_steps": 59,
|
1288 |
+
"stateful_callbacks": {
|
1289 |
+
"TrainerControl": {
|
1290 |
+
"args": {
|
1291 |
+
"should_epoch_stop": false,
|
1292 |
+
"should_evaluate": false,
|
1293 |
+
"should_log": false,
|
1294 |
+
"should_save": true,
|
1295 |
+
"should_training_stop": false
|
1296 |
+
},
|
1297 |
+
"attributes": {}
|
1298 |
+
}
|
1299 |
+
},
|
1300 |
+
"total_flos": 2.111476937313485e+16,
|
1301 |
+
"train_batch_size": 1,
|
1302 |
+
"trial_name": null,
|
1303 |
+
"trial_params": null
|
1304 |
+
}
|
checkpoint-177/training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:843884dd10ab30b7127fadbe59f5e112466975c7b39447c70dc1e79f47c6795c
|
3 |
+
size 8184
|
checkpoint-177/zero_to_fp32.py
ADDED
@@ -0,0 +1,604 @@
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
|
3 |
+
# Copyright (c) Microsoft Corporation.
|
4 |
+
# SPDX-License-Identifier: Apache-2.0
|
5 |
+
|
6 |
+
# DeepSpeed Team
|
7 |
+
|
8 |
+
# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
|
9 |
+
# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
|
10 |
+
# the future. Once extracted, the weights don't require DeepSpeed and can be used in any
|
11 |
+
# application.
|
12 |
+
#
|
13 |
+
# example: python zero_to_fp32.py . pytorch_model.bin
|
14 |
+
|
15 |
+
import argparse
|
16 |
+
import torch
|
17 |
+
import glob
|
18 |
+
import math
|
19 |
+
import os
|
20 |
+
import re
|
21 |
+
from collections import OrderedDict
|
22 |
+
from dataclasses import dataclass
|
23 |
+
|
24 |
+
# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
|
25 |
+
# DeepSpeed data structures it has to be available in the current python environment.
|
26 |
+
from deepspeed.utils import logger
|
27 |
+
from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
|
28 |
+
FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
|
29 |
+
FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
|
30 |
+
|
31 |
+
|
32 |
+
@dataclass
|
33 |
+
class zero_model_state:
|
34 |
+
buffers: dict()
|
35 |
+
param_shapes: dict()
|
36 |
+
shared_params: list
|
37 |
+
ds_version: int
|
38 |
+
frozen_param_shapes: dict()
|
39 |
+
frozen_param_fragments: dict()
|
40 |
+
|
41 |
+
|
42 |
+
debug = 0
|
43 |
+
|
44 |
+
# load to cpu
|
45 |
+
device = torch.device('cpu')
|
46 |
+
|
47 |
+
|
48 |
+
def atoi(text):
|
49 |
+
return int(text) if text.isdigit() else text
|
50 |
+
|
51 |
+
|
52 |
+
def natural_keys(text):
|
53 |
+
'''
|
54 |
+
alist.sort(key=natural_keys) sorts in human order
|
55 |
+
http://nedbatchelder.com/blog/200712/human_sorting.html
|
56 |
+
(See Toothy's implementation in the comments)
|
57 |
+
'''
|
58 |
+
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
59 |
+
|
60 |
+
|
61 |
+
def get_model_state_file(checkpoint_dir, zero_stage):
|
62 |
+
if not os.path.isdir(checkpoint_dir):
|
63 |
+
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
|
64 |
+
|
65 |
+
# there should be only one file
|
66 |
+
if zero_stage <= 2:
|
67 |
+
file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
|
68 |
+
elif zero_stage == 3:
|
69 |
+
file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
|
70 |
+
|
71 |
+
if not os.path.exists(file):
|
72 |
+
raise FileNotFoundError(f"can't find model states file at '{file}'")
|
73 |
+
|
74 |
+
return file
|
75 |
+
|
76 |
+
|
77 |
+
def get_checkpoint_files(checkpoint_dir, glob_pattern):
|
78 |
+
# XXX: need to test that this simple glob rule works for multi-node setup too
|
79 |
+
ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
|
80 |
+
|
81 |
+
if len(ckpt_files) == 0:
|
82 |
+
raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
|
83 |
+
|
84 |
+
return ckpt_files
|
85 |
+
|
86 |
+
|
87 |
+
def get_optim_files(checkpoint_dir):
|
88 |
+
return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
|
89 |
+
|
90 |
+
|
91 |
+
def get_model_state_files(checkpoint_dir):
|
92 |
+
return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
|
93 |
+
|
94 |
+
|
95 |
+
def parse_model_states(files):
|
96 |
+
zero_model_states = []
|
97 |
+
for file in files:
|
98 |
+
state_dict = torch.load(file, map_location=device)
|
99 |
+
|
100 |
+
if BUFFER_NAMES not in state_dict:
|
101 |
+
raise ValueError(f"{file} is not a model state checkpoint")
|
102 |
+
buffer_names = state_dict[BUFFER_NAMES]
|
103 |
+
if debug:
|
104 |
+
print("Found buffers:", buffer_names)
|
105 |
+
|
106 |
+
# recover just the buffers while restoring them to fp32 if they were saved in fp16
|
107 |
+
buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
|
108 |
+
param_shapes = state_dict[PARAM_SHAPES]
|
109 |
+
|
110 |
+
# collect parameters that are included in param_shapes
|
111 |
+
param_names = []
|
112 |
+
for s in param_shapes:
|
113 |
+
for name in s.keys():
|
114 |
+
param_names.append(name)
|
115 |
+
|
116 |
+
# update with frozen parameters
|
117 |
+
frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
|
118 |
+
if frozen_param_shapes is not None:
|
119 |
+
if debug:
|
120 |
+
print(f"Found frozen_param_shapes: {frozen_param_shapes}")
|
121 |
+
param_names += list(frozen_param_shapes.keys())
|
122 |
+
|
123 |
+
# handle shared params
|
124 |
+
shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
|
125 |
+
|
126 |
+
ds_version = state_dict.get(DS_VERSION, None)
|
127 |
+
|
128 |
+
frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
|
129 |
+
|
130 |
+
z_model_state = zero_model_state(buffers=buffers,
|
131 |
+
param_shapes=param_shapes,
|
132 |
+
shared_params=shared_params,
|
133 |
+
ds_version=ds_version,
|
134 |
+
frozen_param_shapes=frozen_param_shapes,
|
135 |
+
frozen_param_fragments=frozen_param_fragments)
|
136 |
+
zero_model_states.append(z_model_state)
|
137 |
+
|
138 |
+
return zero_model_states
|
139 |
+
|
140 |
+
|
141 |
+
def parse_optim_states(files, ds_checkpoint_dir):
|
142 |
+
|
143 |
+
total_files = len(files)
|
144 |
+
state_dicts = []
|
145 |
+
for f in files:
|
146 |
+
state_dict = torch.load(f, map_location=device)
|
147 |
+
# immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
|
148 |
+
# and also handle the case where it was already removed by another helper script
|
149 |
+
state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
|
150 |
+
state_dicts.append(state_dict)
|
151 |
+
|
152 |
+
if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
|
153 |
+
raise ValueError(f"{files[0]} is not a zero checkpoint")
|
154 |
+
zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
|
155 |
+
world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
|
156 |
+
|
157 |
+
# For ZeRO-2 each param group can have different partition_count as data parallelism for expert
|
158 |
+
# parameters can be different from data parallelism for non-expert parameters. So we can just
|
159 |
+
# use the max of the partition_count to get the dp world_size.
|
160 |
+
|
161 |
+
if type(world_size) is list:
|
162 |
+
world_size = max(world_size)
|
163 |
+
|
164 |
+
if world_size != total_files:
|
165 |
+
raise ValueError(
|
166 |
+
f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
|
167 |
+
"Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
|
168 |
+
)
|
169 |
+
|
170 |
+
# the groups are named differently in each stage
|
171 |
+
if zero_stage <= 2:
|
172 |
+
fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
|
173 |
+
elif zero_stage == 3:
|
174 |
+
fp32_groups_key = FP32_FLAT_GROUPS
|
175 |
+
else:
|
176 |
+
raise ValueError(f"unknown zero stage {zero_stage}")
|
177 |
+
|
178 |
+
if zero_stage <= 2:
|
179 |
+
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
|
180 |
+
elif zero_stage == 3:
|
181 |
+
# if there is more than one param group, there will be multiple flattened tensors - one
|
182 |
+
# flattened tensor per group - for simplicity merge them into a single tensor
|
183 |
+
#
|
184 |
+
# XXX: could make the script more memory efficient for when there are multiple groups - it
|
185 |
+
# will require matching the sub-lists of param_shapes for each param group flattened tensor
|
186 |
+
|
187 |
+
fp32_flat_groups = [
|
188 |
+
torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) for i in range(len(state_dicts))
|
189 |
+
]
|
190 |
+
|
191 |
+
return zero_stage, world_size, fp32_flat_groups
|
192 |
+
|
193 |
+
|
194 |
+
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
|
195 |
+
"""
|
196 |
+
Returns fp32 state_dict reconstructed from ds checkpoint
|
197 |
+
|
198 |
+
Args:
|
199 |
+
- ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
|
200 |
+
|
201 |
+
"""
|
202 |
+
print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
|
203 |
+
|
204 |
+
optim_files = get_optim_files(ds_checkpoint_dir)
|
205 |
+
zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
|
206 |
+
print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
|
207 |
+
|
208 |
+
model_files = get_model_state_files(ds_checkpoint_dir)
|
209 |
+
|
210 |
+
zero_model_states = parse_model_states(model_files)
|
211 |
+
print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
|
212 |
+
|
213 |
+
if zero_stage <= 2:
|
214 |
+
return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
215 |
+
exclude_frozen_parameters)
|
216 |
+
elif zero_stage == 3:
|
217 |
+
return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
218 |
+
exclude_frozen_parameters)
|
219 |
+
|
220 |
+
|
221 |
+
def _zero2_merge_frozen_params(state_dict, zero_model_states):
|
222 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
223 |
+
return
|
224 |
+
|
225 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
226 |
+
frozen_param_fragments = zero_model_states[0].frozen_param_fragments
|
227 |
+
|
228 |
+
if debug:
|
229 |
+
num_elem = sum(s.numel() for s in frozen_param_shapes.values())
|
230 |
+
print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
231 |
+
|
232 |
+
wanted_params = len(frozen_param_shapes)
|
233 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
234 |
+
avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
|
235 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
236 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
237 |
+
|
238 |
+
total_params = 0
|
239 |
+
total_numel = 0
|
240 |
+
for name, shape in frozen_param_shapes.items():
|
241 |
+
total_params += 1
|
242 |
+
unpartitioned_numel = shape.numel()
|
243 |
+
total_numel += unpartitioned_numel
|
244 |
+
|
245 |
+
state_dict[name] = frozen_param_fragments[name]
|
246 |
+
|
247 |
+
if debug:
|
248 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
249 |
+
|
250 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
251 |
+
|
252 |
+
|
253 |
+
def _has_callable(obj, fn):
|
254 |
+
attr = getattr(obj, fn, None)
|
255 |
+
return callable(attr)
|
256 |
+
|
257 |
+
|
258 |
+
def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
259 |
+
param_shapes = zero_model_states[0].param_shapes
|
260 |
+
|
261 |
+
# Reconstruction protocol:
|
262 |
+
#
|
263 |
+
# XXX: document this
|
264 |
+
|
265 |
+
if debug:
|
266 |
+
for i in range(world_size):
|
267 |
+
for j in range(len(fp32_flat_groups[0])):
|
268 |
+
print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
|
269 |
+
|
270 |
+
# XXX: memory usage doubles here (zero2)
|
271 |
+
num_param_groups = len(fp32_flat_groups[0])
|
272 |
+
merged_single_partition_of_fp32_groups = []
|
273 |
+
for i in range(num_param_groups):
|
274 |
+
merged_partitions = [sd[i] for sd in fp32_flat_groups]
|
275 |
+
full_single_fp32_vector = torch.cat(merged_partitions, 0)
|
276 |
+
merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
|
277 |
+
avail_numel = sum(
|
278 |
+
[full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
|
279 |
+
|
280 |
+
if debug:
|
281 |
+
wanted_params = sum([len(shapes) for shapes in param_shapes])
|
282 |
+
wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
|
283 |
+
# not asserting if there is a mismatch due to possible padding
|
284 |
+
print(f"Have {avail_numel} numels to process.")
|
285 |
+
print(f"Need {wanted_numel} numels in {wanted_params} params.")
|
286 |
+
|
287 |
+
# params
|
288 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
289 |
+
# out-of-core computing solution
|
290 |
+
total_numel = 0
|
291 |
+
total_params = 0
|
292 |
+
for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
|
293 |
+
offset = 0
|
294 |
+
avail_numel = full_single_fp32_vector.numel()
|
295 |
+
for name, shape in shapes.items():
|
296 |
+
|
297 |
+
unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
|
298 |
+
total_numel += unpartitioned_numel
|
299 |
+
total_params += 1
|
300 |
+
|
301 |
+
if debug:
|
302 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
303 |
+
state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
|
304 |
+
offset += unpartitioned_numel
|
305 |
+
|
306 |
+
# Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
|
307 |
+
# avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
|
308 |
+
# paddings performed in the code it's almost impossible to predict the exact numbers w/o the
|
309 |
+
# live optimizer object, so we are checking that the numbers are within the right range
|
310 |
+
align_to = 2 * world_size
|
311 |
+
|
312 |
+
def zero2_align(x):
|
313 |
+
return align_to * math.ceil(x / align_to)
|
314 |
+
|
315 |
+
if debug:
|
316 |
+
print(f"original offset={offset}, avail_numel={avail_numel}")
|
317 |
+
|
318 |
+
offset = zero2_align(offset)
|
319 |
+
avail_numel = zero2_align(avail_numel)
|
320 |
+
|
321 |
+
if debug:
|
322 |
+
print(f"aligned offset={offset}, avail_numel={avail_numel}")
|
323 |
+
|
324 |
+
# Sanity check
|
325 |
+
if offset != avail_numel:
|
326 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
327 |
+
|
328 |
+
print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
|
329 |
+
|
330 |
+
|
331 |
+
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
332 |
+
exclude_frozen_parameters):
|
333 |
+
state_dict = OrderedDict()
|
334 |
+
|
335 |
+
# buffers
|
336 |
+
buffers = zero_model_states[0].buffers
|
337 |
+
state_dict.update(buffers)
|
338 |
+
if debug:
|
339 |
+
print(f"added {len(buffers)} buffers")
|
340 |
+
|
341 |
+
if not exclude_frozen_parameters:
|
342 |
+
_zero2_merge_frozen_params(state_dict, zero_model_states)
|
343 |
+
|
344 |
+
_zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
345 |
+
|
346 |
+
# recover shared parameters
|
347 |
+
for pair in zero_model_states[0].shared_params:
|
348 |
+
if pair[1] in state_dict:
|
349 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
350 |
+
|
351 |
+
return state_dict
|
352 |
+
|
353 |
+
|
354 |
+
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
|
355 |
+
remainder = unpartitioned_numel % world_size
|
356 |
+
padding_numel = (world_size - remainder) if remainder else 0
|
357 |
+
partitioned_numel = math.ceil(unpartitioned_numel / world_size)
|
358 |
+
return partitioned_numel, padding_numel
|
359 |
+
|
360 |
+
|
361 |
+
def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
|
362 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
363 |
+
return
|
364 |
+
|
365 |
+
if debug:
|
366 |
+
for i in range(world_size):
|
367 |
+
num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
|
368 |
+
print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
369 |
+
|
370 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
371 |
+
wanted_params = len(frozen_param_shapes)
|
372 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
373 |
+
avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
|
374 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
375 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
376 |
+
|
377 |
+
total_params = 0
|
378 |
+
total_numel = 0
|
379 |
+
for name, shape in zero_model_states[0].frozen_param_shapes.items():
|
380 |
+
total_params += 1
|
381 |
+
unpartitioned_numel = shape.numel()
|
382 |
+
total_numel += unpartitioned_numel
|
383 |
+
|
384 |
+
param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
|
385 |
+
state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
|
386 |
+
|
387 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
388 |
+
|
389 |
+
if debug:
|
390 |
+
print(
|
391 |
+
f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
392 |
+
)
|
393 |
+
|
394 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
395 |
+
|
396 |
+
|
397 |
+
def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
398 |
+
param_shapes = zero_model_states[0].param_shapes
|
399 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
400 |
+
# Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
|
401 |
+
# param, re-consolidating each param, while dealing with padding if any
|
402 |
+
|
403 |
+
# merge list of dicts, preserving order
|
404 |
+
param_shapes = {k: v for d in param_shapes for k, v in d.items()}
|
405 |
+
|
406 |
+
if debug:
|
407 |
+
for i in range(world_size):
|
408 |
+
print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
|
409 |
+
|
410 |
+
wanted_params = len(param_shapes)
|
411 |
+
wanted_numel = sum(shape.numel() for shape in param_shapes.values())
|
412 |
+
# not asserting if there is a mismatch due to possible padding
|
413 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
414 |
+
print(f"Trainable params: Have {avail_numel} numels to process.")
|
415 |
+
print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
|
416 |
+
|
417 |
+
# params
|
418 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
419 |
+
# out-of-core computing solution
|
420 |
+
offset = 0
|
421 |
+
total_numel = 0
|
422 |
+
total_params = 0
|
423 |
+
for name, shape in param_shapes.items():
|
424 |
+
|
425 |
+
unpartitioned_numel = shape.numel()
|
426 |
+
total_numel += unpartitioned_numel
|
427 |
+
total_params += 1
|
428 |
+
|
429 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
430 |
+
|
431 |
+
if debug:
|
432 |
+
print(
|
433 |
+
f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
434 |
+
)
|
435 |
+
|
436 |
+
# XXX: memory usage doubles here
|
437 |
+
state_dict[name] = torch.cat(
|
438 |
+
tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
|
439 |
+
0).narrow(0, 0, unpartitioned_numel).view(shape)
|
440 |
+
offset += partitioned_numel
|
441 |
+
|
442 |
+
offset *= world_size
|
443 |
+
|
444 |
+
# Sanity check
|
445 |
+
if offset != avail_numel:
|
446 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
447 |
+
|
448 |
+
print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
|
449 |
+
|
450 |
+
|
451 |
+
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
452 |
+
exclude_frozen_parameters):
|
453 |
+
state_dict = OrderedDict()
|
454 |
+
|
455 |
+
# buffers
|
456 |
+
buffers = zero_model_states[0].buffers
|
457 |
+
state_dict.update(buffers)
|
458 |
+
if debug:
|
459 |
+
print(f"added {len(buffers)} buffers")
|
460 |
+
|
461 |
+
if not exclude_frozen_parameters:
|
462 |
+
_zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
|
463 |
+
|
464 |
+
_zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
465 |
+
|
466 |
+
# recover shared parameters
|
467 |
+
for pair in zero_model_states[0].shared_params:
|
468 |
+
if pair[1] in state_dict:
|
469 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
470 |
+
|
471 |
+
return state_dict
|
472 |
+
|
473 |
+
|
474 |
+
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=False):
|
475 |
+
"""
|
476 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
|
477 |
+
``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
|
478 |
+
via a model hub.
|
479 |
+
|
480 |
+
Args:
|
481 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder
|
482 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
|
483 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
484 |
+
|
485 |
+
Returns:
|
486 |
+
- pytorch ``state_dict``
|
487 |
+
|
488 |
+
Note: this approach may not work if your application doesn't have sufficient free CPU memory and
|
489 |
+
you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
|
490 |
+
the checkpoint.
|
491 |
+
|
492 |
+
A typical usage might be ::
|
493 |
+
|
494 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
495 |
+
# do the training and checkpoint saving
|
496 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
|
497 |
+
model = model.cpu() # move to cpu
|
498 |
+
model.load_state_dict(state_dict)
|
499 |
+
# submit to model hub or save the model to share with others
|
500 |
+
|
501 |
+
In this example the ``model`` will no longer be usable in the deepspeed context of the same
|
502 |
+
application. i.e. you will need to re-initialize the deepspeed engine, since
|
503 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
504 |
+
|
505 |
+
If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
|
506 |
+
|
507 |
+
"""
|
508 |
+
if tag is None:
|
509 |
+
latest_path = os.path.join(checkpoint_dir, 'latest')
|
510 |
+
if os.path.isfile(latest_path):
|
511 |
+
with open(latest_path, 'r') as fd:
|
512 |
+
tag = fd.read().strip()
|
513 |
+
else:
|
514 |
+
raise ValueError(f"Unable to find 'latest' file at {latest_path}")
|
515 |
+
|
516 |
+
ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
|
517 |
+
|
518 |
+
if not os.path.isdir(ds_checkpoint_dir):
|
519 |
+
raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
|
520 |
+
|
521 |
+
return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
|
522 |
+
|
523 |
+
|
524 |
+
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, tag=None, exclude_frozen_parameters=False):
|
525 |
+
"""
|
526 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
|
527 |
+
loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
|
528 |
+
|
529 |
+
Args:
|
530 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
531 |
+
- ``output_file``: path to the pytorch fp32 state_dict output file (e.g. path/pytorch_model.bin)
|
532 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
533 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
534 |
+
"""
|
535 |
+
|
536 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
|
537 |
+
print(f"Saving fp32 state dict to {output_file}")
|
538 |
+
torch.save(state_dict, output_file)
|
539 |
+
|
540 |
+
|
541 |
+
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
|
542 |
+
"""
|
543 |
+
1. Put the provided model to cpu
|
544 |
+
2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
|
545 |
+
3. Load it into the provided model
|
546 |
+
|
547 |
+
Args:
|
548 |
+
- ``model``: the model object to update
|
549 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
550 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
551 |
+
|
552 |
+
Returns:
|
553 |
+
- ``model`: modified model
|
554 |
+
|
555 |
+
Make sure you have plenty of CPU memory available before you call this function. If you don't
|
556 |
+
have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
|
557 |
+
conveniently placed for you in the checkpoint folder.
|
558 |
+
|
559 |
+
A typical usage might be ::
|
560 |
+
|
561 |
+
from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
|
562 |
+
model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
|
563 |
+
# submit to model hub or save the model to share with others
|
564 |
+
|
565 |
+
Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
|
566 |
+
of the same application. i.e. you will need to re-initialize the deepspeed engine, since
|
567 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
568 |
+
|
569 |
+
"""
|
570 |
+
logger.info(f"Extracting fp32 weights")
|
571 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
|
572 |
+
|
573 |
+
logger.info(f"Overwriting model with fp32 weights")
|
574 |
+
model = model.cpu()
|
575 |
+
model.load_state_dict(state_dict, strict=False)
|
576 |
+
|
577 |
+
return model
|
578 |
+
|
579 |
+
|
580 |
+
if __name__ == "__main__":
|
581 |
+
|
582 |
+
parser = argparse.ArgumentParser()
|
583 |
+
parser.add_argument("checkpoint_dir",
|
584 |
+
type=str,
|
585 |
+
help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
|
586 |
+
parser.add_argument(
|
587 |
+
"output_file",
|
588 |
+
type=str,
|
589 |
+
help="path to the pytorch fp32 state_dict output file (e.g. path/checkpoint-12/pytorch_model.bin)")
|
590 |
+
parser.add_argument("-t",
|
591 |
+
"--tag",
|
592 |
+
type=str,
|
593 |
+
default=None,
|
594 |
+
help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
|
595 |
+
parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
|
596 |
+
parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
|
597 |
+
args = parser.parse_args()
|
598 |
+
|
599 |
+
debug = args.debug
|
600 |
+
|
601 |
+
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
|
602 |
+
args.output_file,
|
603 |
+
tag=args.tag,
|
604 |
+
exclude_frozen_parameters=args.exclude_frozen_parameters)
|