Doctor-Shotgun commited on
Commit
088588c
·
verified ·
1 Parent(s): 6275fc5

Training in progress, step 208, checkpoint

Browse files
Files changed (36) hide show
  1. checkpoint-208/README.md +202 -0
  2. checkpoint-208/adapter_config.json +42 -0
  3. checkpoint-208/adapter_model.safetensors +3 -0
  4. checkpoint-208/global_step208/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  5. checkpoint-208/global_step208/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  6. checkpoint-208/global_step208/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
  7. checkpoint-208/global_step208/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
  8. checkpoint-208/global_step208/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
  9. checkpoint-208/global_step208/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
  10. checkpoint-208/global_step208/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
  11. checkpoint-208/global_step208/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt +3 -0
  12. checkpoint-208/global_step208/zero_pp_rank_0_mp_rank_00_model_states.pt +3 -0
  13. checkpoint-208/global_step208/zero_pp_rank_1_mp_rank_00_model_states.pt +3 -0
  14. checkpoint-208/global_step208/zero_pp_rank_2_mp_rank_00_model_states.pt +3 -0
  15. checkpoint-208/global_step208/zero_pp_rank_3_mp_rank_00_model_states.pt +3 -0
  16. checkpoint-208/global_step208/zero_pp_rank_4_mp_rank_00_model_states.pt +3 -0
  17. checkpoint-208/global_step208/zero_pp_rank_5_mp_rank_00_model_states.pt +3 -0
  18. checkpoint-208/global_step208/zero_pp_rank_6_mp_rank_00_model_states.pt +3 -0
  19. checkpoint-208/global_step208/zero_pp_rank_7_mp_rank_00_model_states.pt +3 -0
  20. checkpoint-208/latest +1 -0
  21. checkpoint-208/rng_state_0.pth +3 -0
  22. checkpoint-208/rng_state_1.pth +3 -0
  23. checkpoint-208/rng_state_2.pth +3 -0
  24. checkpoint-208/rng_state_3.pth +3 -0
  25. checkpoint-208/rng_state_4.pth +3 -0
  26. checkpoint-208/rng_state_5.pth +3 -0
  27. checkpoint-208/rng_state_6.pth +3 -0
  28. checkpoint-208/rng_state_7.pth +3 -0
  29. checkpoint-208/scheduler.pt +3 -0
  30. checkpoint-208/special_tokens_map.json +30 -0
  31. checkpoint-208/tokenizer.json +0 -0
  32. checkpoint-208/tokenizer.model +3 -0
  33. checkpoint-208/tokenizer_config.json +0 -0
  34. checkpoint-208/trainer_state.json +1490 -0
  35. checkpoint-208/training_args.bin +3 -0
  36. checkpoint-208/zero_to_fp32.py +674 -0
