DavidErikMollberg commited on
Commit
7460017
1 Parent(s): ed3e91a

adding checkpoint 6000

Browse files
checkpoint-6000/config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "openai/whisper-medium",
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "gelu",
5
+ "architectures": [
6
+ "WhisperForConditionalGeneration"
7
+ ],
8
+ "attention_dropout": 0.0,
9
+ "begin_suppress_tokens": [
10
+ 220,
11
+ 50257
12
+ ],
13
+ "bos_token_id": 50257,
14
+ "d_model": 1024,
15
+ "decoder_attention_heads": 16,
16
+ "decoder_ffn_dim": 4096,
17
+ "decoder_layerdrop": 0.0,
18
+ "decoder_layers": 24,
19
+ "decoder_start_token_id": 50258,
20
+ "dropout": 0.0,
21
+ "encoder_attention_heads": 16,
22
+ "encoder_ffn_dim": 4096,
23
+ "encoder_layerdrop": 0.0,
24
+ "encoder_layers": 24,
25
+ "eos_token_id": 50257,
26
+ "forced_decoder_ids": null,
27
+ "init_std": 0.02,
28
+ "is_encoder_decoder": true,
29
+ "max_length": 448,
30
+ "max_source_positions": 1500,
31
+ "max_target_positions": 448,
32
+ "model_type": "whisper",
33
+ "num_hidden_layers": 24,
34
+ "num_mel_bins": 80,
35
+ "pad_token_id": 50257,
36
+ "scale_embedding": false,
37
+ "torch_dtype": "float16",
38
+ "transformers_version": "4.26.0.dev0",
39
+ "use_cache": false,
40
+ "vocab_size": 51865
41
+ }
checkpoint-6000/global_step6000/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:235a017d37438a1c9c6d9d3fe96e5a8a5b803294909de73f9ff7887322ee4b21
3
+ size 1527967899
checkpoint-6000/global_step6000/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:9a17a4f5e0259867e1fd646c5a33eab8d0a5e98d1e61f84d0c9a2ae7a29745dc
3
+ size 9166378846
checkpoint-6000/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step6000
checkpoint-6000/preprocessor_config.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-6000/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54cd6bbe3bb4b7e34719dfbf66d1ed965431cc33215003245869ddd3befc1620
3
+ size 1527847357
checkpoint-6000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f92a27bbf0f0370921b88ccbb3b02c1f378569056abb5feff869f62853b3aac7
3
+ size 14575
checkpoint-6000/trainer_state.json ADDED
@@ -0,0 +1,1510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 12.226690123146518,
3
+ "best_model_checkpoint": "./checkpoint-6000",
4
+ "epoch": 0.2,
5
+ "global_step": 6000,
6
+ "is_hyper_param_search": false,
7
+ "is_local_process_zero": true,
8
+ "is_world_process_zero": true,
9
+ "log_history": [
10
+ {
11
+ "epoch": 0.0,
12
+ "learning_rate": 5.0453611334320685e-06,
13
+ "loss": 1.2966,
14
+ "step": 25
15
+ },
16
+ {
17
+ "epoch": 0.0,
18
+ "learning_rate": 6.229195710491767e-06,
19
+ "loss": 0.8695,
20
+ "step": 50
21
+ },
22
+ {
23
+ "epoch": 0.0,
24
+ "learning_rate": 6.903829450223392e-06,
25
+ "loss": 0.7429,
26
+ "step": 75
27
+ },
28
+ {
29
+ "epoch": 0.01,
30
+ "learning_rate": 7.377725845391017e-06,
31
+ "loss": 0.6562,
32
+ "step": 100
33
+ },
34
+ {
35
+ "epoch": 0.01,
36
+ "learning_rate": 7.743343231239583e-06,
37
+ "loss": 0.6217,
38
+ "step": 125
39
+ },
40
+ {
41
+ "epoch": 0.01,
42
+ "learning_rate": 8.041073861170494e-06,
43
+ "loss": 0.5393,
44
+ "step": 150
45
+ },
46
+ {
47
+ "epoch": 0.01,
48
+ "learning_rate": 8.292222957399574e-06,
49
+ "loss": 0.5282,
50
+ "step": 175
51
+ },
52
+ {
53
+ "epoch": 0.01,
54
+ "learning_rate": 8.509413541357755e-06,
55
+ "loss": 0.5062,
56
+ "step": 200
57
+ },
58
+ {
59
+ "epoch": 0.01,
60
+ "learning_rate": 8.700744577655557e-06,
61
+ "loss": 0.4942,
62
+ "step": 225
63
+ },
64
+ {
65
+ "epoch": 0.01,
66
+ "learning_rate": 8.871723942761204e-06,
67
+ "loss": 0.4508,
68
+ "step": 250
69
+ },
70
+ {
71
+ "epoch": 0.01,
72
+ "learning_rate": 9.026267958246849e-06,
73
+ "loss": 0.4466,
74
+ "step": 275
75
+ },
76
+ {
77
+ "epoch": 0.01,
78
+ "learning_rate": 9.16726106663399e-06,
79
+ "loss": 0.4026,
80
+ "step": 300
81
+ },
82
+ {
83
+ "epoch": 0.02,
84
+ "learning_rate": 9.296889251455016e-06,
85
+ "loss": 0.37,
86
+ "step": 325
87
+ },
88
+ {
89
+ "epoch": 0.02,
90
+ "learning_rate": 9.416848797368692e-06,
91
+ "loss": 0.3864,
92
+ "step": 350
93
+ },
94
+ {
95
+ "epoch": 0.02,
96
+ "learning_rate": 9.528482449516371e-06,
97
+ "loss": 0.3801,
98
+ "step": 375
99
+ },
100
+ {
101
+ "epoch": 0.02,
102
+ "learning_rate": 9.632871309784314e-06,
103
+ "loss": 0.3893,
104
+ "step": 400
105
+ },
106
+ {
107
+ "epoch": 0.02,
108
+ "learning_rate": 9.73089868785391e-06,
109
+ "loss": 0.4079,
110
+ "step": 425
111
+ },
112
+ {
113
+ "epoch": 0.02,
114
+ "learning_rate": 9.823295589572114e-06,
115
+ "loss": 0.3554,
116
+ "step": 450
117
+ },
118
+ {
119
+ "epoch": 0.02,
120
+ "learning_rate": 9.910673836465484e-06,
121
+ "loss": 0.3197,
122
+ "step": 475
123
+ },
124
+ {
125
+ "epoch": 0.03,
126
+ "learning_rate": 9.993550644973805e-06,
127
+ "loss": 0.3405,
128
+ "step": 500
129
+ },
130
+ {
131
+ "epoch": 0.03,
132
+ "learning_rate": 9.98871794871795e-06,
133
+ "loss": 0.3328,
134
+ "step": 525
135
+ },
136
+ {
137
+ "epoch": 0.03,
138
+ "learning_rate": 9.975897435897436e-06,
139
+ "loss": 0.3147,
140
+ "step": 550
141
+ },
142
+ {
143
+ "epoch": 0.03,
144
+ "learning_rate": 9.963076923076925e-06,
145
+ "loss": 0.2954,
146
+ "step": 575
147
+ },
148
+ {
149
+ "epoch": 0.03,
150
+ "learning_rate": 9.950256410256412e-06,
151
+ "loss": 0.3034,
152
+ "step": 600
153
+ },
154
+ {
155
+ "epoch": 0.03,
156
+ "learning_rate": 9.937435897435898e-06,
157
+ "loss": 0.2931,
158
+ "step": 625
159
+ },
160
+ {
161
+ "epoch": 0.03,
162
+ "learning_rate": 9.924615384615385e-06,
163
+ "loss": 0.2798,
164
+ "step": 650
165
+ },
166
+ {
167
+ "epoch": 0.03,
168
+ "learning_rate": 9.911794871794874e-06,
169
+ "loss": 0.2619,
170
+ "step": 675
171
+ },
172
+ {
173
+ "epoch": 0.04,
174
+ "learning_rate": 9.89897435897436e-06,
175
+ "loss": 0.3157,
176
+ "step": 700
177
+ },
178
+ {
179
+ "epoch": 0.04,
180
+ "learning_rate": 9.886153846153846e-06,
181
+ "loss": 0.2937,
182
+ "step": 725
183
+ },
184
+ {
185
+ "epoch": 0.04,
186
+ "learning_rate": 9.873333333333334e-06,
187
+ "loss": 0.2606,
188
+ "step": 750
189
+ },
190
+ {
191
+ "epoch": 0.04,
192
+ "learning_rate": 9.860512820512821e-06,
193
+ "loss": 0.2482,
194
+ "step": 775
195
+ },
196
+ {
197
+ "epoch": 0.04,
198
+ "learning_rate": 9.847692307692308e-06,
199
+ "loss": 0.2539,
200
+ "step": 800
201
+ },
202
+ {
203
+ "epoch": 0.04,
204
+ "learning_rate": 9.834871794871795e-06,
205
+ "loss": 0.2501,
206
+ "step": 825
207
+ },
208
+ {
209
+ "epoch": 0.04,
210
+ "learning_rate": 9.822051282051283e-06,
211
+ "loss": 0.241,
212
+ "step": 850
213
+ },
214
+ {
215
+ "epoch": 0.04,
216
+ "learning_rate": 9.80923076923077e-06,
217
+ "loss": 0.2323,
218
+ "step": 875
219
+ },
220
+ {
221
+ "epoch": 0.04,
222
+ "learning_rate": 9.796410256410257e-06,
223
+ "loss": 0.2507,
224
+ "step": 900
225
+ },
226
+ {
227
+ "epoch": 0.05,
228
+ "learning_rate": 9.783589743589744e-06,
229
+ "loss": 0.2157,
230
+ "step": 925
231
+ },
232
+ {
233
+ "epoch": 0.05,
234
+ "learning_rate": 9.770769230769232e-06,
235
+ "loss": 0.2356,
236
+ "step": 950
237
+ },
238
+ {
239
+ "epoch": 0.05,
240
+ "learning_rate": 9.757948717948719e-06,
241
+ "loss": 0.2352,
242
+ "step": 975
243
+ },
244
+ {
245
+ "epoch": 0.05,
246
+ "learning_rate": 9.745128205128206e-06,
247
+ "loss": 0.2181,
248
+ "step": 1000
249
+ },
250
+ {
251
+ "epoch": 0.05,
252
+ "eval_loss": 0.2607421875,
253
+ "eval_runtime": 228.2189,
254
+ "eval_samples_per_second": 4.382,
255
+ "eval_steps_per_second": 0.14,
256
+ "eval_wer": 18.384016084443328,
257
+ "step": 1000
258
+ },
259
+ {
260
+ "epoch": 0.0,
261
+ "learning_rate": 9.733333333333334e-06,
262
+ "loss": 0.2279,
263
+ "step": 1025
264
+ },
265
+ {
266
+ "epoch": 0.0,
267
+ "learning_rate": 9.720512820512822e-06,
268
+ "loss": 0.225,
269
+ "step": 1050
270
+ },
271
+ {
272
+ "epoch": 0.0,
273
+ "learning_rate": 9.707692307692308e-06,
274
+ "loss": 0.2238,
275
+ "step": 1075
276
+ },
277
+ {
278
+ "epoch": 0.01,
279
+ "learning_rate": 9.694871794871794e-06,
280
+ "loss": 0.228,
281
+ "step": 1100
282
+ },
283
+ {
284
+ "epoch": 0.01,
285
+ "learning_rate": 9.682051282051283e-06,
286
+ "loss": 0.2261,
287
+ "step": 1125
288
+ },
289
+ {
290
+ "epoch": 0.01,
291
+ "learning_rate": 9.66923076923077e-06,
292
+ "loss": 0.196,
293
+ "step": 1150
294
+ },
295
+ {
296
+ "epoch": 0.01,
297
+ "learning_rate": 9.656410256410257e-06,
298
+ "loss": 0.1962,
299
+ "step": 1175
300
+ },
301
+ {
302
+ "epoch": 0.01,
303
+ "learning_rate": 9.643589743589743e-06,
304
+ "loss": 0.1931,
305
+ "step": 1200
306
+ },
307
+ {
308
+ "epoch": 0.01,
309
+ "learning_rate": 9.630769230769232e-06,
310
+ "loss": 0.1827,
311
+ "step": 1225
312
+ },
313
+ {
314
+ "epoch": 0.01,
315
+ "learning_rate": 9.617948717948719e-06,
316
+ "loss": 0.1815,
317
+ "step": 1250
318
+ },
319
+ {
320
+ "epoch": 0.01,
321
+ "learning_rate": 9.605128205128206e-06,
322
+ "loss": 0.1972,
323
+ "step": 1275
324
+ },
325
+ {
326
+ "epoch": 0.01,
327
+ "learning_rate": 9.592307692307692e-06,
328
+ "loss": 0.1681,
329
+ "step": 1300
330
+ },
331
+ {
332
+ "epoch": 0.02,
333
+ "learning_rate": 9.579487179487181e-06,
334
+ "loss": 0.151,
335
+ "step": 1325
336
+ },
337
+ {
338
+ "epoch": 0.02,
339
+ "learning_rate": 9.566666666666668e-06,
340
+ "loss": 0.1743,
341
+ "step": 1350
342
+ },
343
+ {
344
+ "epoch": 0.02,
345
+ "learning_rate": 9.553846153846155e-06,
346
+ "loss": 0.1808,
347
+ "step": 1375
348
+ },
349
+ {
350
+ "epoch": 0.02,
351
+ "learning_rate": 9.541025641025641e-06,
352
+ "loss": 0.1984,
353
+ "step": 1400
354
+ },
355
+ {
356
+ "epoch": 0.02,
357
+ "learning_rate": 9.52820512820513e-06,
358
+ "loss": 0.2098,
359
+ "step": 1425
360
+ },
361
+ {
362
+ "epoch": 0.02,
363
+ "learning_rate": 9.515384615384617e-06,
364
+ "loss": 0.1741,
365
+ "step": 1450
366
+ },
367
+ {
368
+ "epoch": 0.02,
369
+ "learning_rate": 9.502564102564103e-06,
370
+ "loss": 0.1489,
371
+ "step": 1475
372
+ },
373
+ {
374
+ "epoch": 0.03,
375
+ "learning_rate": 9.48974358974359e-06,
376
+ "loss": 0.1655,
377
+ "step": 1500
378
+ },
379
+ {
380
+ "epoch": 0.03,
381
+ "learning_rate": 9.476923076923079e-06,
382
+ "loss": 0.1643,
383
+ "step": 1525
384
+ },
385
+ {
386
+ "epoch": 0.03,
387
+ "learning_rate": 9.464102564102566e-06,
388
+ "loss": 0.151,
389
+ "step": 1550
390
+ },
391
+ {
392
+ "epoch": 0.03,
393
+ "learning_rate": 9.451282051282052e-06,
394
+ "loss": 0.1431,
395
+ "step": 1575
396
+ },
397
+ {
398
+ "epoch": 0.03,
399
+ "learning_rate": 9.43846153846154e-06,
400
+ "loss": 0.1503,
401
+ "step": 1600
402
+ },
403
+ {
404
+ "epoch": 0.03,
405
+ "learning_rate": 9.425641025641026e-06,
406
+ "loss": 0.1491,
407
+ "step": 1625
408
+ },
409
+ {
410
+ "epoch": 0.03,
411
+ "learning_rate": 9.412820512820515e-06,
412
+ "loss": 0.1408,
413
+ "step": 1650
414
+ },
415
+ {
416
+ "epoch": 0.03,
417
+ "learning_rate": 9.4e-06,
418
+ "loss": 0.1294,
419
+ "step": 1675
420
+ },
421
+ {
422
+ "epoch": 0.04,
423
+ "learning_rate": 9.387179487179488e-06,
424
+ "loss": 0.1618,
425
+ "step": 1700
426
+ },
427
+ {
428
+ "epoch": 0.04,
429
+ "learning_rate": 9.374358974358975e-06,
430
+ "loss": 0.1484,
431
+ "step": 1725
432
+ },
433
+ {
434
+ "epoch": 0.04,
435
+ "learning_rate": 9.361538461538462e-06,
436
+ "loss": 0.1298,
437
+ "step": 1750
438
+ },
439
+ {
440
+ "epoch": 0.04,
441
+ "learning_rate": 9.348717948717949e-06,
442
+ "loss": 0.1231,
443
+ "step": 1775
444
+ },
445
+ {
446
+ "epoch": 0.04,
447
+ "learning_rate": 9.335897435897436e-06,
448
+ "loss": 0.1241,
449
+ "step": 1800
450
+ },
451
+ {
452
+ "epoch": 0.04,
453
+ "learning_rate": 9.323076923076924e-06,
454
+ "loss": 0.1215,
455
+ "step": 1825
456
+ },
457
+ {
458
+ "epoch": 0.04,
459
+ "learning_rate": 9.310256410256411e-06,
460
+ "loss": 0.1225,
461
+ "step": 1850
462
+ },
463
+ {
464
+ "epoch": 0.04,
465
+ "learning_rate": 9.297435897435898e-06,
466
+ "loss": 0.1122,
467
+ "step": 1875
468
+ },
469
+ {
470
+ "epoch": 0.04,
471
+ "learning_rate": 9.284615384615385e-06,
472
+ "loss": 0.1191,
473
+ "step": 1900
474
+ },
475
+ {
476
+ "epoch": 0.05,
477
+ "learning_rate": 9.271794871794873e-06,
478
+ "loss": 0.0995,
479
+ "step": 1925
480
+ },
481
+ {
482
+ "epoch": 0.05,
483
+ "learning_rate": 9.25897435897436e-06,
484
+ "loss": 0.1199,
485
+ "step": 1950
486
+ },
487
+ {
488
+ "epoch": 0.05,
489
+ "learning_rate": 9.246153846153847e-06,
490
+ "loss": 0.1243,
491
+ "step": 1975
492
+ },
493
+ {
494
+ "epoch": 0.05,
495
+ "learning_rate": 9.233333333333334e-06,
496
+ "loss": 0.1089,
497
+ "step": 2000
498
+ },
499
+ {
500
+ "epoch": 0.05,
501
+ "eval_loss": 0.2489013671875,
502
+ "eval_runtime": 209.1058,
503
+ "eval_samples_per_second": 4.782,
504
+ "eval_steps_per_second": 0.153,
505
+ "eval_wer": 16.486554410655945,
506
+ "step": 2000
507
+ },
508
+ {
509
+ "epoch": 0.0,
510
+ "learning_rate": 9.221538461538462e-06,
511
+ "loss": 0.1231,
512
+ "step": 2025
513
+ },
514
+ {
515
+ "epoch": 0.0,
516
+ "learning_rate": 9.208717948717948e-06,
517
+ "loss": 0.1173,
518
+ "step": 2050
519
+ },
520
+ {
521
+ "epoch": 0.0,
522
+ "learning_rate": 9.195897435897437e-06,
523
+ "loss": 0.1234,
524
+ "step": 2075
525
+ },
526
+ {
527
+ "epoch": 0.01,
528
+ "learning_rate": 9.183076923076924e-06,
529
+ "loss": 0.1244,
530
+ "step": 2100
531
+ },
532
+ {
533
+ "epoch": 0.01,
534
+ "learning_rate": 9.17025641025641e-06,
535
+ "loss": 0.1223,
536
+ "step": 2125
537
+ },
538
+ {
539
+ "epoch": 0.01,
540
+ "learning_rate": 9.157435897435897e-06,
541
+ "loss": 0.1027,
542
+ "step": 2150
543
+ },
544
+ {
545
+ "epoch": 0.01,
546
+ "learning_rate": 9.144615384615386e-06,
547
+ "loss": 0.1022,
548
+ "step": 2175
549
+ },
550
+ {
551
+ "epoch": 0.01,
552
+ "learning_rate": 9.131794871794873e-06,
553
+ "loss": 0.1013,
554
+ "step": 2200
555
+ },
556
+ {
557
+ "epoch": 0.01,
558
+ "learning_rate": 9.11897435897436e-06,
559
+ "loss": 0.0949,
560
+ "step": 2225
561
+ },
562
+ {
563
+ "epoch": 0.01,
564
+ "learning_rate": 9.106153846153846e-06,
565
+ "loss": 0.0971,
566
+ "step": 2250
567
+ },
568
+ {
569
+ "epoch": 0.01,
570
+ "learning_rate": 9.093333333333333e-06,
571
+ "loss": 0.1098,
572
+ "step": 2275
573
+ },
574
+ {
575
+ "epoch": 0.01,
576
+ "learning_rate": 9.080512820512822e-06,
577
+ "loss": 0.0861,
578
+ "step": 2300
579
+ },
580
+ {
581
+ "epoch": 0.02,
582
+ "learning_rate": 9.067692307692309e-06,
583
+ "loss": 0.0765,
584
+ "step": 2325
585
+ },
586
+ {
587
+ "epoch": 0.02,
588
+ "learning_rate": 9.054871794871795e-06,
589
+ "loss": 0.0933,
590
+ "step": 2350
591
+ },
592
+ {
593
+ "epoch": 0.02,
594
+ "learning_rate": 9.042051282051282e-06,
595
+ "loss": 0.1025,
596
+ "step": 2375
597
+ },
598
+ {
599
+ "epoch": 0.02,
600
+ "learning_rate": 9.02923076923077e-06,
601
+ "loss": 0.1138,
602
+ "step": 2400
603
+ },
604
+ {
605
+ "epoch": 0.02,
606
+ "learning_rate": 9.016410256410258e-06,
607
+ "loss": 0.1198,
608
+ "step": 2425
609
+ },
610
+ {
611
+ "epoch": 0.02,
612
+ "learning_rate": 9.003589743589744e-06,
613
+ "loss": 0.0981,
614
+ "step": 2450
615
+ },
616
+ {
617
+ "epoch": 0.02,
618
+ "learning_rate": 8.990769230769231e-06,
619
+ "loss": 0.0807,
620
+ "step": 2475
621
+ },
622
+ {
623
+ "epoch": 0.03,
624
+ "learning_rate": 8.97794871794872e-06,
625
+ "loss": 0.0875,
626
+ "step": 2500
627
+ },
628
+ {
629
+ "epoch": 0.03,
630
+ "learning_rate": 8.965128205128207e-06,
631
+ "loss": 0.0911,
632
+ "step": 2525
633
+ },
634
+ {
635
+ "epoch": 0.03,
636
+ "learning_rate": 8.952307692307693e-06,
637
+ "loss": 0.0796,
638
+ "step": 2550
639
+ },
640
+ {
641
+ "epoch": 0.03,
642
+ "learning_rate": 8.93948717948718e-06,
643
+ "loss": 0.0766,
644
+ "step": 2575
645
+ },
646
+ {
647
+ "epoch": 0.03,
648
+ "learning_rate": 8.926666666666669e-06,
649
+ "loss": 0.0862,
650
+ "step": 2600
651
+ },
652
+ {
653
+ "epoch": 0.03,
654
+ "learning_rate": 8.913846153846154e-06,
655
+ "loss": 0.0822,
656
+ "step": 2625
657
+ },
658
+ {
659
+ "epoch": 0.03,
660
+ "learning_rate": 8.90102564102564e-06,
661
+ "loss": 0.0757,
662
+ "step": 2650
663
+ },
664
+ {
665
+ "epoch": 0.03,
666
+ "learning_rate": 8.88820512820513e-06,
667
+ "loss": 0.0674,
668
+ "step": 2675
669
+ },
670
+ {
671
+ "epoch": 0.04,
672
+ "learning_rate": 8.875384615384616e-06,
673
+ "loss": 0.0913,
674
+ "step": 2700
675
+ },
676
+ {
677
+ "epoch": 0.04,
678
+ "learning_rate": 8.862564102564103e-06,
679
+ "loss": 0.0815,
680
+ "step": 2725
681
+ },
682
+ {
683
+ "epoch": 0.04,
684
+ "learning_rate": 8.84974358974359e-06,
685
+ "loss": 0.0687,
686
+ "step": 2750
687
+ },
688
+ {
689
+ "epoch": 0.04,
690
+ "learning_rate": 8.836923076923078e-06,
691
+ "loss": 0.0649,
692
+ "step": 2775
693
+ },
694
+ {
695
+ "epoch": 0.04,
696
+ "learning_rate": 8.824102564102565e-06,
697
+ "loss": 0.0647,
698
+ "step": 2800
699
+ },
700
+ {
701
+ "epoch": 0.04,
702
+ "learning_rate": 8.811282051282052e-06,
703
+ "loss": 0.0607,
704
+ "step": 2825
705
+ },
706
+ {
707
+ "epoch": 0.04,
708
+ "learning_rate": 8.798461538461539e-06,
709
+ "loss": 0.065,
710
+ "step": 2850
711
+ },
712
+ {
713
+ "epoch": 0.04,
714
+ "learning_rate": 8.785641025641025e-06,
715
+ "loss": 0.058,
716
+ "step": 2875
717
+ },
718
+ {
719
+ "epoch": 0.04,
720
+ "learning_rate": 8.772820512820514e-06,
721
+ "loss": 0.0618,
722
+ "step": 2900
723
+ },
724
+ {
725
+ "epoch": 0.05,
726
+ "learning_rate": 8.76e-06,
727
+ "loss": 0.0491,
728
+ "step": 2925
729
+ },
730
+ {
731
+ "epoch": 0.05,
732
+ "learning_rate": 8.747179487179488e-06,
733
+ "loss": 0.0646,
734
+ "step": 2950
735
+ },
736
+ {
737
+ "epoch": 0.05,
738
+ "learning_rate": 8.734358974358974e-06,
739
+ "loss": 0.0673,
740
+ "step": 2975
741
+ },
742
+ {
743
+ "epoch": 0.05,
744
+ "learning_rate": 8.721538461538463e-06,
745
+ "loss": 0.0564,
746
+ "step": 3000
747
+ },
748
+ {
749
+ "epoch": 0.05,
750
+ "eval_loss": 0.261474609375,
751
+ "eval_runtime": 212.2501,
752
+ "eval_samples_per_second": 4.711,
753
+ "eval_steps_per_second": 0.151,
754
+ "eval_wer": 16.14727318421714,
755
+ "step": 3000
756
+ },
757
+ {
758
+ "epoch": 0.05,
759
+ "learning_rate": 8.70974358974359e-06,
760
+ "loss": 0.1893,
761
+ "step": 3025
762
+ },
763
+ {
764
+ "epoch": 0.05,
765
+ "learning_rate": 8.696923076923078e-06,
766
+ "loss": 0.1774,
767
+ "step": 3050
768
+ },
769
+ {
770
+ "epoch": 0.05,
771
+ "learning_rate": 8.684102564102565e-06,
772
+ "loss": 0.1866,
773
+ "step": 3075
774
+ },
775
+ {
776
+ "epoch": 0.06,
777
+ "learning_rate": 8.671282051282051e-06,
778
+ "loss": 0.1896,
779
+ "step": 3100
780
+ },
781
+ {
782
+ "epoch": 0.06,
783
+ "learning_rate": 8.658461538461538e-06,
784
+ "loss": 0.1925,
785
+ "step": 3125
786
+ },
787
+ {
788
+ "epoch": 0.06,
789
+ "learning_rate": 8.645641025641027e-06,
790
+ "loss": 0.2126,
791
+ "step": 3150
792
+ },
793
+ {
794
+ "epoch": 0.06,
795
+ "learning_rate": 8.632820512820514e-06,
796
+ "loss": 0.2004,
797
+ "step": 3175
798
+ },
799
+ {
800
+ "epoch": 0.06,
801
+ "learning_rate": 8.62e-06,
802
+ "loss": 0.1636,
803
+ "step": 3200
804
+ },
805
+ {
806
+ "epoch": 0.06,
807
+ "learning_rate": 8.607179487179487e-06,
808
+ "loss": 0.1597,
809
+ "step": 3225
810
+ },
811
+ {
812
+ "epoch": 0.06,
813
+ "learning_rate": 8.594358974358976e-06,
814
+ "loss": 0.1768,
815
+ "step": 3250
816
+ },
817
+ {
818
+ "epoch": 0.06,
819
+ "learning_rate": 8.581538461538463e-06,
820
+ "loss": 0.1684,
821
+ "step": 3275
822
+ },
823
+ {
824
+ "epoch": 0.07,
825
+ "learning_rate": 8.56871794871795e-06,
826
+ "loss": 0.1739,
827
+ "step": 3300
828
+ },
829
+ {
830
+ "epoch": 0.07,
831
+ "learning_rate": 8.555897435897436e-06,
832
+ "loss": 0.1706,
833
+ "step": 3325
834
+ },
835
+ {
836
+ "epoch": 0.07,
837
+ "learning_rate": 8.543076923076923e-06,
838
+ "loss": 0.1701,
839
+ "step": 3350
840
+ },
841
+ {
842
+ "epoch": 0.07,
843
+ "learning_rate": 8.530256410256412e-06,
844
+ "loss": 0.1564,
845
+ "step": 3375
846
+ },
847
+ {
848
+ "epoch": 0.07,
849
+ "learning_rate": 8.517435897435898e-06,
850
+ "loss": 0.1627,
851
+ "step": 3400
852
+ },
853
+ {
854
+ "epoch": 0.07,
855
+ "learning_rate": 8.504615384615385e-06,
856
+ "loss": 0.1586,
857
+ "step": 3425
858
+ },
859
+ {
860
+ "epoch": 0.07,
861
+ "learning_rate": 8.491794871794872e-06,
862
+ "loss": 0.1579,
863
+ "step": 3450
864
+ },
865
+ {
866
+ "epoch": 0.07,
867
+ "learning_rate": 8.47897435897436e-06,
868
+ "loss": 0.1676,
869
+ "step": 3475
870
+ },
871
+ {
872
+ "epoch": 0.07,
873
+ "learning_rate": 8.466153846153847e-06,
874
+ "loss": 0.1558,
875
+ "step": 3500
876
+ },
877
+ {
878
+ "epoch": 0.08,
879
+ "learning_rate": 8.453333333333334e-06,
880
+ "loss": 0.1624,
881
+ "step": 3525
882
+ },
883
+ {
884
+ "epoch": 0.08,
885
+ "learning_rate": 8.440512820512821e-06,
886
+ "loss": 0.1459,
887
+ "step": 3550
888
+ },
889
+ {
890
+ "epoch": 0.08,
891
+ "learning_rate": 8.427692307692308e-06,
892
+ "loss": 0.151,
893
+ "step": 3575
894
+ },
895
+ {
896
+ "epoch": 0.08,
897
+ "learning_rate": 8.414871794871795e-06,
898
+ "loss": 0.1524,
899
+ "step": 3600
900
+ },
901
+ {
902
+ "epoch": 0.08,
903
+ "learning_rate": 8.402051282051282e-06,
904
+ "loss": 0.1444,
905
+ "step": 3625
906
+ },
907
+ {
908
+ "epoch": 0.08,
909
+ "learning_rate": 8.38923076923077e-06,
910
+ "loss": 0.1218,
911
+ "step": 3650
912
+ },
913
+ {
914
+ "epoch": 0.08,
915
+ "learning_rate": 8.376410256410257e-06,
916
+ "loss": 0.1207,
917
+ "step": 3675
918
+ },
919
+ {
920
+ "epoch": 0.09,
921
+ "learning_rate": 8.363589743589744e-06,
922
+ "loss": 0.1199,
923
+ "step": 3700
924
+ },
925
+ {
926
+ "epoch": 0.09,
927
+ "learning_rate": 8.35076923076923e-06,
928
+ "loss": 0.1154,
929
+ "step": 3725
930
+ },
931
+ {
932
+ "epoch": 0.09,
933
+ "learning_rate": 8.337948717948719e-06,
934
+ "loss": 0.1075,
935
+ "step": 3750
936
+ },
937
+ {
938
+ "epoch": 0.09,
939
+ "learning_rate": 8.325128205128206e-06,
940
+ "loss": 0.1005,
941
+ "step": 3775
942
+ },
943
+ {
944
+ "epoch": 0.09,
945
+ "learning_rate": 8.312307692307693e-06,
946
+ "loss": 0.1053,
947
+ "step": 3800
948
+ },
949
+ {
950
+ "epoch": 0.09,
951
+ "learning_rate": 8.29948717948718e-06,
952
+ "loss": 0.1087,
953
+ "step": 3825
954
+ },
955
+ {
956
+ "epoch": 0.09,
957
+ "learning_rate": 8.286666666666668e-06,
958
+ "loss": 0.1207,
959
+ "step": 3850
960
+ },
961
+ {
962
+ "epoch": 0.09,
963
+ "learning_rate": 8.273846153846155e-06,
964
+ "loss": 0.1099,
965
+ "step": 3875
966
+ },
967
+ {
968
+ "epoch": 0.1,
969
+ "learning_rate": 8.261025641025642e-06,
970
+ "loss": 0.1054,
971
+ "step": 3900
972
+ },
973
+ {
974
+ "epoch": 0.1,
975
+ "learning_rate": 8.248205128205129e-06,
976
+ "loss": 0.1019,
977
+ "step": 3925
978
+ },
979
+ {
980
+ "epoch": 0.1,
981
+ "learning_rate": 8.235384615384615e-06,
982
+ "loss": 0.0974,
983
+ "step": 3950
984
+ },
985
+ {
986
+ "epoch": 0.1,
987
+ "learning_rate": 8.222564102564104e-06,
988
+ "loss": 0.0975,
989
+ "step": 3975
990
+ },
991
+ {
992
+ "epoch": 0.1,
993
+ "learning_rate": 8.20974358974359e-06,
994
+ "loss": 0.1031,
995
+ "step": 4000
996
+ },
997
+ {
998
+ "epoch": 0.1,
999
+ "eval_loss": 0.1995849609375,
1000
+ "eval_runtime": 214.2177,
1001
+ "eval_samples_per_second": 4.668,
1002
+ "eval_steps_per_second": 0.149,
1003
+ "eval_wer": 14.224679567730586,
1004
+ "step": 4000
1005
+ },
1006
+ {
1007
+ "epoch": 0.1,
1008
+ "learning_rate": 8.197948717948719e-06,
1009
+ "loss": 0.1122,
1010
+ "step": 4025
1011
+ },
1012
+ {
1013
+ "epoch": 0.1,
1014
+ "learning_rate": 8.185128205128206e-06,
1015
+ "loss": 0.1038,
1016
+ "step": 4050
1017
+ },
1018
+ {
1019
+ "epoch": 0.1,
1020
+ "learning_rate": 8.172307692307692e-06,
1021
+ "loss": 0.1172,
1022
+ "step": 4075
1023
+ },
1024
+ {
1025
+ "epoch": 0.1,
1026
+ "learning_rate": 8.15948717948718e-06,
1027
+ "loss": 0.1251,
1028
+ "step": 4100
1029
+ },
1030
+ {
1031
+ "epoch": 0.11,
1032
+ "learning_rate": 8.146666666666668e-06,
1033
+ "loss": 0.1306,
1034
+ "step": 4125
1035
+ },
1036
+ {
1037
+ "epoch": 0.11,
1038
+ "learning_rate": 8.133846153846155e-06,
1039
+ "loss": 0.1043,
1040
+ "step": 4150
1041
+ },
1042
+ {
1043
+ "epoch": 0.11,
1044
+ "learning_rate": 8.121025641025641e-06,
1045
+ "loss": 0.1095,
1046
+ "step": 4175
1047
+ },
1048
+ {
1049
+ "epoch": 0.11,
1050
+ "learning_rate": 8.108205128205128e-06,
1051
+ "loss": 0.1194,
1052
+ "step": 4200
1053
+ },
1054
+ {
1055
+ "epoch": 0.11,
1056
+ "learning_rate": 8.095384615384617e-06,
1057
+ "loss": 0.1209,
1058
+ "step": 4225
1059
+ },
1060
+ {
1061
+ "epoch": 0.11,
1062
+ "learning_rate": 8.082564102564104e-06,
1063
+ "loss": 0.1108,
1064
+ "step": 4250
1065
+ },
1066
+ {
1067
+ "epoch": 0.11,
1068
+ "learning_rate": 8.06974358974359e-06,
1069
+ "loss": 0.1059,
1070
+ "step": 4275
1071
+ },
1072
+ {
1073
+ "epoch": 0.12,
1074
+ "learning_rate": 8.056923076923077e-06,
1075
+ "loss": 0.0923,
1076
+ "step": 4300
1077
+ },
1078
+ {
1079
+ "epoch": 0.12,
1080
+ "learning_rate": 8.044102564102566e-06,
1081
+ "loss": 0.1027,
1082
+ "step": 4325
1083
+ },
1084
+ {
1085
+ "epoch": 0.12,
1086
+ "learning_rate": 8.031282051282053e-06,
1087
+ "loss": 0.1008,
1088
+ "step": 4350
1089
+ },
1090
+ {
1091
+ "epoch": 0.12,
1092
+ "learning_rate": 8.01846153846154e-06,
1093
+ "loss": 0.0885,
1094
+ "step": 4375
1095
+ },
1096
+ {
1097
+ "epoch": 0.12,
1098
+ "learning_rate": 8.005641025641026e-06,
1099
+ "loss": 0.0916,
1100
+ "step": 4400
1101
+ },
1102
+ {
1103
+ "epoch": 0.12,
1104
+ "learning_rate": 7.992820512820515e-06,
1105
+ "loss": 0.1045,
1106
+ "step": 4425
1107
+ },
1108
+ {
1109
+ "epoch": 0.12,
1110
+ "learning_rate": 7.980000000000002e-06,
1111
+ "loss": 0.0954,
1112
+ "step": 4450
1113
+ },
1114
+ {
1115
+ "epoch": 0.12,
1116
+ "learning_rate": 7.967179487179488e-06,
1117
+ "loss": 0.1013,
1118
+ "step": 4475
1119
+ },
1120
+ {
1121
+ "epoch": 0.12,
1122
+ "learning_rate": 7.954358974358975e-06,
1123
+ "loss": 0.0983,
1124
+ "step": 4500
1125
+ },
1126
+ {
1127
+ "epoch": 0.13,
1128
+ "learning_rate": 7.941538461538462e-06,
1129
+ "loss": 0.1021,
1130
+ "step": 4525
1131
+ },
1132
+ {
1133
+ "epoch": 0.13,
1134
+ "learning_rate": 7.928717948717949e-06,
1135
+ "loss": 0.1024,
1136
+ "step": 4550
1137
+ },
1138
+ {
1139
+ "epoch": 0.13,
1140
+ "learning_rate": 7.915897435897436e-06,
1141
+ "loss": 0.1068,
1142
+ "step": 4575
1143
+ },
1144
+ {
1145
+ "epoch": 0.13,
1146
+ "learning_rate": 7.903076923076922e-06,
1147
+ "loss": 0.1057,
1148
+ "step": 4600
1149
+ },
1150
+ {
1151
+ "epoch": 0.13,
1152
+ "learning_rate": 7.890256410256411e-06,
1153
+ "loss": 0.1144,
1154
+ "step": 4625
1155
+ },
1156
+ {
1157
+ "epoch": 0.13,
1158
+ "learning_rate": 7.877435897435898e-06,
1159
+ "loss": 0.1401,
1160
+ "step": 4650
1161
+ },
1162
+ {
1163
+ "epoch": 0.13,
1164
+ "learning_rate": 7.864615384615385e-06,
1165
+ "loss": 0.1234,
1166
+ "step": 4675
1167
+ },
1168
+ {
1169
+ "epoch": 0.14,
1170
+ "learning_rate": 7.851794871794871e-06,
1171
+ "loss": 0.1364,
1172
+ "step": 4700
1173
+ },
1174
+ {
1175
+ "epoch": 0.14,
1176
+ "learning_rate": 7.83897435897436e-06,
1177
+ "loss": 0.1367,
1178
+ "step": 4725
1179
+ },
1180
+ {
1181
+ "epoch": 0.14,
1182
+ "learning_rate": 7.826153846153847e-06,
1183
+ "loss": 0.1399,
1184
+ "step": 4750
1185
+ },
1186
+ {
1187
+ "epoch": 0.14,
1188
+ "learning_rate": 7.813333333333334e-06,
1189
+ "loss": 0.1387,
1190
+ "step": 4775
1191
+ },
1192
+ {
1193
+ "epoch": 0.14,
1194
+ "learning_rate": 7.80051282051282e-06,
1195
+ "loss": 0.1429,
1196
+ "step": 4800
1197
+ },
1198
+ {
1199
+ "epoch": 0.14,
1200
+ "learning_rate": 7.787692307692309e-06,
1201
+ "loss": 0.134,
1202
+ "step": 4825
1203
+ },
1204
+ {
1205
+ "epoch": 0.14,
1206
+ "learning_rate": 7.774871794871796e-06,
1207
+ "loss": 0.1615,
1208
+ "step": 4850
1209
+ },
1210
+ {
1211
+ "epoch": 0.14,
1212
+ "learning_rate": 7.762051282051283e-06,
1213
+ "loss": 0.1502,
1214
+ "step": 4875
1215
+ },
1216
+ {
1217
+ "epoch": 0.14,
1218
+ "learning_rate": 7.74923076923077e-06,
1219
+ "loss": 0.1574,
1220
+ "step": 4900
1221
+ },
1222
+ {
1223
+ "epoch": 0.15,
1224
+ "learning_rate": 7.736410256410258e-06,
1225
+ "loss": 0.1529,
1226
+ "step": 4925
1227
+ },
1228
+ {
1229
+ "epoch": 0.15,
1230
+ "learning_rate": 7.723589743589745e-06,
1231
+ "loss": 0.1406,
1232
+ "step": 4950
1233
+ },
1234
+ {
1235
+ "epoch": 0.15,
1236
+ "learning_rate": 7.710769230769232e-06,
1237
+ "loss": 0.1363,
1238
+ "step": 4975
1239
+ },
1240
+ {
1241
+ "epoch": 0.15,
1242
+ "learning_rate": 7.697948717948718e-06,
1243
+ "loss": 0.14,
1244
+ "step": 5000
1245
+ },
1246
+ {
1247
+ "epoch": 0.15,
1248
+ "eval_loss": 0.18212890625,
1249
+ "eval_runtime": 217.0927,
1250
+ "eval_samples_per_second": 4.606,
1251
+ "eval_steps_per_second": 0.147,
1252
+ "eval_wer": 13.005780346820808,
1253
+ "step": 5000
1254
+ },
1255
+ {
1256
+ "epoch": 0.15,
1257
+ "learning_rate": 7.686153846153846e-06,
1258
+ "loss": 0.1421,
1259
+ "step": 5025
1260
+ },
1261
+ {
1262
+ "epoch": 0.15,
1263
+ "learning_rate": 7.673333333333333e-06,
1264
+ "loss": 0.1507,
1265
+ "step": 5050
1266
+ },
1267
+ {
1268
+ "epoch": 0.15,
1269
+ "learning_rate": 7.660512820512822e-06,
1270
+ "loss": 0.1445,
1271
+ "step": 5075
1272
+ },
1273
+ {
1274
+ "epoch": 0.15,
1275
+ "learning_rate": 7.647692307692309e-06,
1276
+ "loss": 0.1517,
1277
+ "step": 5100
1278
+ },
1279
+ {
1280
+ "epoch": 0.16,
1281
+ "learning_rate": 7.634871794871795e-06,
1282
+ "loss": 0.1363,
1283
+ "step": 5125
1284
+ },
1285
+ {
1286
+ "epoch": 0.16,
1287
+ "learning_rate": 7.622051282051282e-06,
1288
+ "loss": 0.1548,
1289
+ "step": 5150
1290
+ },
1291
+ {
1292
+ "epoch": 0.16,
1293
+ "learning_rate": 7.60923076923077e-06,
1294
+ "loss": 0.1403,
1295
+ "step": 5175
1296
+ },
1297
+ {
1298
+ "epoch": 0.16,
1299
+ "learning_rate": 7.596410256410257e-06,
1300
+ "loss": 0.1543,
1301
+ "step": 5200
1302
+ },
1303
+ {
1304
+ "epoch": 0.16,
1305
+ "learning_rate": 7.5835897435897444e-06,
1306
+ "loss": 0.1386,
1307
+ "step": 5225
1308
+ },
1309
+ {
1310
+ "epoch": 0.16,
1311
+ "learning_rate": 7.570769230769231e-06,
1312
+ "loss": 0.1194,
1313
+ "step": 5250
1314
+ },
1315
+ {
1316
+ "epoch": 0.16,
1317
+ "learning_rate": 7.557948717948719e-06,
1318
+ "loss": 0.1075,
1319
+ "step": 5275
1320
+ },
1321
+ {
1322
+ "epoch": 0.17,
1323
+ "learning_rate": 7.545128205128206e-06,
1324
+ "loss": 0.1076,
1325
+ "step": 5300
1326
+ },
1327
+ {
1328
+ "epoch": 0.17,
1329
+ "learning_rate": 7.5323076923076934e-06,
1330
+ "loss": 0.1034,
1331
+ "step": 5325
1332
+ },
1333
+ {
1334
+ "epoch": 0.17,
1335
+ "learning_rate": 7.51948717948718e-06,
1336
+ "loss": 0.1096,
1337
+ "step": 5350
1338
+ },
1339
+ {
1340
+ "epoch": 0.17,
1341
+ "learning_rate": 7.506666666666668e-06,
1342
+ "loss": 0.1051,
1343
+ "step": 5375
1344
+ },
1345
+ {
1346
+ "epoch": 0.17,
1347
+ "learning_rate": 7.493846153846155e-06,
1348
+ "loss": 0.0989,
1349
+ "step": 5400
1350
+ },
1351
+ {
1352
+ "epoch": 0.17,
1353
+ "learning_rate": 7.481025641025642e-06,
1354
+ "loss": 0.1002,
1355
+ "step": 5425
1356
+ },
1357
+ {
1358
+ "epoch": 0.17,
1359
+ "learning_rate": 7.468205128205129e-06,
1360
+ "loss": 0.0961,
1361
+ "step": 5450
1362
+ },
1363
+ {
1364
+ "epoch": 0.17,
1365
+ "learning_rate": 7.455384615384615e-06,
1366
+ "loss": 0.1017,
1367
+ "step": 5475
1368
+ },
1369
+ {
1370
+ "epoch": 0.17,
1371
+ "learning_rate": 7.442564102564103e-06,
1372
+ "loss": 0.088,
1373
+ "step": 5500
1374
+ },
1375
+ {
1376
+ "epoch": 0.18,
1377
+ "learning_rate": 7.42974358974359e-06,
1378
+ "loss": 0.0921,
1379
+ "step": 5525
1380
+ },
1381
+ {
1382
+ "epoch": 0.18,
1383
+ "learning_rate": 7.416923076923077e-06,
1384
+ "loss": 0.0921,
1385
+ "step": 5550
1386
+ },
1387
+ {
1388
+ "epoch": 0.18,
1389
+ "learning_rate": 7.404102564102564e-06,
1390
+ "loss": 0.0853,
1391
+ "step": 5575
1392
+ },
1393
+ {
1394
+ "epoch": 0.18,
1395
+ "learning_rate": 7.391282051282052e-06,
1396
+ "loss": 0.0752,
1397
+ "step": 5600
1398
+ },
1399
+ {
1400
+ "epoch": 0.18,
1401
+ "learning_rate": 7.378461538461539e-06,
1402
+ "loss": 0.0705,
1403
+ "step": 5625
1404
+ },
1405
+ {
1406
+ "epoch": 0.18,
1407
+ "learning_rate": 7.365641025641026e-06,
1408
+ "loss": 0.0743,
1409
+ "step": 5650
1410
+ },
1411
+ {
1412
+ "epoch": 0.18,
1413
+ "learning_rate": 7.352820512820513e-06,
1414
+ "loss": 0.0859,
1415
+ "step": 5675
1416
+ },
1417
+ {
1418
+ "epoch": 0.18,
1419
+ "learning_rate": 7.340000000000001e-06,
1420
+ "loss": 0.0759,
1421
+ "step": 5700
1422
+ },
1423
+ {
1424
+ "epoch": 0.19,
1425
+ "learning_rate": 7.327179487179488e-06,
1426
+ "loss": 0.0821,
1427
+ "step": 5725
1428
+ },
1429
+ {
1430
+ "epoch": 0.19,
1431
+ "learning_rate": 7.3143589743589745e-06,
1432
+ "loss": 0.0824,
1433
+ "step": 5750
1434
+ },
1435
+ {
1436
+ "epoch": 0.19,
1437
+ "learning_rate": 7.301538461538462e-06,
1438
+ "loss": 0.0747,
1439
+ "step": 5775
1440
+ },
1441
+ {
1442
+ "epoch": 0.19,
1443
+ "learning_rate": 7.288717948717949e-06,
1444
+ "loss": 0.072,
1445
+ "step": 5800
1446
+ },
1447
+ {
1448
+ "epoch": 0.19,
1449
+ "learning_rate": 7.275897435897437e-06,
1450
+ "loss": 0.0785,
1451
+ "step": 5825
1452
+ },
1453
+ {
1454
+ "epoch": 0.19,
1455
+ "learning_rate": 7.2630769230769235e-06,
1456
+ "loss": 0.0751,
1457
+ "step": 5850
1458
+ },
1459
+ {
1460
+ "epoch": 0.19,
1461
+ "learning_rate": 7.250256410256411e-06,
1462
+ "loss": 0.0822,
1463
+ "step": 5875
1464
+ },
1465
+ {
1466
+ "epoch": 0.2,
1467
+ "learning_rate": 7.237435897435898e-06,
1468
+ "loss": 0.101,
1469
+ "step": 5900
1470
+ },
1471
+ {
1472
+ "epoch": 0.2,
1473
+ "learning_rate": 7.224615384615386e-06,
1474
+ "loss": 0.0896,
1475
+ "step": 5925
1476
+ },
1477
+ {
1478
+ "epoch": 0.2,
1479
+ "learning_rate": 7.2117948717948725e-06,
1480
+ "loss": 0.1193,
1481
+ "step": 5950
1482
+ },
1483
+ {
1484
+ "epoch": 0.2,
1485
+ "learning_rate": 7.19897435897436e-06,
1486
+ "loss": 0.0841,
1487
+ "step": 5975
1488
+ },
1489
+ {
1490
+ "epoch": 0.2,
1491
+ "learning_rate": 7.186153846153847e-06,
1492
+ "loss": 0.0872,
1493
+ "step": 6000
1494
+ },
1495
+ {
1496
+ "epoch": 0.2,
1497
+ "eval_loss": 0.1734619140625,
1498
+ "eval_runtime": 224.4062,
1499
+ "eval_samples_per_second": 4.456,
1500
+ "eval_steps_per_second": 0.143,
1501
+ "eval_wer": 12.226690123146518,
1502
+ "step": 6000
1503
+ }
1504
+ ],
1505
+ "max_steps": 20000,
1506
+ "num_train_epochs": 9223372036854775807,
1507
+ "total_flos": 3.9191228855447716e+20,
1508
+ "trial_name": null,
1509
+ "trial_params": null
1510
+ }
checkpoint-6000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3261208c10fe629e4db911bd85a63442dc29a9f5a7d2fd10502e57c4432d708
3
+ size 4731
checkpoint-6000/zero_to_fp32.py ADDED
@@ -0,0 +1,482 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # This script extracts fp32 consolidated weights from a zero 2 and 3 DeepSpeed checkpoints. It gets
4
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
5
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
6
+ # application.
7
+ #
8
+ # example: python zero_to_fp32.py . pytorch_model.bin
9
+
10
+ import argparse
11
+ import torch
12
+ import glob
13
+ import math
14
+ import os
15
+ import re
16
+ from collections import OrderedDict
17
+
18
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
19
+ # DeepSpeed data structures it has to be available in the current python environment.
20
+ from deepspeed.utils import logger
21
+ from deepspeed.checkpoint.constants import (DS_VERSION,
22
+ OPTIMIZER_STATE_DICT,
23
+ SINGLE_PARTITION_OF_FP32_GROUPS,
24
+ FP32_FLAT_GROUPS,
25
+ ZERO_STAGE,
26
+ PARTITION_COUNT,
27
+ PARAM_SHAPES,
28
+ BUFFER_NAMES)
29
+
30
+ debug = 0
31
+
32
+ # load to cpu
33
+ device = torch.device('cpu')
34
+
35
+
36
+ def atoi(text):
37
+ return int(text) if text.isdigit() else text
38
+
39
+
40
+ def natural_keys(text):
41
+ '''
42
+ alist.sort(key=natural_keys) sorts in human order
43
+ http://nedbatchelder.com/blog/200712/human_sorting.html
44
+ (See Toothy's implementation in the comments)
45
+ '''
46
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
47
+
48
+
49
+ def get_model_state_file(checkpoint_dir, zero_stage):
50
+ if not os.path.isdir(checkpoint_dir):
51
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
52
+
53
+ # there should be only one file
54
+ if zero_stage == 2:
55
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
56
+ elif zero_stage == 3:
57
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
58
+
59
+ if not os.path.exists(file):
60
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
61
+
62
+ return file
63
+
64
+
65
+ def get_optim_files(checkpoint_dir):
66
+ # XXX: need to test that this simple glob rule works for multi-node setup too
67
+ optim_files = sorted(glob.glob(os.path.join(checkpoint_dir,
68
+ "*_optim_states.pt")),
69
+ key=natural_keys)
70
+
71
+ if len(optim_files) == 0:
72
+ raise FileNotFoundError(
73
+ f"can't find '*_optim_states.pt' files in directory '{checkpoint_dir}'")
74
+
75
+ return optim_files
76
+
77
+
78
+ def parse_model_state(file):
79
+ state_dict = torch.load(file, map_location=device)
80
+
81
+ if BUFFER_NAMES not in state_dict:
82
+ raise ValueError(f"{file} is not a model state checkpoint")
83
+ buffer_names = state_dict[BUFFER_NAMES]
84
+ if debug:
85
+ print("Found buffers:", buffer_names)
86
+
87
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
88
+ buffers = {
89
+ k: v.float()
90
+ for k,
91
+ v in state_dict["module"].items() if k in buffer_names
92
+ }
93
+ param_shapes = state_dict[PARAM_SHAPES]
94
+
95
+ ds_version = state_dict.get(DS_VERSION, None)
96
+
97
+ return buffers, param_shapes, ds_version
98
+
99
+
100
+ def parse_optim_states(files, ds_checkpoint_dir):
101
+
102
+ total_files = len(files)
103
+ state_dicts = []
104
+ for f in files:
105
+ state_dicts.append(torch.load(f, map_location=device))
106
+
107
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
108
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
109
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
110
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
111
+
112
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
113
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
114
+ # use the max of the partition_count to get the dp world_size.
115
+
116
+ if type(world_size) is list:
117
+ world_size = max(world_size)
118
+
119
+ if world_size != total_files:
120
+ raise ValueError(
121
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
122
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
123
+ )
124
+
125
+ # the groups are named differently in each stage
126
+ if zero_stage == 2:
127
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
128
+ elif zero_stage == 3:
129
+ fp32_groups_key = FP32_FLAT_GROUPS
130
+ else:
131
+ raise ValueError(f"unknown zero stage {zero_stage}")
132
+
133
+ if zero_stage == 2:
134
+ fp32_flat_groups = [
135
+ state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key]
136
+ for i in range(len(state_dicts))
137
+ ]
138
+ elif zero_stage == 3:
139
+ # if there is more than one param group, there will be multiple flattened tensors - one
140
+ # flattened tensor per group - for simplicity merge them into a single tensor
141
+ #
142
+ # XXX: could make the script more memory efficient for when there are multiple groups - it
143
+ # will require matching the sub-lists of param_shapes for each param group flattened tensor
144
+
145
+ fp32_flat_groups = [
146
+ torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key],
147
+ 0) for i in range(len(state_dicts))
148
+ ]
149
+
150
+ return zero_stage, world_size, fp32_flat_groups
151
+
152
+
153
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir):
154
+ """
155
+ Returns fp32 state_dict reconstructed from ds checkpoint
156
+
157
+ Args:
158
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
159
+
160
+ """
161
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
162
+
163
+ optim_files = get_optim_files(ds_checkpoint_dir)
164
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
165
+ print(
166
+ f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
167
+
168
+ model_file = get_model_state_file(ds_checkpoint_dir, zero_stage)
169
+ buffers, param_shapes, ds_version = parse_model_state(model_file)
170
+ print(f'Parsing checkpoint created by deepspeed=={ds_version}')
171
+
172
+ if zero_stage == 2:
173
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size,
174
+ param_shapes,
175
+ fp32_flat_groups,
176
+ buffers)
177
+ elif zero_stage == 3:
178
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size,
179
+ param_shapes,
180
+ fp32_flat_groups,
181
+ buffers)
182
+
183
+
184
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size,
185
+ param_shapes,
186
+ fp32_flat_groups,
187
+ buffers):
188
+
189
+ # Reconstruction protocol:
190
+ #
191
+ # XXX: document this
192
+
193
+ if debug:
194
+ for i in range(world_size):
195
+ for j in range(len(fp32_flat_groups[0])):
196
+ print(
197
+ f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
198
+
199
+ # XXX: memory usage doubles here (zero2)
200
+ num_param_groups = len(fp32_flat_groups[0])
201
+ merged_single_partition_of_fp32_groups = []
202
+ for i in range(num_param_groups):
203
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
204
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
205
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
206
+ avail_numel = sum([
207
+ full_single_fp32_vector.numel()
208
+ for full_single_fp32_vector in merged_single_partition_of_fp32_groups
209
+ ])
210
+
211
+ if debug:
212
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
213
+ wanted_numel = sum(
214
+ [sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
215
+ # not asserting if there is a mismatch due to possible padding
216
+ print(f"Have {avail_numel} numels to process.")
217
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
218
+
219
+ state_dict = OrderedDict()
220
+
221
+ # buffers
222
+ state_dict.update(buffers)
223
+ if debug:
224
+ print(f"added {len(buffers)} buffers")
225
+
226
+ # params
227
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
228
+ # out-of-core computing solution
229
+ total_numel = 0
230
+ total_params = 0
231
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
232
+ offset = 0
233
+ avail_numel = full_single_fp32_vector.numel()
234
+ for name, shape in shapes.items():
235
+
236
+ unpartitioned_numel = shape.numel()
237
+ total_numel += unpartitioned_numel
238
+ total_params += 1
239
+
240
+ if debug:
241
+ print(
242
+ f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} "
243
+ )
244
+ state_dict[name] = full_single_fp32_vector.narrow(
245
+ 0,
246
+ offset,
247
+ unpartitioned_numel).view(shape)
248
+ offset += unpartitioned_numel
249
+
250
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
251
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
252
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
253
+ # live optimizer object, so we are checking that the numbers are within the right range
254
+ align_to = 2 * world_size
255
+
256
+ def zero2_align(x):
257
+ return align_to * math.ceil(x / align_to)
258
+
259
+ if debug:
260
+ print(f"original offset={offset}, avail_numel={avail_numel}")
261
+
262
+ offset = zero2_align(offset)
263
+ avail_numel = zero2_align(avail_numel)
264
+
265
+ if debug:
266
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
267
+
268
+ # Sanity check
269
+ if offset != avail_numel:
270
+ raise ValueError(
271
+ f"consumed {offset} numels out of {avail_numel} - something is wrong")
272
+
273
+ print(
274
+ f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements"
275
+ )
276
+
277
+ return state_dict
278
+
279
+
280
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
281
+ remainder = unpartitioned_numel % world_size
282
+ padding_numel = (world_size - remainder) if remainder else 0
283
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
284
+ return partitioned_numel, padding_numel
285
+
286
+
287
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size,
288
+ param_shapes,
289
+ fp32_flat_groups,
290
+ buffers):
291
+
292
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
293
+ # param, re-consolidating each param, while dealing with padding if any
294
+
295
+ avail_numel = fp32_flat_groups[0].numel() * world_size
296
+ # merge list of dicts, preserving order
297
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
298
+
299
+ if debug:
300
+ for i in range(world_size):
301
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
302
+
303
+ wanted_params = len(param_shapes)
304
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
305
+ # not asserting if there is a mismatch due to possible padding
306
+ print(f"Have {avail_numel} numels to process.")
307
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
308
+
309
+ state_dict = OrderedDict()
310
+
311
+ # buffers
312
+ state_dict.update(buffers)
313
+ if debug:
314
+ print(f"added {len(buffers)} buffers")
315
+
316
+ # params
317
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
318
+ # out-of-core computing solution
319
+ offset = 0
320
+ total_numel = 0
321
+ total_params = 0
322
+ for name, shape in param_shapes.items():
323
+
324
+ unpartitioned_numel = shape.numel()
325
+ total_numel += unpartitioned_numel
326
+ total_params += 1
327
+
328
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
329
+
330
+ if debug:
331
+ print(
332
+ f"{total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
333
+ )
334
+
335
+ # XXX: memory usage doubles here
336
+ state_dict[name] = torch.cat(
337
+ tuple(fp32_flat_groups[i].narrow(0,
338
+ offset,
339
+ partitioned_numel)
340
+ for i in range(world_size)),
341
+ 0).narrow(0,
342
+ 0,
343
+ unpartitioned_numel).view(shape)
344
+ offset += partitioned_numel
345
+
346
+ offset *= world_size
347
+
348
+ # Sanity check
349
+ if offset != avail_numel:
350
+ raise ValueError(
351
+ f"consumed {offset} numels out of {avail_numel} - something is wrong")
352
+
353
+ print(
354
+ f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements"
355
+ )
356
+
357
+ return state_dict
358
+
359
+
360
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None):
361
+ """
362
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
363
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
364
+ via a model hub.
365
+
366
+ Args:
367
+ - ``checkpoint_dir``: path to the desired checkpoint folder
368
+ - ``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``
369
+
370
+ Returns:
371
+ - pytorch ``state_dict``
372
+
373
+ Note: this approach may not work if your application doesn't have sufficient free CPU memory and
374
+ you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
375
+ the checkpoint.
376
+
377
+ A typical usage might be ::
378
+
379
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
380
+ # do the training and checkpoint saving
381
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
382
+ model = model.cpu() # move to cpu
383
+ model.load_state_dict(state_dict)
384
+ # submit to model hub or save the model to share with others
385
+
386
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
387
+ application. i.e. you will need to re-initialize the deepspeed engine, since
388
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
389
+
390
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
391
+
392
+ """
393
+ if tag is None:
394
+ latest_path = os.path.join(checkpoint_dir, 'latest')
395
+ if os.path.isfile(latest_path):
396
+ with open(latest_path, 'r') as fd:
397
+ tag = fd.read().strip()
398
+ else:
399
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
400
+
401
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
402
+
403
+ if not os.path.isdir(ds_checkpoint_dir):
404
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
405
+
406
+ return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir)
407
+
408
+
409
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, tag=None):
410
+ """
411
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
412
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
413
+
414
+ Args:
415
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
416
+ - ``output_file``: path to the pytorch fp32 state_dict output file (e.g. path/pytorch_model.bin)
417
+ - ``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``
418
+ """
419
+
420
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
421
+ print(f"Saving fp32 state dict to {output_file}")
422
+ torch.save(state_dict, output_file)
423
+
424
+
425
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
426
+ """
427
+ 1. Put the provided model to cpu
428
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
429
+ 3. Load it into the provided model
430
+
431
+ Args:
432
+ - ``model``: the model object to update
433
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
434
+ - ``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``
435
+
436
+ Returns:
437
+ - ``model`: modified model
438
+
439
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
440
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
441
+ conveniently placed for you in the checkpoint folder.
442
+
443
+ A typical usage might be ::
444
+
445
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
446
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
447
+ # submit to model hub or save the model to share with others
448
+
449
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
450
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
451
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
452
+
453
+ """
454
+ logger.info(f"Extracting fp32 weights")
455
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
456
+
457
+ logger.info(f"Overwriting model with fp32 weights")
458
+ model = model.cpu()
459
+ model.load_state_dict(state_dict, strict=False)
460
+
461
+ return model
462
+
463
+
464
+ if __name__ == "__main__":
465
+
466
+ parser = argparse.ArgumentParser()
467
+ parser.add_argument(
468
+ "checkpoint_dir",
469
+ type=str,
470
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
471
+ parser.add_argument(
472
+ "output_file",
473
+ type=str,
474
+ help=
475
+ "path to the pytorch fp32 state_dict output file (e.g. path/checkpoint-12/pytorch_model.bin)"
476
+ )
477
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
478
+ args = parser.parse_args()
479
+
480
+ debug = args.debug
481
+
482
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, args.output_file)