checkpoint-208/README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: mistralai/Mistral-Large-Instruct-2411
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.15.2
checkpoint-208/adapter_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "mistralai/Mistral-Large-Instruct-2411",
5
+ "bias": "none",
6
+ "corda_config": null,
7
+ "eva_config": null,
8
+ "exclude_modules": null,
9
+ "fan_in_fan_out": null,
10
+ "inference_mode": true,
11
+ "init_lora_weights": true,
12
+ "layer_replication": null,
13
+ "layers_pattern": null,
14
+ "layers_to_transform": null,
15
+ "loftq_config": {},
16
+ "lora_alpha": 16,
17
+ "lora_bias": false,
18
+ "lora_dropout": 0.05,
19
+ "megatron_config": null,
20
+ "megatron_core": "megatron.core",
21
+ "modules_to_save": [
22
+ "embed_tokens",
23
+ "lm_head"
24
+ ],
25
+ "peft_type": "LORA",
26
+ "r": 128,
27
+ "rank_pattern": {},
28
+ "revision": null,
29
+ "target_modules": [
30
+ "k_proj",
31
+ "up_proj",
32
+ "q_proj",
33
+ "v_proj",
34
+ "o_proj",
35
+ "gate_proj",
36
+ "down_proj"
37
+ ],
38
+ "task_type": "CAUSAL_LM",
39
+ "trainable_token_indices": null,
40
+ "use_dora": false,
41
+ "use_rslora": true
42
+ }
checkpoint-208/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd29413c0c56980b112ca5f63fe6d184c960858904e68755a10ae321ff017d5f
3
+ size 6086108064
checkpoint-208/global_step208/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:ccf8027cd751ad1e7ef7088dc00a3bbe35dea9cd98f7d406b845f374dc5a9ac2
3
+ size 2682523907
checkpoint-208/global_step208/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:b8359e904479f454ede8aba8167f0c486ba0135f3cb031cd3f670c19840b0745
3
+ size 2682523907
checkpoint-208/global_step208/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3436f93d9ba364e98c71f831307cb7b039e490df88a784dd9158ada1fff8664
3
+ size 2682523907
checkpoint-208/global_step208/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c58405a8e1b0f1426237197ba06bd256eaf3ca6340035327cffe09823e7f2de7
3
+ size 2682523907
checkpoint-208/global_step208/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e8d2c59af4b28db557cc422b1d9000045e67d93089a028152bda937c52053a3
3
+ size 2682523907
checkpoint-208/global_step208/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d66c34ab4d0536a53df0f637689ada4d705004c6cb05da41c66077ece3e923d5
3
+ size 2682523907
checkpoint-208/global_step208/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8160ad94ea61c6af40a87222e8ac299eb794334f2900849fc22b6a809487d609
3
+ size 2682523907
checkpoint-208/global_step208/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c17e3f86b9a6c9d5e17ebf661e5f7386f22728902bd7fe21ac9ecf18017340a2
3
+ size 2682523907
checkpoint-208/global_step208/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:68030339bb95b80cdd1bab9f88f440c3032b9a8217bb7e883b60394f41166fa0
3
+ size 1226797
checkpoint-208/global_step208/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:95c1c5e14f17a71bc342b14a51148d97ed6955bf93824204950870a47a794faa
3
+ size 1226797
checkpoint-208/global_step208/zero_pp_rank_2_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8cb13952fc543bd05b5efae23600d4a0fbdf5024b0fe7da3cd6932bff40c094
3
+ size 1226797
checkpoint-208/global_step208/zero_pp_rank_3_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bad4207568c63337a4894a9475721143841ccd301d6e6e48e633d35ebc4a1904
3
+ size 1226797
checkpoint-208/global_step208/zero_pp_rank_4_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66d740532c4e226309015c2b01536bec17da378b578e649467172e215d0bd330
3
+ size 1226797
checkpoint-208/global_step208/zero_pp_rank_5_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bebe2459e4e00f61771479d0e489bb9363a584fbf5d4bec498326fc384f24ceb
3
+ size 1226797
checkpoint-208/global_step208/zero_pp_rank_6_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4578ee208c672f3c0bedfc9388e5be026d7278c8415913ec677be0eb01c89d5
3
+ size 1226797
checkpoint-208/global_step208/zero_pp_rank_7_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0166902d97aae4de51c361bf001e310c45529217484219b14c35f06c02a830ee
3
+ size 1226797
checkpoint-208/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step208
checkpoint-208/rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7daed31adb2bcbcd1158f9db2ccdd264af0ced94bdb99feb4e9ef0e279276c1
3
+ size 16389
checkpoint-208/rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7c5bd4942333ed5ac4884ef843e90f977dfbc43908dd77c365be358cc2c380d
3
+ size 16389
checkpoint-208/rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad8a805fbd04678f973acc547c92a2c6d0dfac9a5d4a377664252829901975fc
3
+ size 16389
checkpoint-208/rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abe53b5e80cf268a159920ac012c4533ca6756a46fa0610476614716081578ec
3
+ size 16389
checkpoint-208/rng_state_4.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e6315f475abf1927af6548bedd63a782d906c72558e973de1ad0a9d87d2654b
3
+ size 16389
checkpoint-208/rng_state_5.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14bff758a59f25da387a780b3f72f52f99a5a3544ec25495045a4b88134c6699
3
+ size 16389
checkpoint-208/rng_state_6.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f969e72443075d791a8a5569d91ebaf40495d7c45d6d4bb9af1ad2d431bdfa0b
3
+ size 16389
checkpoint-208/rng_state_7.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f45947f8980f04bca549a5a7e70d5cdc7d0e099fe6fee06d9688a8e71343b1d
3
+ size 16389
checkpoint-208/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06f96c7078f551e3c505d74211b9fddebdf5d4d89238dcb0077c545a2f87302f
3
+ size 1401
checkpoint-208/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-208/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-208/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b968b8dc352f42192367337c78ccc61e1eaddc6d641a579372d4f20694beb7a
3
+ size 587562
checkpoint-208/tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-208/trainer_state.json ADDED
@@ -0,0 +1,1490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.49939975990396157,
6
+ "eval_steps": 500,
7
+ "global_step": 208,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.0024009603841536613,
14
+ "grad_norm": 3.307639305281489,
15
+ "learning_rate": 0.0,
16
+ "loss": 1.027,
17
+ "step": 1
18
+ },
19
+ {
20
+ "epoch": 0.004801920768307323,
21
+ "grad_norm": 3.4815729475698585,
22
+ "learning_rate": 2.5000000000000004e-07,
23
+ "loss": 1.0887,
24
+ "step": 2
25
+ },
26
+ {
27
+ "epoch": 0.007202881152460984,
28
+ "grad_norm": 3.1919511484422025,
29
+ "learning_rate": 5.000000000000001e-07,
30
+ "loss": 0.9992,
31
+ "step": 3
32
+ },
33
+ {
34
+ "epoch": 0.009603841536614645,
35
+ "grad_norm": 3.192234811391807,
36
+ "learning_rate": 7.5e-07,
37
+ "loss": 1.0676,
38
+ "step": 4
39
+ },
40
+ {
41
+ "epoch": 0.012004801920768308,
42
+ "grad_norm": 3.147628945570283,
43
+ "learning_rate": 1.0000000000000002e-06,
44
+ "loss": 1.0932,
45
+ "step": 5
46
+ },
47
+ {
48
+ "epoch": 0.014405762304921969,
49
+ "grad_norm": 2.9173656342980085,
50
+ "learning_rate": 1.25e-06,
51
+ "loss": 1.0108,
52
+ "step": 6
53
+ },
54
+ {
55
+ "epoch": 0.01680672268907563,
56
+ "grad_norm": 2.965584304042035,
57
+ "learning_rate": 1.5e-06,
58
+ "loss": 1.0785,
59
+ "step": 7
60
+ },
61
+ {
62
+ "epoch": 0.01920768307322929,
63
+ "grad_norm": 2.6367740096927643,
64
+ "learning_rate": 1.75e-06,
65
+ "loss": 1.0562,
66
+ "step": 8
67
+ },
68
+ {
69
+ "epoch": 0.021608643457382955,
70
+ "grad_norm": 2.468163591370129,
71
+ "learning_rate": 2.0000000000000003e-06,
72
+ "loss": 1.0243,
73
+ "step": 9
74
+ },
75
+ {
76
+ "epoch": 0.024009603841536616,
77
+ "grad_norm": 2.372272215735556,
78
+ "learning_rate": 2.25e-06,
79
+ "loss": 1.0174,
80
+ "step": 10
81
+ },
82
+ {
83
+ "epoch": 0.026410564225690276,
84
+ "grad_norm": 2.4133969432396736,
85
+ "learning_rate": 2.5e-06,
86
+ "loss": 0.9751,
87
+ "step": 11
88
+ },
89
+ {
90
+ "epoch": 0.028811524609843937,
91
+ "grad_norm": 1.9294470459831854,
92
+ "learning_rate": 2.7500000000000004e-06,
93
+ "loss": 0.9501,
94
+ "step": 12
95
+ },
96
+ {
97
+ "epoch": 0.031212484993997598,
98
+ "grad_norm": 1.6356435792199144,
99
+ "learning_rate": 3e-06,
100
+ "loss": 0.8964,
101
+ "step": 13
102
+ },
103
+ {
104
+ "epoch": 0.03361344537815126,
105
+ "grad_norm": 1.4259278773927042,
106
+ "learning_rate": 3.2500000000000002e-06,
107
+ "loss": 0.9262,
108
+ "step": 14
109
+ },
110
+ {
111
+ "epoch": 0.03601440576230492,
112
+ "grad_norm": 1.4029510526993147,
113
+ "learning_rate": 3.5e-06,
114
+ "loss": 0.8773,
115
+ "step": 15
116
+ },
117
+ {
118
+ "epoch": 0.03841536614645858,
119
+ "grad_norm": 1.3072701950591272,
120
+ "learning_rate": 3.7500000000000005e-06,
121
+ "loss": 0.8863,
122
+ "step": 16
123
+ },
124
+ {
125
+ "epoch": 0.04081632653061224,
126
+ "grad_norm": 1.3415661249879083,
127
+ "learning_rate": 4.000000000000001e-06,
128
+ "loss": 0.8391,
129
+ "step": 17
130
+ },
131
+ {
132
+ "epoch": 0.04321728691476591,
133
+ "grad_norm": 1.2551228414808617,
134
+ "learning_rate": 4.25e-06,
135
+ "loss": 0.8391,
136
+ "step": 18
137
+ },
138
+ {
139
+ "epoch": 0.04561824729891957,
140
+ "grad_norm": 1.4822117298636246,
141
+ "learning_rate": 4.5e-06,
142
+ "loss": 0.9249,
143
+ "step": 19
144
+ },
145
+ {
146
+ "epoch": 0.04801920768307323,
147
+ "grad_norm": 2.293387776769893,
148
+ "learning_rate": 4.75e-06,
149
+ "loss": 0.8683,
150
+ "step": 20
151
+ },
152
+ {
153
+ "epoch": 0.05042016806722689,
154
+ "grad_norm": 1.276527897418368,
155
+ "learning_rate": 5e-06,
156
+ "loss": 0.8863,
157
+ "step": 21
158
+ },
159
+ {
160
+ "epoch": 0.05282112845138055,
161
+ "grad_norm": 1.205563120747159,
162
+ "learning_rate": 5.2500000000000006e-06,
163
+ "loss": 0.8641,
164
+ "step": 22
165
+ },
166
+ {
167
+ "epoch": 0.055222088835534214,
168
+ "grad_norm": 1.2341891463491723,
169
+ "learning_rate": 5.500000000000001e-06,
170
+ "loss": 0.8741,
171
+ "step": 23
172
+ },
173
+ {
174
+ "epoch": 0.057623049219687875,
175
+ "grad_norm": 1.194537311448108,
176
+ "learning_rate": 5.75e-06,
177
+ "loss": 0.806,
178
+ "step": 24
179
+ },
180
+ {
181
+ "epoch": 0.060024009603841535,
182
+ "grad_norm": 1.2485956345196676,
183
+ "learning_rate": 6e-06,
184
+ "loss": 0.8281,
185
+ "step": 25
186
+ },
187
+ {
188
+ "epoch": 0.062424969987995196,
189
+ "grad_norm": 1.1779315877632301,
190
+ "learning_rate": 6.25e-06,
191
+ "loss": 0.8552,
192
+ "step": 26
193
+ },
194
+ {
195
+ "epoch": 0.06482593037214886,
196
+ "grad_norm": 1.4180731528009602,
197
+ "learning_rate": 6.5000000000000004e-06,
198
+ "loss": 0.8506,
199
+ "step": 27
200
+ },
201
+ {
202
+ "epoch": 0.06722689075630252,
203
+ "grad_norm": 3.041894752350215,
204
+ "learning_rate": 6.750000000000001e-06,
205
+ "loss": 0.8885,
206
+ "step": 28
207
+ },
208
+ {
209
+ "epoch": 0.06962785114045618,
210
+ "grad_norm": 1.1860989270253326,
211
+ "learning_rate": 7e-06,
212
+ "loss": 0.8331,
213
+ "step": 29
214
+ },
215
+ {
216
+ "epoch": 0.07202881152460984,
217
+ "grad_norm": 1.206902242271321,
218
+ "learning_rate": 7.25e-06,
219
+ "loss": 0.8206,
220
+ "step": 30
221
+ },
222
+ {
223
+ "epoch": 0.0744297719087635,
224
+ "grad_norm": 1.1671538322004624,
225
+ "learning_rate": 7.500000000000001e-06,
226
+ "loss": 0.8167,
227
+ "step": 31
228
+ },
229
+ {
230
+ "epoch": 0.07683073229291716,
231
+ "grad_norm": 1.0422949222046782,
232
+ "learning_rate": 7.75e-06,
233
+ "loss": 0.8007,
234
+ "step": 32
235
+ },
236
+ {
237
+ "epoch": 0.07923169267707082,
238
+ "grad_norm": 1.8592446673491745,
239
+ "learning_rate": 8.000000000000001e-06,
240
+ "loss": 0.8507,
241
+ "step": 33
242
+ },
243
+ {
244
+ "epoch": 0.08163265306122448,
245
+ "grad_norm": 1.6612165554220881,
246
+ "learning_rate": 8.25e-06,
247
+ "loss": 0.8508,
248
+ "step": 34
249
+ },
250
+ {
251
+ "epoch": 0.08403361344537816,
252
+ "grad_norm": 1.0713315873933724,
253
+ "learning_rate": 8.5e-06,
254
+ "loss": 0.8605,
255
+ "step": 35
256
+ },
257
+ {
258
+ "epoch": 0.08643457382953182,
259
+ "grad_norm": 1.1490421409260716,
260
+ "learning_rate": 8.750000000000001e-06,
261
+ "loss": 0.8529,
262
+ "step": 36
263
+ },
264
+ {
265
+ "epoch": 0.08883553421368548,
266
+ "grad_norm": 1.1077552226131402,
267
+ "learning_rate": 9e-06,
268
+ "loss": 0.8251,
269
+ "step": 37
270
+ },
271
+ {
272
+ "epoch": 0.09123649459783914,
273
+ "grad_norm": 0.9873238748489626,
274
+ "learning_rate": 9.250000000000001e-06,
275
+ "loss": 0.7978,
276
+ "step": 38
277
+ },
278
+ {
279
+ "epoch": 0.0936374549819928,
280
+ "grad_norm": 1.3452579503150184,
281
+ "learning_rate": 9.5e-06,
282
+ "loss": 0.8637,
283
+ "step": 39
284
+ },
285
+ {
286
+ "epoch": 0.09603841536614646,
287
+ "grad_norm": 1.4631068406573169,
288
+ "learning_rate": 9.75e-06,
289
+ "loss": 0.8023,
290
+ "step": 40
291
+ },
292
+ {
293
+ "epoch": 0.09843937575030012,
294
+ "grad_norm": 1.265806360917147,
295
+ "learning_rate": 1e-05,
296
+ "loss": 0.8345,
297
+ "step": 41
298
+ },
299
+ {
300
+ "epoch": 0.10084033613445378,
301
+ "grad_norm": 1.1943330814308766,
302
+ "learning_rate": 9.999960664124435e-06,
303
+ "loss": 0.8704,
304
+ "step": 42
305
+ },
306
+ {
307
+ "epoch": 0.10324129651860744,
308
+ "grad_norm": 1.061823017754904,
309
+ "learning_rate": 9.999842657116667e-06,
310
+ "loss": 0.8463,
311
+ "step": 43
312
+ },
313
+ {
314
+ "epoch": 0.1056422569027611,
315
+ "grad_norm": 1.0296226499358687,
316
+ "learning_rate": 9.999645980833454e-06,
317
+ "loss": 0.825,
318
+ "step": 44
319
+ },
320
+ {
321
+ "epoch": 0.10804321728691477,
322
+ "grad_norm": 1.046275065503394,
323
+ "learning_rate": 9.999370638369377e-06,
324
+ "loss": 0.8341,
325
+ "step": 45
326
+ },
327
+ {
328
+ "epoch": 0.11044417767106843,
329
+ "grad_norm": 1.0958287099043753,
330
+ "learning_rate": 9.999016634056764e-06,
331
+ "loss": 0.7894,
332
+ "step": 46
333
+ },
334
+ {
335
+ "epoch": 0.11284513805522209,
336
+ "grad_norm": 1.030922973342192,
337
+ "learning_rate": 9.998583973465647e-06,
338
+ "loss": 0.787,
339
+ "step": 47
340
+ },
341
+ {
342
+ "epoch": 0.11524609843937575,
343
+ "grad_norm": 1.2421669534880109,
344
+ "learning_rate": 9.998072663403657e-06,
345
+ "loss": 0.7978,
346
+ "step": 48
347
+ },
348
+ {
349
+ "epoch": 0.11764705882352941,
350
+ "grad_norm": 1.3970247274710101,
351
+ "learning_rate": 9.997482711915926e-06,
352
+ "loss": 0.7801,
353
+ "step": 49
354
+ },
355
+ {
356
+ "epoch": 0.12004801920768307,
357
+ "grad_norm": 0.9723742502152596,
358
+ "learning_rate": 9.99681412828496e-06,
359
+ "loss": 0.7895,
360
+ "step": 50
361
+ },
362
+ {
363
+ "epoch": 0.12244897959183673,
364
+ "grad_norm": 1.2807089303778385,
365
+ "learning_rate": 9.996066923030484e-06,
366
+ "loss": 0.8543,
367
+ "step": 51
368
+ },
369
+ {
370
+ "epoch": 0.12484993997599039,
371
+ "grad_norm": 1.27637006864039,
372
+ "learning_rate": 9.99524110790929e-06,
373
+ "loss": 0.8535,
374
+ "step": 52
375
+ },
376
+ {
377
+ "epoch": 0.12725090036014405,
378
+ "grad_norm": 0.9583150465246295,
379
+ "learning_rate": 9.994336695915041e-06,
380
+ "loss": 0.7819,
381
+ "step": 53
382
+ },
383
+ {
384
+ "epoch": 0.12965186074429771,
385
+ "grad_norm": 1.066121996350333,
386
+ "learning_rate": 9.993353701278072e-06,
387
+ "loss": 0.7962,
388
+ "step": 54
389
+ },
390
+ {
391
+ "epoch": 0.13205282112845138,
392
+ "grad_norm": 1.0321017551908462,
393
+ "learning_rate": 9.992292139465166e-06,
394
+ "loss": 0.794,
395
+ "step": 55
396
+ },
397
+ {
398
+ "epoch": 0.13445378151260504,
399
+ "grad_norm": 1.1056060968463626,
400
+ "learning_rate": 9.991152027179307e-06,
401
+ "loss": 0.8431,
402
+ "step": 56
403
+ },
404
+ {
405
+ "epoch": 0.1368547418967587,
406
+ "grad_norm": 1.6782765780764348,
407
+ "learning_rate": 9.989933382359423e-06,
408
+ "loss": 0.8303,
409
+ "step": 57
410
+ },
411
+ {
412
+ "epoch": 0.13925570228091236,
413
+ "grad_norm": 1.1967331617073076,
414
+ "learning_rate": 9.988636224180097e-06,
415
+ "loss": 0.7792,
416
+ "step": 58
417
+ },
418
+ {
419
+ "epoch": 0.14165666266506602,
420
+ "grad_norm": 1.8049549266124272,
421
+ "learning_rate": 9.987260573051268e-06,
422
+ "loss": 0.7988,
423
+ "step": 59
424
+ },
425
+ {
426
+ "epoch": 0.14405762304921968,
427
+ "grad_norm": 1.046695584455822,
428
+ "learning_rate": 9.985806450617916e-06,
429
+ "loss": 0.8037,
430
+ "step": 60
431
+ },
432
+ {
433
+ "epoch": 0.14645858343337334,
434
+ "grad_norm": 1.2121335142230327,
435
+ "learning_rate": 9.984273879759713e-06,
436
+ "loss": 0.8515,
437
+ "step": 61
438
+ },
439
+ {
440
+ "epoch": 0.148859543817527,
441
+ "grad_norm": 1.3076719515024817,
442
+ "learning_rate": 9.982662884590662e-06,
443
+ "loss": 0.8178,
444
+ "step": 62
445
+ },
446
+ {
447
+ "epoch": 0.15126050420168066,
448
+ "grad_norm": 1.2564921607093686,
449
+ "learning_rate": 9.980973490458728e-06,
450
+ "loss": 0.8399,
451
+ "step": 63
452
+ },
453
+ {
454
+ "epoch": 0.15366146458583432,
455
+ "grad_norm": 1.0641383621124019,
456
+ "learning_rate": 9.97920572394543e-06,
457
+ "loss": 0.7677,
458
+ "step": 64
459
+ },
460
+ {
461
+ "epoch": 0.15606242496998798,
462
+ "grad_norm": 1.1281926663515902,
463
+ "learning_rate": 9.977359612865424e-06,
464
+ "loss": 0.7974,
465
+ "step": 65
466
+ },
467
+ {
468
+ "epoch": 0.15846338535414164,
469
+ "grad_norm": 1.0094739962757735,
470
+ "learning_rate": 9.975435186266069e-06,
471
+ "loss": 0.7676,
472
+ "step": 66
473
+ },
474
+ {
475
+ "epoch": 0.1608643457382953,
476
+ "grad_norm": 1.3602443348603426,
477
+ "learning_rate": 9.973432474426968e-06,
478
+ "loss": 0.8171,
479
+ "step": 67
480
+ },
481
+ {
482
+ "epoch": 0.16326530612244897,
483
+ "grad_norm": 0.9792328660506742,
484
+ "learning_rate": 9.971351508859488e-06,
485
+ "loss": 0.7561,
486
+ "step": 68
487
+ },
488
+ {
489
+ "epoch": 0.16566626650660263,
490
+ "grad_norm": 1.397240469672876,
491
+ "learning_rate": 9.969192322306271e-06,
492
+ "loss": 0.8365,
493
+ "step": 69
494
+ },
495
+ {
496
+ "epoch": 0.16806722689075632,
497
+ "grad_norm": 1.3993747618987225,
498
+ "learning_rate": 9.966954948740717e-06,
499
+ "loss": 0.7281,
500
+ "step": 70
501
+ },
502
+ {
503
+ "epoch": 0.17046818727490998,
504
+ "grad_norm": 1.0666295786391167,
505
+ "learning_rate": 9.964639423366442e-06,
506
+ "loss": 0.8563,
507
+ "step": 71
508
+ },
509
+ {
510
+ "epoch": 0.17286914765906364,
511
+ "grad_norm": 1.6098094871731998,
512
+ "learning_rate": 9.962245782616734e-06,
513
+ "loss": 0.8027,
514
+ "step": 72
515
+ },
516
+ {
517
+ "epoch": 0.1752701080432173,
518
+ "grad_norm": 1.0029300637530163,
519
+ "learning_rate": 9.959774064153977e-06,
520
+ "loss": 0.7768,
521
+ "step": 73
522
+ },
523
+ {
524
+ "epoch": 0.17767106842737096,
525
+ "grad_norm": 1.1557098402816255,
526
+ "learning_rate": 9.957224306869053e-06,
527
+ "loss": 0.7915,
528
+ "step": 74
529
+ },
530
+ {
531
+ "epoch": 0.18007202881152462,
532
+ "grad_norm": 1.1411436589531005,
533
+ "learning_rate": 9.954596550880735e-06,
534
+ "loss": 0.8207,
535
+ "step": 75
536
+ },
537
+ {
538
+ "epoch": 0.18247298919567828,
539
+ "grad_norm": 0.9898519262158086,
540
+ "learning_rate": 9.951890837535058e-06,
541
+ "loss": 0.8303,
542
+ "step": 76
543
+ },
544
+ {
545
+ "epoch": 0.18487394957983194,
546
+ "grad_norm": 1.015734040263864,
547
+ "learning_rate": 9.949107209404664e-06,
548
+ "loss": 0.7928,
549
+ "step": 77
550
+ },
551
+ {
552
+ "epoch": 0.1872749099639856,
553
+ "grad_norm": 1.0314783989677847,
554
+ "learning_rate": 9.946245710288132e-06,
555
+ "loss": 0.7407,
556
+ "step": 78
557
+ },
558
+ {
559
+ "epoch": 0.18967587034813926,
560
+ "grad_norm": 2.1401440917485943,
561
+ "learning_rate": 9.94330638520929e-06,
562
+ "loss": 0.7775,
563
+ "step": 79
564
+ },
565
+ {
566
+ "epoch": 0.19207683073229292,
567
+ "grad_norm": 0.9890405160925984,
568
+ "learning_rate": 9.940289280416509e-06,
569
+ "loss": 0.7566,
570
+ "step": 80
571
+ },
572
+ {
573
+ "epoch": 0.19447779111644659,
574
+ "grad_norm": 0.9739543182418596,
575
+ "learning_rate": 9.937194443381972e-06,
576
+ "loss": 0.8159,
577
+ "step": 81
578
+ },
579
+ {
580
+ "epoch": 0.19687875150060025,
581
+ "grad_norm": 1.1138048276749253,
582
+ "learning_rate": 9.934021922800931e-06,
583
+ "loss": 0.7939,
584
+ "step": 82
585
+ },
586
+ {
587
+ "epoch": 0.1992797118847539,
588
+ "grad_norm": 1.0939436400008165,
589
+ "learning_rate": 9.930771768590934e-06,
590
+ "loss": 0.8144,
591
+ "step": 83
592
+ },
593
+ {
594
+ "epoch": 0.20168067226890757,
595
+ "grad_norm": 1.1293648489823769,
596
+ "learning_rate": 9.927444031891044e-06,
597
+ "loss": 0.7755,
598
+ "step": 84
599
+ },
600
+ {
601
+ "epoch": 0.20408163265306123,
602
+ "grad_norm": 1.0430331448777437,
603
+ "learning_rate": 9.924038765061042e-06,
604
+ "loss": 0.8215,
605
+ "step": 85
606
+ },
607
+ {
608
+ "epoch": 0.2064825930372149,
609
+ "grad_norm": 1.9537322284504008,
610
+ "learning_rate": 9.92055602168058e-06,
611
+ "loss": 0.7563,
612
+ "step": 86
613
+ },
614
+ {
615
+ "epoch": 0.20888355342136855,
616
+ "grad_norm": 1.3079086606300951,
617
+ "learning_rate": 9.916995856548371e-06,
618
+ "loss": 0.8157,
619
+ "step": 87
620
+ },
621
+ {
622
+ "epoch": 0.2112845138055222,
623
+ "grad_norm": 0.9221688539776796,
624
+ "learning_rate": 9.913358325681292e-06,
625
+ "loss": 0.782,
626
+ "step": 88
627
+ },
628
+ {
629
+ "epoch": 0.21368547418967587,
630
+ "grad_norm": 1.1087405466326585,
631
+ "learning_rate": 9.909643486313533e-06,
632
+ "loss": 0.8061,
633
+ "step": 89
634
+ },
635
+ {
636
+ "epoch": 0.21608643457382953,
637
+ "grad_norm": 1.2632508204228434,
638
+ "learning_rate": 9.905851396895679e-06,
639
+ "loss": 0.7788,
640
+ "step": 90
641
+ },
642
+ {
643
+ "epoch": 0.2184873949579832,
644
+ "grad_norm": 1.2841221080352947,
645
+ "learning_rate": 9.901982117093786e-06,
646
+ "loss": 0.7707,
647
+ "step": 91
648
+ },
649
+ {
650
+ "epoch": 0.22088835534213686,
651
+ "grad_norm": 0.9416571120286465,
652
+ "learning_rate": 9.898035707788462e-06,
653
+ "loss": 0.7386,
654
+ "step": 92
655
+ },
656
+ {
657
+ "epoch": 0.22328931572629052,
658
+ "grad_norm": 1.0394686320396263,
659
+ "learning_rate": 9.894012231073895e-06,
660
+ "loss": 0.7729,
661
+ "step": 93
662
+ },
663
+ {
664
+ "epoch": 0.22569027611044418,
665
+ "grad_norm": 1.1642999740100775,
666
+ "learning_rate": 9.889911750256873e-06,
667
+ "loss": 0.7667,
668
+ "step": 94
669
+ },
670
+ {
671
+ "epoch": 0.22809123649459784,
672
+ "grad_norm": 1.0191501234681113,
673
+ "learning_rate": 9.885734329855798e-06,
674
+ "loss": 0.7415,
675
+ "step": 95
676
+ },
677
+ {
678
+ "epoch": 0.2304921968787515,
679
+ "grad_norm": 1.1396215768269955,
680
+ "learning_rate": 9.881480035599667e-06,
681
+ "loss": 0.846,
682
+ "step": 96
683
+ },
684
+ {
685
+ "epoch": 0.23289315726290516,
686
+ "grad_norm": 1.4770430873772629,
687
+ "learning_rate": 9.877148934427037e-06,
688
+ "loss": 0.8105,
689
+ "step": 97
690
+ },
691
+ {
692
+ "epoch": 0.23529411764705882,
693
+ "grad_norm": 1.1245875213463206,
694
+ "learning_rate": 9.872741094484965e-06,
695
+ "loss": 0.7857,
696
+ "step": 98
697
+ },
698
+ {
699
+ "epoch": 0.23769507803121248,
700
+ "grad_norm": 0.9225248681792048,
701
+ "learning_rate": 9.868256585127956e-06,
702
+ "loss": 0.7292,
703
+ "step": 99
704
+ },
705
+ {
706
+ "epoch": 0.24009603841536614,
707
+ "grad_norm": 1.0574440145567323,
708
+ "learning_rate": 9.863695476916846e-06,
709
+ "loss": 0.8077,
710
+ "step": 100
711
+ },
712
+ {
713
+ "epoch": 0.2424969987995198,
714
+ "grad_norm": 1.1365137152954194,
715
+ "learning_rate": 9.859057841617709e-06,
716
+ "loss": 0.8066,
717
+ "step": 101
718
+ },
719
+ {
720
+ "epoch": 0.24489795918367346,
721
+ "grad_norm": 1.1942946403505255,
722
+ "learning_rate": 9.854343752200725e-06,
723
+ "loss": 0.8139,
724
+ "step": 102
725
+ },
726
+ {
727
+ "epoch": 0.24729891956782712,
728
+ "grad_norm": 1.0543479220950105,
729
+ "learning_rate": 9.849553282839025e-06,
730
+ "loss": 0.7701,
731
+ "step": 103
732
+ },
733
+ {
734
+ "epoch": 0.24969987995198079,
735
+ "grad_norm": 0.926743129553519,
736
+ "learning_rate": 9.844686508907538e-06,
737
+ "loss": 0.7927,
738
+ "step": 104
739
+ },
740
+ {
741
+ "epoch": 0.25210084033613445,
742
+ "grad_norm": 1.011488885523952,
743
+ "learning_rate": 9.839743506981783e-06,
744
+ "loss": 0.7914,
745
+ "step": 105
746
+ },
747
+ {
748
+ "epoch": 0.2545018007202881,
749
+ "grad_norm": 1.0064857869367891,
750
+ "learning_rate": 9.834724354836684e-06,
751
+ "loss": 0.7701,
752
+ "step": 106
753
+ },
754
+ {
755
+ "epoch": 0.25690276110444177,
756
+ "grad_norm": 1.2884610797254652,
757
+ "learning_rate": 9.829629131445342e-06,
758
+ "loss": 0.7797,
759
+ "step": 107
760
+ },
761
+ {
762
+ "epoch": 0.25930372148859543,
763
+ "grad_norm": 1.022923038777103,
764
+ "learning_rate": 9.824457916977785e-06,
765
+ "loss": 0.7563,
766
+ "step": 108
767
+ },
768
+ {
769
+ "epoch": 0.2617046818727491,
770
+ "grad_norm": 1.3622638931252318,
771
+ "learning_rate": 9.819210792799711e-06,
772
+ "loss": 0.791,
773
+ "step": 109
774
+ },
775
+ {
776
+ "epoch": 0.26410564225690275,
777
+ "grad_norm": 1.6261815582055081,
778
+ "learning_rate": 9.81388784147121e-06,
779
+ "loss": 0.7791,
780
+ "step": 110
781
+ },
782
+ {
783
+ "epoch": 0.2665066026410564,
784
+ "grad_norm": 1.3875850558476444,
785
+ "learning_rate": 9.808489146745466e-06,
786
+ "loss": 0.8065,
787
+ "step": 111
788
+ },
789
+ {
790
+ "epoch": 0.2689075630252101,
791
+ "grad_norm": 1.0566640937075868,
792
+ "learning_rate": 9.803014793567429e-06,
793
+ "loss": 0.7662,
794
+ "step": 112
795
+ },
796
+ {
797
+ "epoch": 0.27130852340936373,
798
+ "grad_norm": 0.9297104835810871,
799
+ "learning_rate": 9.797464868072489e-06,
800
+ "loss": 0.7338,
801
+ "step": 113
802
+ },
803
+ {
804
+ "epoch": 0.2737094837935174,
805
+ "grad_norm": 0.9992084910627275,
806
+ "learning_rate": 9.791839457585118e-06,
807
+ "loss": 0.7773,
808
+ "step": 114
809
+ },
810
+ {
811
+ "epoch": 0.27611044417767105,
812
+ "grad_norm": 1.1581522702903588,
813
+ "learning_rate": 9.786138650617494e-06,
814
+ "loss": 0.7929,
815
+ "step": 115
816
+ },
817
+ {
818
+ "epoch": 0.2785114045618247,
819
+ "grad_norm": 1.259081791921377,
820
+ "learning_rate": 9.780362536868113e-06,
821
+ "loss": 0.7279,
822
+ "step": 116
823
+ },
824
+ {
825
+ "epoch": 0.2809123649459784,
826
+ "grad_norm": 1.1510251918441672,
827
+ "learning_rate": 9.774511207220369e-06,
828
+ "loss": 0.7412,
829
+ "step": 117
830
+ },
831
+ {
832
+ "epoch": 0.28331332533013204,
833
+ "grad_norm": 0.9943579023159135,
834
+ "learning_rate": 9.768584753741134e-06,
835
+ "loss": 0.7927,
836
+ "step": 118
837
+ },
838
+ {
839
+ "epoch": 0.2857142857142857,
840
+ "grad_norm": 1.061487526635317,
841
+ "learning_rate": 9.762583269679304e-06,
842
+ "loss": 0.8363,
843
+ "step": 119
844
+ },
845
+ {
846
+ "epoch": 0.28811524609843936,
847
+ "grad_norm": 1.1215382733800197,
848
+ "learning_rate": 9.756506849464327e-06,
849
+ "loss": 0.8032,
850
+ "step": 120
851
+ },
852
+ {
853
+ "epoch": 0.290516206482593,
854
+ "grad_norm": 1.0985810622772545,
855
+ "learning_rate": 9.750355588704728e-06,
856
+ "loss": 0.8062,
857
+ "step": 121
858
+ },
859
+ {
860
+ "epoch": 0.2929171668667467,
861
+ "grad_norm": 1.0397097160893556,
862
+ "learning_rate": 9.744129584186599e-06,
863
+ "loss": 0.7867,
864
+ "step": 122
865
+ },
866
+ {
867
+ "epoch": 0.29531812725090034,
868
+ "grad_norm": 1.0985983029789874,
869
+ "learning_rate": 9.737828933872076e-06,
870
+ "loss": 0.7645,
871
+ "step": 123
872
+ },
873
+ {
874
+ "epoch": 0.297719087635054,
875
+ "grad_norm": 1.0341542778256945,
876
+ "learning_rate": 9.731453736897796e-06,
877
+ "loss": 0.7682,
878
+ "step": 124
879
+ },
880
+ {
881
+ "epoch": 0.30012004801920766,
882
+ "grad_norm": 0.9637556163656881,
883
+ "learning_rate": 9.725004093573343e-06,
884
+ "loss": 0.7819,
885
+ "step": 125
886
+ },
887
+ {
888
+ "epoch": 0.3025210084033613,
889
+ "grad_norm": 0.9476489500974398,
890
+ "learning_rate": 9.718480105379663e-06,
891
+ "loss": 0.7875,
892
+ "step": 126
893
+ },
894
+ {
895
+ "epoch": 0.304921968787515,
896
+ "grad_norm": 1.3085520795980778,
897
+ "learning_rate": 9.711881874967471e-06,
898
+ "loss": 0.7908,
899
+ "step": 127
900
+ },
901
+ {
902
+ "epoch": 0.30732292917166865,
903
+ "grad_norm": 0.9414082676216773,
904
+ "learning_rate": 9.705209506155635e-06,
905
+ "loss": 0.7454,
906
+ "step": 128
907
+ },
908
+ {
909
+ "epoch": 0.3097238895558223,
910
+ "grad_norm": 1.2351287282053665,
911
+ "learning_rate": 9.698463103929542e-06,
912
+ "loss": 0.7813,
913
+ "step": 129
914
+ },
915
+ {
916
+ "epoch": 0.31212484993997597,
917
+ "grad_norm": 1.021583176125914,
918
+ "learning_rate": 9.69164277443945e-06,
919
+ "loss": 0.8417,
920
+ "step": 130
921
+ },
922
+ {
923
+ "epoch": 0.31452581032412963,
924
+ "grad_norm": 1.4089615187590279,
925
+ "learning_rate": 9.68474862499881e-06,
926
+ "loss": 0.7358,
927
+ "step": 131
928
+ },
929
+ {
930
+ "epoch": 0.3169267707082833,
931
+ "grad_norm": 0.9398428308548782,
932
+ "learning_rate": 9.677780764082583e-06,
933
+ "loss": 0.7637,
934
+ "step": 132
935
+ },
936
+ {
937
+ "epoch": 0.31932773109243695,
938
+ "grad_norm": 1.1136331841332863,
939
+ "learning_rate": 9.670739301325534e-06,
940
+ "loss": 0.7723,
941
+ "step": 133
942
+ },
943
+ {
944
+ "epoch": 0.3217286914765906,
945
+ "grad_norm": 1.1992806853517075,
946
+ "learning_rate": 9.663624347520506e-06,
947
+ "loss": 0.7788,
948
+ "step": 134
949
+ },
950
+ {
951
+ "epoch": 0.3241296518607443,
952
+ "grad_norm": 1.311509502714469,
953
+ "learning_rate": 9.65643601461667e-06,
954
+ "loss": 0.7696,
955
+ "step": 135
956
+ },
957
+ {
958
+ "epoch": 0.32653061224489793,
959
+ "grad_norm": 0.9623376564123519,
960
+ "learning_rate": 9.649174415717776e-06,
961
+ "loss": 0.7414,
962
+ "step": 136
963
+ },
964
+ {
965
+ "epoch": 0.3289315726290516,
966
+ "grad_norm": 1.0486840444117425,
967
+ "learning_rate": 9.641839665080363e-06,
968
+ "loss": 0.7909,
969
+ "step": 137
970
+ },
971
+ {
972
+ "epoch": 0.33133253301320525,
973
+ "grad_norm": 1.172648282688611,
974
+ "learning_rate": 9.634431878111969e-06,
975
+ "loss": 0.7684,
976
+ "step": 138
977
+ },
978
+ {
979
+ "epoch": 0.33373349339735897,
980
+ "grad_norm": 1.3883931408734287,
981
+ "learning_rate": 9.626951171369306e-06,
982
+ "loss": 0.7824,
983
+ "step": 139
984
+ },
985
+ {
986
+ "epoch": 0.33613445378151263,
987
+ "grad_norm": 1.0459492696464887,
988
+ "learning_rate": 9.619397662556434e-06,
989
+ "loss": 0.7729,
990
+ "step": 140
991
+ },
992
+ {
993
+ "epoch": 0.3385354141656663,
994
+ "grad_norm": 1.090681276032822,
995
+ "learning_rate": 9.611771470522908e-06,
996
+ "loss": 0.78,
997
+ "step": 141
998
+ },
999
+ {
1000
+ "epoch": 0.34093637454981995,
1001
+ "grad_norm": 1.077439313381409,
1002
+ "learning_rate": 9.604072715261902e-06,
1003
+ "loss": 0.7746,
1004
+ "step": 142
1005
+ },
1006
+ {
1007
+ "epoch": 0.3433373349339736,
1008
+ "grad_norm": 1.0119948107455536,
1009
+ "learning_rate": 9.596301517908329e-06,
1010
+ "loss": 0.7725,
1011
+ "step": 143
1012
+ },
1013
+ {
1014
+ "epoch": 0.3457382953181273,
1015
+ "grad_norm": 1.0261650566322091,
1016
+ "learning_rate": 9.588458000736929e-06,
1017
+ "loss": 0.8126,
1018
+ "step": 144
1019
+ },
1020
+ {
1021
+ "epoch": 0.34813925570228094,
1022
+ "grad_norm": 3.2915968630848296,
1023
+ "learning_rate": 9.580542287160348e-06,
1024
+ "loss": 0.8087,
1025
+ "step": 145
1026
+ },
1027
+ {
1028
+ "epoch": 0.3505402160864346,
1029
+ "grad_norm": 1.1260052143600965,
1030
+ "learning_rate": 9.572554501727198e-06,
1031
+ "loss": 0.7626,
1032
+ "step": 146
1033
+ },
1034
+ {
1035
+ "epoch": 0.35294117647058826,
1036
+ "grad_norm": 1.1992270704321544,
1037
+ "learning_rate": 9.564494770120089e-06,
1038
+ "loss": 0.7942,
1039
+ "step": 147
1040
+ },
1041
+ {
1042
+ "epoch": 0.3553421368547419,
1043
+ "grad_norm": 0.8934279508188496,
1044
+ "learning_rate": 9.556363219153664e-06,
1045
+ "loss": 0.7121,
1046
+ "step": 148
1047
+ },
1048
+ {
1049
+ "epoch": 0.3577430972388956,
1050
+ "grad_norm": 1.627029857609285,
1051
+ "learning_rate": 9.548159976772593e-06,
1052
+ "loss": 0.8305,
1053
+ "step": 149
1054
+ },
1055
+ {
1056
+ "epoch": 0.36014405762304924,
1057
+ "grad_norm": 1.2904112895903999,
1058
+ "learning_rate": 9.539885172049563e-06,
1059
+ "loss": 0.7903,
1060
+ "step": 150
1061
+ },
1062
+ {
1063
+ "epoch": 0.3625450180072029,
1064
+ "grad_norm": 0.9013735933905231,
1065
+ "learning_rate": 9.531538935183252e-06,
1066
+ "loss": 0.7532,
1067
+ "step": 151
1068
+ },
1069
+ {
1070
+ "epoch": 0.36494597839135656,
1071
+ "grad_norm": 1.1957280125341616,
1072
+ "learning_rate": 9.52312139749627e-06,
1073
+ "loss": 0.7654,
1074
+ "step": 152
1075
+ },
1076
+ {
1077
+ "epoch": 0.3673469387755102,
1078
+ "grad_norm": 1.1864890770385386,
1079
+ "learning_rate": 9.514632691433108e-06,
1080
+ "loss": 0.7774,
1081
+ "step": 153
1082
+ },
1083
+ {
1084
+ "epoch": 0.3697478991596639,
1085
+ "grad_norm": 1.2602126687460933,
1086
+ "learning_rate": 9.506072950558036e-06,
1087
+ "loss": 0.7308,
1088
+ "step": 154
1089
+ },
1090
+ {
1091
+ "epoch": 0.37214885954381755,
1092
+ "grad_norm": 0.9838354835983466,
1093
+ "learning_rate": 9.497442309553017e-06,
1094
+ "loss": 0.8117,
1095
+ "step": 155
1096
+ },
1097
+ {
1098
+ "epoch": 0.3745498199279712,
1099
+ "grad_norm": 1.0381143846448244,
1100
+ "learning_rate": 9.488740904215578e-06,
1101
+ "loss": 0.7949,
1102
+ "step": 156
1103
+ },
1104
+ {
1105
+ "epoch": 0.37695078031212487,
1106
+ "grad_norm": 1.0974151220229578,
1107
+ "learning_rate": 9.47996887145668e-06,
1108
+ "loss": 0.8096,
1109
+ "step": 157
1110
+ },
1111
+ {
1112
+ "epoch": 0.3793517406962785,
1113
+ "grad_norm": 1.0644973845655654,
1114
+ "learning_rate": 9.471126349298557e-06,
1115
+ "loss": 0.769,
1116
+ "step": 158
1117
+ },
1118
+ {
1119
+ "epoch": 0.3817527010804322,
1120
+ "grad_norm": 1.0805369220592416,
1121
+ "learning_rate": 9.46221347687255e-06,
1122
+ "loss": 0.7528,
1123
+ "step": 159
1124
+ },
1125
+ {
1126
+ "epoch": 0.38415366146458585,
1127
+ "grad_norm": 1.0244991912422095,
1128
+ "learning_rate": 9.453230394416914e-06,
1129
+ "loss": 0.7883,
1130
+ "step": 160
1131
+ },
1132
+ {
1133
+ "epoch": 0.3865546218487395,
1134
+ "grad_norm": 0.9661371626174572,
1135
+ "learning_rate": 9.444177243274619e-06,
1136
+ "loss": 0.784,
1137
+ "step": 161
1138
+ },
1139
+ {
1140
+ "epoch": 0.38895558223289317,
1141
+ "grad_norm": 1.3148287207686615,
1142
+ "learning_rate": 9.43505416589111e-06,
1143
+ "loss": 0.7656,
1144
+ "step": 162
1145
+ },
1146
+ {
1147
+ "epoch": 0.39135654261704683,
1148
+ "grad_norm": 1.1619055283617015,
1149
+ "learning_rate": 9.425861305812083e-06,
1150
+ "loss": 0.7824,
1151
+ "step": 163
1152
+ },
1153
+ {
1154
+ "epoch": 0.3937575030012005,
1155
+ "grad_norm": 4.651513081191553,
1156
+ "learning_rate": 9.416598807681221e-06,
1157
+ "loss": 0.8066,
1158
+ "step": 164
1159
+ },
1160
+ {
1161
+ "epoch": 0.39615846338535415,
1162
+ "grad_norm": 0.9479957292008633,
1163
+ "learning_rate": 9.40726681723791e-06,
1164
+ "loss": 0.7651,
1165
+ "step": 165
1166
+ },
1167
+ {
1168
+ "epoch": 0.3985594237695078,
1169
+ "grad_norm": 1.1703185690222349,
1170
+ "learning_rate": 9.397865481314959e-06,
1171
+ "loss": 0.7656,
1172
+ "step": 166
1173
+ },
1174
+ {
1175
+ "epoch": 0.4009603841536615,
1176
+ "grad_norm": 1.0368151311067004,
1177
+ "learning_rate": 9.388394947836278e-06,
1178
+ "loss": 0.7917,
1179
+ "step": 167
1180
+ },
1181
+ {
1182
+ "epoch": 0.40336134453781514,
1183
+ "grad_norm": 2.298562774870953,
1184
+ "learning_rate": 9.37885536581456e-06,
1185
+ "loss": 0.762,
1186
+ "step": 168
1187
+ },
1188
+ {
1189
+ "epoch": 0.4057623049219688,
1190
+ "grad_norm": 1.1062217919442925,
1191
+ "learning_rate": 9.369246885348926e-06,
1192
+ "loss": 0.7585,
1193
+ "step": 169
1194
+ },
1195
+ {
1196
+ "epoch": 0.40816326530612246,
1197
+ "grad_norm": 1.173156390813293,
1198
+ "learning_rate": 9.359569657622573e-06,
1199
+ "loss": 0.7797,
1200
+ "step": 170
1201
+ },
1202
+ {
1203
+ "epoch": 0.4105642256902761,
1204
+ "grad_norm": 1.109809941134885,
1205
+ "learning_rate": 9.349823834900396e-06,
1206
+ "loss": 0.7588,
1207
+ "step": 171
1208
+ },
1209
+ {
1210
+ "epoch": 0.4129651860744298,
1211
+ "grad_norm": 1.2813177351957437,
1212
+ "learning_rate": 9.340009570526578e-06,
1213
+ "loss": 0.7616,
1214
+ "step": 172
1215
+ },
1216
+ {
1217
+ "epoch": 0.41536614645858344,
1218
+ "grad_norm": 1.0591641661573232,
1219
+ "learning_rate": 9.330127018922195e-06,
1220
+ "loss": 0.7564,
1221
+ "step": 173
1222
+ },
1223
+ {
1224
+ "epoch": 0.4177671068427371,
1225
+ "grad_norm": 2.376914868004014,
1226
+ "learning_rate": 9.320176335582772e-06,
1227
+ "loss": 0.7366,
1228
+ "step": 174
1229
+ },
1230
+ {
1231
+ "epoch": 0.42016806722689076,
1232
+ "grad_norm": 0.9902616640042359,
1233
+ "learning_rate": 9.310157677075847e-06,
1234
+ "loss": 0.7429,
1235
+ "step": 175
1236
+ },
1237
+ {
1238
+ "epoch": 0.4225690276110444,
1239
+ "grad_norm": 1.6847159971307049,
1240
+ "learning_rate": 9.300071201038503e-06,
1241
+ "loss": 0.7825,
1242
+ "step": 176
1243
+ },
1244
+ {
1245
+ "epoch": 0.4249699879951981,
1246
+ "grad_norm": 0.9942879778667437,
1247
+ "learning_rate": 9.289917066174887e-06,
1248
+ "loss": 0.7318,
1249
+ "step": 177
1250
+ },
1251
+ {
1252
+ "epoch": 0.42737094837935174,
1253
+ "grad_norm": 1.1742665576935563,
1254
+ "learning_rate": 9.27969543225371e-06,
1255
+ "loss": 0.7623,
1256
+ "step": 178
1257
+ },
1258
+ {
1259
+ "epoch": 0.4297719087635054,
1260
+ "grad_norm": 1.2676535006378862,
1261
+ "learning_rate": 9.269406460105742e-06,
1262
+ "loss": 0.7583,
1263
+ "step": 179
1264
+ },
1265
+ {
1266
+ "epoch": 0.43217286914765907,
1267
+ "grad_norm": 1.678798458940733,
1268
+ "learning_rate": 9.259050311621274e-06,
1269
+ "loss": 0.7881,
1270
+ "step": 180
1271
+ },
1272
+ {
1273
+ "epoch": 0.4345738295318127,
1274
+ "grad_norm": 1.1441951682044669,
1275
+ "learning_rate": 9.248627149747573e-06,
1276
+ "loss": 0.7455,
1277
+ "step": 181
1278
+ },
1279
+ {
1280
+ "epoch": 0.4369747899159664,
1281
+ "grad_norm": 1.0055990609873005,
1282
+ "learning_rate": 9.238137138486318e-06,
1283
+ "loss": 0.7613,
1284
+ "step": 182
1285
+ },
1286
+ {
1287
+ "epoch": 0.43937575030012005,
1288
+ "grad_norm": 1.0631388873420178,
1289
+ "learning_rate": 9.227580442891022e-06,
1290
+ "loss": 0.7528,
1291
+ "step": 183
1292
+ },
1293
+ {
1294
+ "epoch": 0.4417767106842737,
1295
+ "grad_norm": 1.0811446737171562,
1296
+ "learning_rate": 9.21695722906443e-06,
1297
+ "loss": 0.7988,
1298
+ "step": 184
1299
+ },
1300
+ {
1301
+ "epoch": 0.44417767106842737,
1302
+ "grad_norm": 3.77472894386223,
1303
+ "learning_rate": 9.206267664155906e-06,
1304
+ "loss": 0.7669,
1305
+ "step": 185
1306
+ },
1307
+ {
1308
+ "epoch": 0.44657863145258103,
1309
+ "grad_norm": 2.5440967403332833,
1310
+ "learning_rate": 9.195511916358813e-06,
1311
+ "loss": 0.7478,
1312
+ "step": 186
1313
+ },
1314
+ {
1315
+ "epoch": 0.4489795918367347,
1316
+ "grad_norm": 1.1995260606009623,
1317
+ "learning_rate": 9.18469015490785e-06,
1318
+ "loss": 0.7637,
1319
+ "step": 187
1320
+ },
1321
+ {
1322
+ "epoch": 0.45138055222088835,
1323
+ "grad_norm": 1.087601696720053,
1324
+ "learning_rate": 9.173802550076402e-06,
1325
+ "loss": 0.7122,
1326
+ "step": 188
1327
+ },
1328
+ {
1329
+ "epoch": 0.453781512605042,
1330
+ "grad_norm": 0.859793070085179,
1331
+ "learning_rate": 9.162849273173857e-06,
1332
+ "loss": 0.7237,
1333
+ "step": 189
1334
+ },
1335
+ {
1336
+ "epoch": 0.4561824729891957,
1337
+ "grad_norm": 0.909405499890903,
1338
+ "learning_rate": 9.151830496542912e-06,
1339
+ "loss": 0.7413,
1340
+ "step": 190
1341
+ },
1342
+ {
1343
+ "epoch": 0.45858343337334934,
1344
+ "grad_norm": 1.1698481579798348,
1345
+ "learning_rate": 9.140746393556853e-06,
1346
+ "loss": 0.7686,
1347
+ "step": 191
1348
+ },
1349
+ {
1350
+ "epoch": 0.460984393757503,
1351
+ "grad_norm": 1.4005910755153028,
1352
+ "learning_rate": 9.129597138616845e-06,
1353
+ "loss": 0.7301,
1354
+ "step": 192
1355
+ },
1356
+ {
1357
+ "epoch": 0.46338535414165666,
1358
+ "grad_norm": 6.016086016376545,
1359
+ "learning_rate": 9.118382907149164e-06,
1360
+ "loss": 0.7871,
1361
+ "step": 193
1362
+ },
1363
+ {
1364
+ "epoch": 0.4657863145258103,
1365
+ "grad_norm": 0.9147643453009918,
1366
+ "learning_rate": 9.107103875602458e-06,
1367
+ "loss": 0.7753,
1368
+ "step": 194
1369
+ },
1370
+ {
1371
+ "epoch": 0.468187274909964,
1372
+ "grad_norm": 1.1762754554445651,
1373
+ "learning_rate": 9.09576022144496e-06,
1374
+ "loss": 0.7764,
1375
+ "step": 195
1376
+ },
1377
+ {
1378
+ "epoch": 0.47058823529411764,
1379
+ "grad_norm": 1.175295130468933,
1380
+ "learning_rate": 9.084352123161695e-06,
1381
+ "loss": 0.7912,
1382
+ "step": 196
1383
+ },
1384
+ {
1385
+ "epoch": 0.4729891956782713,
1386
+ "grad_norm": 1.0739318228013277,
1387
+ "learning_rate": 9.07287976025168e-06,
1388
+ "loss": 0.762,
1389
+ "step": 197
1390
+ },
1391
+ {
1392
+ "epoch": 0.47539015606242496,
1393
+ "grad_norm": 0.9934440139468771,
1394
+ "learning_rate": 9.061343313225088e-06,
1395
+ "loss": 0.8003,
1396
+ "step": 198
1397
+ },
1398
+ {
1399
+ "epoch": 0.4777911164465786,
1400
+ "grad_norm": 1.0768642208250674,
1401
+ "learning_rate": 9.04974296360042e-06,
1402
+ "loss": 0.7659,
1403
+ "step": 199
1404
+ },
1405
+ {
1406
+ "epoch": 0.4801920768307323,
1407
+ "grad_norm": 1.1273977823886203,
1408
+ "learning_rate": 9.038078893901634e-06,
1409
+ "loss": 0.7992,
1410
+ "step": 200
1411
+ },
1412
+ {
1413
+ "epoch": 0.48259303721488594,
1414
+ "grad_norm": 1.1987531653944965,
1415
+ "learning_rate": 9.026351287655294e-06,
1416
+ "loss": 0.7932,
1417
+ "step": 201
1418
+ },
1419
+ {
1420
+ "epoch": 0.4849939975990396,
1421
+ "grad_norm": 1.4257297426073774,
1422
+ "learning_rate": 9.014560329387661e-06,
1423
+ "loss": 0.7372,
1424
+ "step": 202
1425
+ },
1426
+ {
1427
+ "epoch": 0.48739495798319327,
1428
+ "grad_norm": 0.8935161112029553,
1429
+ "learning_rate": 9.002706204621802e-06,
1430
+ "loss": 0.7701,
1431
+ "step": 203
1432
+ },
1433
+ {
1434
+ "epoch": 0.4897959183673469,
1435
+ "grad_norm": 1.1445504107150832,
1436
+ "learning_rate": 8.99078909987467e-06,
1437
+ "loss": 0.7937,
1438
+ "step": 204
1439
+ },
1440
+ {
1441
+ "epoch": 0.4921968787515006,
1442
+ "grad_norm": 0.9975014914511301,
1443
+ "learning_rate": 8.978809202654161e-06,
1444
+ "loss": 0.7045,
1445
+ "step": 205
1446
+ },
1447
+ {
1448
+ "epoch": 0.49459783913565425,
1449
+ "grad_norm": 1.566224538850411,
1450
+ "learning_rate": 8.966766701456177e-06,
1451
+ "loss": 0.7665,
1452
+ "step": 206
1453
+ },
1454
+ {
1455
+ "epoch": 0.4969987995198079,
1456
+ "grad_norm": 1.0336200728044336,
1457
+ "learning_rate": 8.954661785761648e-06,
1458
+ "loss": 0.7635,
1459
+ "step": 207
1460
+ },
1461
+ {
1462
+ "epoch": 0.49939975990396157,
1463
+ "grad_norm": 1.2720894224504704,
1464
+ "learning_rate": 8.942494646033555e-06,
1465
+ "loss": 0.7546,
1466
+ "step": 208
1467
+ }
1468
+ ],
1469
+ "logging_steps": 1,
1470
+ "max_steps": 832,
1471
+ "num_input_tokens_seen": 0,
1472
+ "num_train_epochs": 2,
1473
+ "save_steps": 208,
1474
+ "stateful_callbacks": {
1475
+ "TrainerControl": {
1476
+ "args": {
1477
+ "should_epoch_stop": false,
1478
+ "should_evaluate": false,
1479
+ "should_log": false,
1480
+ "should_save": true,
1481
+ "should_training_stop": false
1482
+ },
1483
+ "attributes": {}
1484
+ }
1485
+ },
1486
+ "total_flos": 1.3314997980286157e+17,
1487
+ "train_batch_size": 1,
1488
+ "trial_name": null,
1489
+ "trial_params": null
1490
+ }
checkpoint-208/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:792152ea19e5a2c7444f7ec09222de7bca6342b94e2b0276449c3beea8acf729
3
+ size 9105
checkpoint-208/zero_to_fp32.py ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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:
14
+ # python zero_to_fp32.py . output_dir/
15
+ # or
16
+ # python zero_to_fp32.py . output_dir/ --safe_serialization
17
+
18
+ import argparse
19
+ import torch
20
+ import glob
21
+ import math
22
+ import os
23
+ import re
24
+ import json
25
+ from tqdm import tqdm
26
+ from collections import OrderedDict
27
+ from dataclasses import dataclass
28
+
29
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
30
+ # DeepSpeed data structures it has to be available in the current python environment.
31
+ from deepspeed.utils import logger
32
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
33
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
34
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
35
+
36
+
37
+ @dataclass
38
+ class zero_model_state:
39
+ buffers: dict()
40
+ param_shapes: dict()
41
+ shared_params: list
42
+ ds_version: int
43
+ frozen_param_shapes: dict()
44
+ frozen_param_fragments: dict()
45
+
46
+
47
+ debug = 0
48
+
49
+ # load to cpu
50
+ device = torch.device('cpu')
51
+
52
+
53
+ def atoi(text):
54
+ return int(text) if text.isdigit() else text
55
+
56
+
57
+ def natural_keys(text):
58
+ '''
59
+ alist.sort(key=natural_keys) sorts in human order
60
+ http://nedbatchelder.com/blog/200712/human_sorting.html
61
+ (See Toothy's implementation in the comments)
62
+ '''
63
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
64
+
65
+
66
+ def get_model_state_file(checkpoint_dir, zero_stage):
67
+ if not os.path.isdir(checkpoint_dir):
68
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
69
+
70
+ # there should be only one file
71
+ if zero_stage <= 2:
72
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
73
+ elif zero_stage == 3:
74
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
75
+
76
+ if not os.path.exists(file):
77
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
78
+
79
+ return file
80
+
81
+
82
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
83
+ # XXX: need to test that this simple glob rule works for multi-node setup too
84
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
85
+
86
+ if len(ckpt_files) == 0:
87
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
88
+
89
+ return ckpt_files
90
+
91
+
92
+ def get_optim_files(checkpoint_dir):
93
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
94
+
95
+
96
+ def get_model_state_files(checkpoint_dir):
97
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
98
+
99
+
100
+ def parse_model_states(files):
101
+ zero_model_states = []
102
+ for file in files:
103
+ state_dict = torch.load(file, map_location=device)
104
+
105
+ if BUFFER_NAMES not in state_dict:
106
+ raise ValueError(f"{file} is not a model state checkpoint")
107
+ buffer_names = state_dict[BUFFER_NAMES]
108
+ if debug:
109
+ print("Found buffers:", buffer_names)
110
+
111
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
112
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
113
+ param_shapes = state_dict[PARAM_SHAPES]
114
+
115
+ # collect parameters that are included in param_shapes
116
+ param_names = []
117
+ for s in param_shapes:
118
+ for name in s.keys():
119
+ param_names.append(name)
120
+
121
+ # update with frozen parameters
122
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
123
+ if frozen_param_shapes is not None:
124
+ if debug:
125
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
126
+ param_names += list(frozen_param_shapes.keys())
127
+
128
+ # handle shared params
129
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
130
+
131
+ ds_version = state_dict.get(DS_VERSION, None)
132
+
133
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
134
+
135
+ z_model_state = zero_model_state(buffers=buffers,
136
+ param_shapes=param_shapes,
137
+ shared_params=shared_params,
138
+ ds_version=ds_version,
139
+ frozen_param_shapes=frozen_param_shapes,
140
+ frozen_param_fragments=frozen_param_fragments)
141
+ zero_model_states.append(z_model_state)
142
+
143
+ return zero_model_states
144
+
145
+
146
+ def parse_optim_states(files, ds_checkpoint_dir):
147
+ total_files = len(files)
148
+ state_dicts = []
149
+ for f in files:
150
+ state_dict = torch.load(f, map_location=device)
151
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
152
+ # and also handle the case where it was already removed by another helper script
153
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
154
+ state_dicts.append(state_dict)
155
+
156
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
157
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
158
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
159
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
160
+
161
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
162
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
163
+ # use the max of the partition_count to get the dp world_size.
164
+
165
+ if type(world_size) is list:
166
+ world_size = max(world_size)
167
+
168
+ if world_size != total_files:
169
+ raise ValueError(
170
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
171
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
172
+ )
173
+
174
+ # the groups are named differently in each stage
175
+ if zero_stage <= 2:
176
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
177
+ elif zero_stage == 3:
178
+ fp32_groups_key = FP32_FLAT_GROUPS
179
+ else:
180
+ raise ValueError(f"unknown zero stage {zero_stage}")
181
+
182
+ if zero_stage <= 2:
183
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
184
+ elif zero_stage == 3:
185
+ # if there is more than one param group, there will be multiple flattened tensors - one
186
+ # flattened tensor per group - for simplicity merge them into a single tensor
187
+ #
188
+ # XXX: could make the script more memory efficient for when there are multiple groups - it
189
+ # will require matching the sub-lists of param_shapes for each param group flattened tensor
190
+
191
+ fp32_flat_groups = [
192
+ torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) for i in range(len(state_dicts))
193
+ ]
194
+
195
+ return zero_stage, world_size, fp32_flat_groups
196
+
197
+
198
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
199
+ """
200
+ Returns fp32 state_dict reconstructed from ds checkpoint
201
+
202
+ Args:
203
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
204
+
205
+ """
206
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
207
+
208
+ optim_files = get_optim_files(ds_checkpoint_dir)
209
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
210
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
211
+
212
+ model_files = get_model_state_files(ds_checkpoint_dir)
213
+
214
+ zero_model_states = parse_model_states(model_files)
215
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
216
+
217
+ if zero_stage <= 2:
218
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
219
+ exclude_frozen_parameters)
220
+ elif zero_stage == 3:
221
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
222
+ exclude_frozen_parameters)
223
+
224
+
225
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
226
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
227
+ return
228
+
229
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
230
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
231
+
232
+ if debug:
233
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
234
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
235
+
236
+ wanted_params = len(frozen_param_shapes)
237
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
238
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
239
+ print(f'Frozen params: Have {avail_numel} numels to process.')
240
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
241
+
242
+ total_params = 0
243
+ total_numel = 0
244
+ for name, shape in frozen_param_shapes.items():
245
+ total_params += 1
246
+ unpartitioned_numel = shape.numel()
247
+ total_numel += unpartitioned_numel
248
+
249
+ state_dict[name] = frozen_param_fragments[name]
250
+
251
+ if debug:
252
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
253
+
254
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
255
+
256
+
257
+ def _has_callable(obj, fn):
258
+ attr = getattr(obj, fn, None)
259
+ return callable(attr)
260
+
261
+
262
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
263
+ param_shapes = zero_model_states[0].param_shapes
264
+
265
+ # Reconstruction protocol:
266
+ #
267
+ # XXX: document this
268
+
269
+ if debug:
270
+ for i in range(world_size):
271
+ for j in range(len(fp32_flat_groups[0])):
272
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
273
+
274
+ # XXX: memory usage doubles here (zero2)
275
+ num_param_groups = len(fp32_flat_groups[0])
276
+ merged_single_partition_of_fp32_groups = []
277
+ for i in range(num_param_groups):
278
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
279
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
280
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
281
+ avail_numel = sum(
282
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
283
+
284
+ if debug:
285
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
286
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
287
+ # not asserting if there is a mismatch due to possible padding
288
+ print(f"Have {avail_numel} numels to process.")
289
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
290
+
291
+ # params
292
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
293
+ # out-of-core computing solution
294
+ total_numel = 0
295
+ total_params = 0
296
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
297
+ offset = 0
298
+ avail_numel = full_single_fp32_vector.numel()
299
+ for name, shape in shapes.items():
300
+
301
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
302
+ total_numel += unpartitioned_numel
303
+ total_params += 1
304
+
305
+ if debug:
306
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
307
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
308
+ offset += unpartitioned_numel
309
+
310
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
311
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
312
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
313
+ # live optimizer object, so we are checking that the numbers are within the right range
314
+ align_to = 2 * world_size
315
+
316
+ def zero2_align(x):
317
+ return align_to * math.ceil(x / align_to)
318
+
319
+ if debug:
320
+ print(f"original offset={offset}, avail_numel={avail_numel}")
321
+
322
+ offset = zero2_align(offset)
323
+ avail_numel = zero2_align(avail_numel)
324
+
325
+ if debug:
326
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
327
+
328
+ # Sanity check
329
+ if offset != avail_numel:
330
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
331
+
332
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
333
+
334
+
335
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
336
+ exclude_frozen_parameters):
337
+ state_dict = OrderedDict()
338
+
339
+ # buffers
340
+ buffers = zero_model_states[0].buffers
341
+ state_dict.update(buffers)
342
+ if debug:
343
+ print(f"added {len(buffers)} buffers")
344
+
345
+ if not exclude_frozen_parameters:
346
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
347
+
348
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
349
+
350
+ # recover shared parameters
351
+ for pair in zero_model_states[0].shared_params:
352
+ if pair[1] in state_dict:
353
+ state_dict[pair[0]] = state_dict[pair[1]]
354
+
355
+ return state_dict
356
+
357
+
358
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
359
+ remainder = unpartitioned_numel % world_size
360
+ padding_numel = (world_size - remainder) if remainder else 0
361
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
362
+ return partitioned_numel, padding_numel
363
+
364
+
365
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
366
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
367
+ return
368
+
369
+ if debug:
370
+ for i in range(world_size):
371
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
372
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
373
+
374
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
375
+ wanted_params = len(frozen_param_shapes)
376
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
377
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
378
+ print(f'Frozen params: Have {avail_numel} numels to process.')
379
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
380
+
381
+ total_params = 0
382
+ total_numel = 0
383
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
384
+ total_params += 1
385
+ unpartitioned_numel = shape.numel()
386
+ total_numel += unpartitioned_numel
387
+
388
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
389
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
390
+
391
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
392
+
393
+ if debug:
394
+ print(
395
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
396
+ )
397
+
398
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
399
+
400
+
401
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
402
+ param_shapes = zero_model_states[0].param_shapes
403
+ avail_numel = fp32_flat_groups[0].numel() * world_size
404
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
405
+ # param, re-consolidating each param, while dealing with padding if any
406
+
407
+ # merge list of dicts, preserving order
408
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
409
+
410
+ if debug:
411
+ for i in range(world_size):
412
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
413
+
414
+ wanted_params = len(param_shapes)
415
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
416
+ # not asserting if there is a mismatch due to possible padding
417
+ avail_numel = fp32_flat_groups[0].numel() * world_size
418
+ print(f"Trainable params: Have {avail_numel} numels to process.")
419
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
420
+
421
+ # params
422
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
423
+ # out-of-core computing solution
424
+ offset = 0
425
+ total_numel = 0
426
+ total_params = 0
427
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering Sharded Weights'):
428
+ unpartitioned_numel = shape.numel()
429
+ total_numel += unpartitioned_numel
430
+ total_params += 1
431
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
432
+
433
+ if debug:
434
+ print(
435
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
436
+ )
437
+
438
+ # XXX: memory usage doubles here
439
+ state_dict[name] = torch.cat(
440
+ tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
441
+ 0).narrow(0, 0, unpartitioned_numel).view(shape)
442
+ offset += partitioned_numel
443
+
444
+ offset *= world_size
445
+
446
+ # Sanity check
447
+ if offset != avail_numel:
448
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
449
+
450
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
451
+
452
+
453
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
454
+ exclude_frozen_parameters):
455
+ state_dict = OrderedDict()
456
+
457
+ # buffers
458
+ buffers = zero_model_states[0].buffers
459
+ state_dict.update(buffers)
460
+ if debug:
461
+ print(f"added {len(buffers)} buffers")
462
+
463
+ if not exclude_frozen_parameters:
464
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
465
+
466
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
467
+
468
+ # recover shared parameters
469
+ for pair in zero_model_states[0].shared_params:
470
+ if pair[1] in state_dict:
471
+ state_dict[pair[0]] = state_dict[pair[1]]
472
+
473
+ return state_dict
474
+
475
+
476
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=False):
477
+ """
478
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
479
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
480
+ via a model hub.
481
+
482
+ Args:
483
+ - ``checkpoint_dir``: path to the desired checkpoint folder
484
+ - ``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``
485
+ - ``exclude_frozen_parameters``: exclude frozen parameters
486
+
487
+ Returns:
488
+ - pytorch ``state_dict``
489
+
490
+ Note: this approach may not work if your application doesn't have sufficient free CPU memory and
491
+ you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
492
+ the checkpoint.
493
+
494
+ A typical usage might be ::
495
+
496
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
497
+ # do the training and checkpoint saving
498
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
499
+ model = model.cpu() # move to cpu
500
+ model.load_state_dict(state_dict)
501
+ # submit to model hub or save the model to share with others
502
+
503
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
504
+ application. i.e. you will need to re-initialize the deepspeed engine, since
505
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
506
+
507
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
508
+
509
+ """
510
+ if tag is None:
511
+ latest_path = os.path.join(checkpoint_dir, 'latest')
512
+ if os.path.isfile(latest_path):
513
+ with open(latest_path, 'r') as fd:
514
+ tag = fd.read().strip()
515
+ else:
516
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
517
+
518
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
519
+
520
+ if not os.path.isdir(ds_checkpoint_dir):
521
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
522
+
523
+ return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
524
+
525
+
526
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
527
+ output_dir,
528
+ max_shard_size="5GB",
529
+ safe_serialization=False,
530
+ tag=None,
531
+ exclude_frozen_parameters=False):
532
+ """
533
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
534
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
535
+
536
+ Args:
537
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
538
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
539
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
540
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
541
+ - ``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``
542
+ - ``exclude_frozen_parameters``: exclude frozen parameters
543
+ """
544
+ # Dependency pre-check
545
+ if safe_serialization:
546
+ try:
547
+ from safetensors.torch import save_file
548
+ except ImportError:
549
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
550
+ raise
551
+ if max_shard_size is not None:
552
+ try:
553
+ from huggingface_hub import split_torch_state_dict_into_shards
554
+ except ImportError:
555
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
556
+ raise
557
+
558
+ # Convert zero checkpoint to state_dict
559
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
560
+
561
+ # Shard the model if it is too big.
562
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
563
+ if max_shard_size is not None:
564
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
565
+ state_dict_split = split_torch_state_dict_into_shards(state_dict,
566
+ filename_pattern=filename_pattern,
567
+ max_shard_size=max_shard_size)
568
+ else:
569
+ from collections import namedtuple
570
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
571
+ state_dict_split = StateDictSplit(is_sharded=False,
572
+ filename_to_tensors={weights_name: list(state_dict.keys())})
573
+
574
+ # Save the model
575
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
576
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
577
+ shard = {tensor: state_dict[tensor].contiguous() for tensor in tensors}
578
+ output_path = os.path.join(output_dir, shard_file)
579
+ if safe_serialization:
580
+ save_file(shard, output_path, metadata={"format": "pt"})
581
+ else:
582
+ torch.save(shard, output_path)
583
+
584
+ # Save index if sharded
585
+ if state_dict_split.is_sharded:
586
+ index = {
587
+ "metadata": state_dict_split.metadata,
588
+ "weight_map": state_dict_split.tensor_to_filename,
589
+ }
590
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
591
+ save_index_file = os.path.join(output_dir, save_index_file)
592
+ with open(save_index_file, "w", encoding="utf-8") as f:
593
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
594
+ f.write(content)
595
+
596
+
597
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
598
+ """
599
+ 1. Put the provided model to cpu
600
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
601
+ 3. Load it into the provided model
602
+
603
+ Args:
604
+ - ``model``: the model object to update
605
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
606
+ - ``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``
607
+
608
+ Returns:
609
+ - ``model`: modified model
610
+
611
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
612
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
613
+ conveniently placed for you in the checkpoint folder.
614
+
615
+ A typical usage might be ::
616
+
617
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
618
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
619
+ # submit to model hub or save the model to share with others
620
+
621
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
622
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
623
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
624
+
625
+ """
626
+ logger.info(f"Extracting fp32 weights")
627
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
628
+
629
+ logger.info(f"Overwriting model with fp32 weights")
630
+ model = model.cpu()
631
+ model.load_state_dict(state_dict, strict=False)
632
+
633
+ return model
634
+
635
+
636
+ if __name__ == "__main__":
637
+ parser = argparse.ArgumentParser()
638
+ parser.add_argument("checkpoint_dir",
639
+ type=str,
640
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
641
+ parser.add_argument("output_dir",
642
+ type=str,
643
+ help="directory to the pytorch fp32 state_dict output files"
644
+ "(e.g. path/checkpoint-12-output/)")
645
+ parser.add_argument(
646
+ "--max_shard_size",
647
+ type=str,
648
+ default="5GB",
649
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
650
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
651
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
652
+ "without CPU OOM issues.")
653
+ parser.add_argument(
654
+ "--safe_serialization",
655
+ default=False,
656
+ action='store_true',
657
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
658
+ parser.add_argument("-t",
659
+ "--tag",
660
+ type=str,
661
+ default=None,
662
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
663
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
664
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
665
+ args = parser.parse_args()
666
+
667
+ debug = args.debug
668
+
669
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
670
+ args.output_dir,
671
+ max_shard_size=args.max_shard_size,
672
+ safe_serialization=args.safe_serialization,
673
+ tag=args.tag,
674
+ exclude_frozen_parameters=args.exclude_frozen_parameters)