xk-huang commited on
Commit
91f9406
·
1 Parent(s): 20f2366

[add] model

Browse files
config.json ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_commit_hash": null,
3
+ "_name_or_path": "/mnt/blob/projects/sca-xiaoke-v3/amlt-results/7301932201.25563-cd1e6021-6ea9-4835-8578-ba26f723a708/checkpoint-100000",
4
+ "architectures": [
5
+ "ScaMultitaskV2Model"
6
+ ],
7
+ "cache_dir": "/mnt/blob/weights/.model.cache/",
8
+ "initializer_range": 0.02,
9
+ "mask_caption_decoder_config": {
10
+ "_name_or_path": "",
11
+ "add_cross_attention": false,
12
+ "additional_num_hidden_layers": 12,
13
+ "architectures": null,
14
+ "attention_downsample_rate": 2,
15
+ "bad_words_ids": null,
16
+ "begin_suppress_tokens": null,
17
+ "bos_token_id": null,
18
+ "chunk_size_feed_forward": 0,
19
+ "cross_attention_hidden_size": null,
20
+ "decoder_start_token_id": null,
21
+ "diversity_penalty": 0.0,
22
+ "do_sample": false,
23
+ "early_stopping": false,
24
+ "encoder_no_repeat_ngram_size": 0,
25
+ "eos_token_id": null,
26
+ "exponential_decay_length_penalty": null,
27
+ "finetuning_task": null,
28
+ "forced_bos_token_id": null,
29
+ "forced_eos_token_id": null,
30
+ "hidden_act": "relu",
31
+ "hidden_size": 256,
32
+ "id2label": {
33
+ "0": "LABEL_0",
34
+ "1": "LABEL_1"
35
+ },
36
+ "iou_head_depth": 3,
37
+ "iou_head_hidden_dim": 256,
38
+ "is_decoder": false,
39
+ "is_encoder_decoder": false,
40
+ "label2id": {
41
+ "LABEL_0": 0,
42
+ "LABEL_1": 1
43
+ },
44
+ "layer_norm_eps": 1e-06,
45
+ "length_penalty": 1.0,
46
+ "max_length": 20,
47
+ "min_length": 0,
48
+ "mlp_dim": 2048,
49
+ "model_type": "",
50
+ "no_repeat_ngram_size": 0,
51
+ "num_attention_heads": 8,
52
+ "num_beam_groups": 1,
53
+ "num_beams": 1,
54
+ "num_caption_heads": 1,
55
+ "num_caption_tokens": 8,
56
+ "num_hidden_layers": 2,
57
+ "num_multimask_outputs": 3,
58
+ "num_return_sequences": 1,
59
+ "output_attentions": false,
60
+ "output_hidden_states": false,
61
+ "output_scores": false,
62
+ "pad_token_id": null,
63
+ "prefix": null,
64
+ "problem_type": null,
65
+ "pruned_heads": {},
66
+ "remove_invalid_values": false,
67
+ "repetition_penalty": 1.0,
68
+ "return_dict": true,
69
+ "return_dict_in_generate": false,
70
+ "sep_token_id": null,
71
+ "suppress_tokens": null,
72
+ "task_specific_params": null,
73
+ "temperature": 1.0,
74
+ "tf_legacy_loss": false,
75
+ "tie_encoder_decoder": false,
76
+ "tie_word_embeddings": true,
77
+ "tokenizer_class": null,
78
+ "top_k": 50,
79
+ "top_p": 1.0,
80
+ "torch_dtype": null,
81
+ "torchscript": false,
82
+ "transformers_version": "4.30.2",
83
+ "typical_p": 1.0,
84
+ "use_bfloat16": false
85
+ },
86
+ "model_type": "sca",
87
+ "num_task_tokens": 6,
88
+ "prompt_encoder_config": {
89
+ "_name_or_path": "",
90
+ "add_cross_attention": false,
91
+ "architectures": null,
92
+ "bad_words_ids": null,
93
+ "begin_suppress_tokens": null,
94
+ "bos_token_id": null,
95
+ "chunk_size_feed_forward": 0,
96
+ "cross_attention_hidden_size": null,
97
+ "decoder_start_token_id": null,
98
+ "diversity_penalty": 0.0,
99
+ "do_sample": false,
100
+ "early_stopping": false,
101
+ "encoder_no_repeat_ngram_size": 0,
102
+ "eos_token_id": null,
103
+ "exponential_decay_length_penalty": null,
104
+ "finetuning_task": null,
105
+ "forced_bos_token_id": null,
106
+ "forced_eos_token_id": null,
107
+ "hidden_act": "gelu",
108
+ "hidden_size": 256,
109
+ "id2label": {
110
+ "0": "LABEL_0",
111
+ "1": "LABEL_1"
112
+ },
113
+ "image_embedding_size": 64,
114
+ "image_size": 1024,
115
+ "is_decoder": false,
116
+ "is_encoder_decoder": false,
117
+ "label2id": {
118
+ "LABEL_0": 0,
119
+ "LABEL_1": 1
120
+ },
121
+ "layer_norm_eps": 1e-06,
122
+ "length_penalty": 1.0,
123
+ "mask_input_channels": 16,
124
+ "max_length": 20,
125
+ "min_length": 0,
126
+ "model_type": "",
127
+ "no_repeat_ngram_size": 0,
128
+ "num_beam_groups": 1,
129
+ "num_beams": 1,
130
+ "num_point_embeddings": 4,
131
+ "num_return_sequences": 1,
132
+ "output_attentions": false,
133
+ "output_hidden_states": false,
134
+ "output_scores": false,
135
+ "pad_token_id": null,
136
+ "patch_size": 16,
137
+ "prefix": null,
138
+ "problem_type": null,
139
+ "pruned_heads": {},
140
+ "remove_invalid_values": false,
141
+ "repetition_penalty": 1.0,
142
+ "return_dict": true,
143
+ "return_dict_in_generate": false,
144
+ "sep_token_id": null,
145
+ "suppress_tokens": null,
146
+ "task_specific_params": null,
147
+ "temperature": 1.0,
148
+ "tf_legacy_loss": false,
149
+ "tie_encoder_decoder": false,
150
+ "tie_word_embeddings": true,
151
+ "tokenizer_class": null,
152
+ "top_k": 50,
153
+ "top_p": 1.0,
154
+ "torch_dtype": null,
155
+ "torchscript": false,
156
+ "transformers_version": "4.30.2",
157
+ "typical_p": 1.0,
158
+ "use_bfloat16": false
159
+ },
160
+ "text_config": {
161
+ "_name_or_path": "gpt2-large",
162
+ "activation_function": "gelu_new",
163
+ "add_cross_attention": false,
164
+ "architectures": [
165
+ "GPT2LMHeadModel"
166
+ ],
167
+ "attn_pdrop": 0.1,
168
+ "bad_words_ids": null,
169
+ "begin_suppress_tokens": null,
170
+ "bos_token_id": 50256,
171
+ "chunk_size_feed_forward": 0,
172
+ "cross_attention_hidden_size": null,
173
+ "decoder_start_token_id": null,
174
+ "diversity_penalty": 0.0,
175
+ "do_sample": false,
176
+ "early_stopping": false,
177
+ "embd_pdrop": 0.1,
178
+ "encoder_no_repeat_ngram_size": 0,
179
+ "eos_token_id": 50256,
180
+ "exponential_decay_length_penalty": null,
181
+ "finetuning_task": null,
182
+ "forced_bos_token_id": null,
183
+ "forced_eos_token_id": null,
184
+ "id2label": {
185
+ "0": "LABEL_0",
186
+ "1": "LABEL_1"
187
+ },
188
+ "initializer_range": 0.02,
189
+ "is_decoder": false,
190
+ "is_encoder_decoder": false,
191
+ "label2id": {
192
+ "LABEL_0": 0,
193
+ "LABEL_1": 1
194
+ },
195
+ "layer_norm_epsilon": 1e-05,
196
+ "length_penalty": 1.0,
197
+ "max_length": 20,
198
+ "min_length": 0,
199
+ "model_type": "gpt2",
200
+ "n_ctx": 1024,
201
+ "n_embd": 1280,
202
+ "n_head": 20,
203
+ "n_inner": null,
204
+ "n_layer": 36,
205
+ "n_positions": 1024,
206
+ "no_repeat_ngram_size": 0,
207
+ "num_beam_groups": 1,
208
+ "num_beams": 1,
209
+ "num_return_sequences": 1,
210
+ "output_attentions": false,
211
+ "output_hidden_states": false,
212
+ "output_scores": false,
213
+ "pad_token_id": null,
214
+ "prefix": null,
215
+ "problem_type": null,
216
+ "pruned_heads": {},
217
+ "remove_invalid_values": false,
218
+ "reorder_and_upcast_attn": false,
219
+ "repetition_penalty": 1.0,
220
+ "resid_pdrop": 0.1,
221
+ "return_dict": true,
222
+ "return_dict_in_generate": false,
223
+ "scale_attn_by_inverse_layer_idx": false,
224
+ "scale_attn_weights": true,
225
+ "sep_token_id": null,
226
+ "summary_activation": null,
227
+ "summary_first_dropout": 0.1,
228
+ "summary_proj_to_labels": true,
229
+ "summary_type": "cls_index",
230
+ "summary_use_proj": true,
231
+ "suppress_tokens": null,
232
+ "task_specific_params": {
233
+ "text-generation": {
234
+ "do_sample": true,
235
+ "max_length": 50
236
+ }
237
+ },
238
+ "temperature": 1.0,
239
+ "tf_legacy_loss": false,
240
+ "tie_encoder_decoder": false,
241
+ "tie_word_embeddings": true,
242
+ "tokenizer_class": null,
243
+ "top_k": 50,
244
+ "top_p": 1.0,
245
+ "torch_dtype": null,
246
+ "torchscript": false,
247
+ "transformers_version": "4.30.2",
248
+ "typical_p": 1.0,
249
+ "use_bfloat16": false,
250
+ "use_cache": true,
251
+ "vocab_size": 50257
252
+ },
253
+ "torch_dtype": "float16",
254
+ "transformers_version": null,
255
+ "use_decoder_only_language_model": true,
256
+ "vision_config": {
257
+ "_name_or_path": "",
258
+ "add_cross_attention": false,
259
+ "architectures": null,
260
+ "attention_dropout": 0.0,
261
+ "bad_words_ids": null,
262
+ "begin_suppress_tokens": null,
263
+ "bos_token_id": null,
264
+ "chunk_size_feed_forward": 0,
265
+ "cross_attention_hidden_size": null,
266
+ "decoder_start_token_id": null,
267
+ "diversity_penalty": 0.0,
268
+ "do_sample": false,
269
+ "dropout": 0.0,
270
+ "early_stopping": false,
271
+ "encoder_no_repeat_ngram_size": 0,
272
+ "eos_token_id": null,
273
+ "exponential_decay_length_penalty": null,
274
+ "finetuning_task": null,
275
+ "forced_bos_token_id": null,
276
+ "forced_eos_token_id": null,
277
+ "global_attn_indexes": [
278
+ 7,
279
+ 15,
280
+ 23,
281
+ 31
282
+ ],
283
+ "hidden_act": "gelu",
284
+ "hidden_size": 1280,
285
+ "id2label": {
286
+ "0": "LABEL_0",
287
+ "1": "LABEL_1"
288
+ },
289
+ "image_size": 1024,
290
+ "initializer_factor": 1.0,
291
+ "initializer_range": 1e-10,
292
+ "intermediate_size": 6144,
293
+ "is_decoder": false,
294
+ "is_encoder_decoder": false,
295
+ "label2id": {
296
+ "LABEL_0": 0,
297
+ "LABEL_1": 1
298
+ },
299
+ "layer_norm_eps": 1e-06,
300
+ "length_penalty": 1.0,
301
+ "max_length": 20,
302
+ "min_length": 0,
303
+ "mlp_dim": 5120,
304
+ "mlp_ratio": 4.0,
305
+ "model_type": "",
306
+ "no_repeat_ngram_size": 0,
307
+ "num_attention_heads": 16,
308
+ "num_beam_groups": 1,
309
+ "num_beams": 1,
310
+ "num_channels": 3,
311
+ "num_hidden_layers": 32,
312
+ "num_pos_feats": 128,
313
+ "num_return_sequences": 1,
314
+ "output_attentions": false,
315
+ "output_channels": 256,
316
+ "output_hidden_states": false,
317
+ "output_scores": false,
318
+ "pad_token_id": null,
319
+ "patch_size": 16,
320
+ "prefix": null,
321
+ "problem_type": null,
322
+ "projection_dim": 512,
323
+ "pruned_heads": {},
324
+ "qkv_bias": true,
325
+ "remove_invalid_values": false,
326
+ "repetition_penalty": 1.0,
327
+ "return_dict": true,
328
+ "return_dict_in_generate": false,
329
+ "sep_token_id": null,
330
+ "suppress_tokens": null,
331
+ "task_specific_params": null,
332
+ "temperature": 1.0,
333
+ "tf_legacy_loss": false,
334
+ "tie_encoder_decoder": false,
335
+ "tie_word_embeddings": true,
336
+ "tokenizer_class": null,
337
+ "top_k": 50,
338
+ "top_p": 1.0,
339
+ "torch_dtype": null,
340
+ "torchscript": false,
341
+ "transformers_version": "4.30.2",
342
+ "typical_p": 1.0,
343
+ "use_abs_pos": true,
344
+ "use_bfloat16": false,
345
+ "use_rel_pos": true,
346
+ "window_size": 14
347
+ }
348
+ }
latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step100000
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dad9b4488cb0f24a886335ef688f581d297aa197cdeb8f86b846632fb3b84c4
3
+ size 2998190351
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b4c32ad7d0088ddbc3f33294a653ba49926997db934e9fe5a3a60a180b1895e
3
+ size 1064
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "eos_token": "<|endoftext|>",
4
+ "pad_token": "<|endoftext|>",
5
+ "unk_token": "<|endoftext|>"
6
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "bos_token": "<|endoftext|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|endoftext|>",
6
+ "model_max_length": 20,
7
+ "tokenizer_class": "GPT2Tokenizer",
8
+ "unk_token": "<|endoftext|>"
9
+ }
trainer_state.json ADDED
@@ -0,0 +1,1114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 3.5546064376831055,
3
+ "best_model_checkpoint": "//amltff6de91c1707b018e950147da959e142/projects/sca-xiaoke-v3/amlt-results/7300230113.98638-a536a63f-7921-4c0f-a350-97817c95c30d/checkpoint-90000",
4
+ "epoch": 82.64462809917356,
5
+ "global_step": 100000,
6
+ "is_hyper_param_search": false,
7
+ "is_local_process_zero": true,
8
+ "is_world_process_zero": true,
9
+ "log_history": [
10
+ {
11
+ "_prepare_inputs_in_ms": 27.127794979605824,
12
+ "compute_loss_in_ms": 1811.1886270344257,
13
+ "epoch": 0.0,
14
+ "learning_rate/full": 0.0,
15
+ "loss": 7.5531,
16
+ "step": 1,
17
+ "training_step_in_ms": 2240.9718980197795
18
+ },
19
+ {
20
+ "epoch": 0.0,
21
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 7.401121139526367,
22
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.029569745772319803,
23
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 83.1742,
24
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 9.618,
25
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.301,
26
+ "step": 1
27
+ },
28
+ {
29
+ "_prepare_inputs_in_ms": 9.555798228632284,
30
+ "compute_loss_in_ms": 536.5458341809833,
31
+ "epoch": 0.83,
32
+ "learning_rate/full": 0.0003999392508508148,
33
+ "loss": 4.3937,
34
+ "step": 1000,
35
+ "training_step_in_ms": 946.2872614599979
36
+ },
37
+ {
38
+ "_prepare_inputs_in_ms": 9.661823262518737,
39
+ "compute_loss_in_ms": 537.3916240136023,
40
+ "epoch": 1.65,
41
+ "learning_rate/full": 0.00039968541343111914,
42
+ "loss": 4.0494,
43
+ "step": 2000,
44
+ "training_step_in_ms": 955.0557815724169
45
+ },
46
+ {
47
+ "_prepare_inputs_in_ms": 9.627924977685325,
48
+ "compute_loss_in_ms": 537.9465775624267,
49
+ "epoch": 2.48,
50
+ "learning_rate/full": 0.0003992346658781257,
51
+ "loss": 3.9791,
52
+ "step": 3000,
53
+ "training_step_in_ms": 958.343352012278
54
+ },
55
+ {
56
+ "_prepare_inputs_in_ms": 9.754187489685137,
57
+ "compute_loss_in_ms": 538.0461517369258,
58
+ "epoch": 3.31,
59
+ "learning_rate/full": 0.0003985858034191765,
60
+ "loss": 3.9371,
61
+ "step": 4000,
62
+ "training_step_in_ms": 961.1277512954548
63
+ },
64
+ {
65
+ "_prepare_inputs_in_ms": 9.712934053619392,
66
+ "compute_loss_in_ms": 537.9799637984834,
67
+ "epoch": 4.13,
68
+ "learning_rate/full": 0.0003977411181848781,
69
+ "loss": 3.9065,
70
+ "step": 5000,
71
+ "training_step_in_ms": 954.7033457334619
72
+ },
73
+ {
74
+ "epoch": 4.13,
75
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.763737201690674,
76
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.23929773235608354,
77
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 102.1516,
78
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.831,
79
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.245,
80
+ "step": 5000
81
+ },
82
+ {
83
+ "_prepare_inputs_in_ms": 9.484028106941501,
84
+ "compute_loss_in_ms": 535.8051792999613,
85
+ "epoch": 4.96,
86
+ "learning_rate/full": 0.0003966997561999938,
87
+ "loss": 3.8844,
88
+ "step": 6000,
89
+ "training_step_in_ms": 946.6810292407754
90
+ },
91
+ {
92
+ "_prepare_inputs_in_ms": 9.555567614093889,
93
+ "compute_loss_in_ms": 537.8309749438195,
94
+ "epoch": 5.79,
95
+ "learning_rate/full": 0.000395466162801616,
96
+ "loss": 3.8646,
97
+ "step": 7000,
98
+ "training_step_in_ms": 956.3491519849049
99
+ },
100
+ {
101
+ "_prepare_inputs_in_ms": 9.571906232624315,
102
+ "compute_loss_in_ms": 535.8670682059601,
103
+ "epoch": 6.61,
104
+ "learning_rate/full": 0.0003940366164283571,
105
+ "loss": 3.8482,
106
+ "step": 8000,
107
+ "training_step_in_ms": 955.7397421186324
108
+ },
109
+ {
110
+ "_prepare_inputs_in_ms": 9.494116805610247,
111
+ "compute_loss_in_ms": 535.7246166499099,
112
+ "epoch": 7.44,
113
+ "learning_rate/full": 0.0003924165284571268,
114
+ "loss": 3.8329,
115
+ "step": 9000,
116
+ "training_step_in_ms": 956.2797198233311
117
+ },
118
+ {
119
+ "_prepare_inputs_in_ms": 9.442963820649311,
120
+ "compute_loss_in_ms": 535.982440788066,
121
+ "epoch": 8.26,
122
+ "learning_rate/full": 0.00039060426098193074,
123
+ "loss": 3.8234,
124
+ "step": 10000,
125
+ "training_step_in_ms": 960.6822794212494
126
+ },
127
+ {
128
+ "epoch": 8.26,
129
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.69438099861145,
130
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.24724186480974675,
131
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 99.2464,
132
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 8.061,
133
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.252,
134
+ "step": 10000
135
+ },
136
+ {
137
+ "_prepare_inputs_in_ms": 9.298451105870942,
138
+ "compute_loss_in_ms": 533.8574210923398,
139
+ "epoch": 9.09,
140
+ "learning_rate/full": 0.00038860732494287416,
141
+ "loss": 3.8075,
142
+ "step": 11000,
143
+ "training_step_in_ms": 953.7077538485173
144
+ },
145
+ {
146
+ "_prepare_inputs_in_ms": 9.43831800215412,
147
+ "compute_loss_in_ms": 534.8986968573299,
148
+ "epoch": 9.92,
149
+ "learning_rate/full": 0.0003864196958913291,
150
+ "loss": 3.8011,
151
+ "step": 12000,
152
+ "training_step_in_ms": 952.7247995454236
153
+ },
154
+ {
155
+ "_prepare_inputs_in_ms": 9.553659793222323,
156
+ "compute_loss_in_ms": 535.9662136517582,
157
+ "epoch": 10.74,
158
+ "learning_rate/full": 0.0003840498188962311,
159
+ "loss": 3.7873,
160
+ "step": 13000,
161
+ "training_step_in_ms": 957.1981301900814
162
+ },
163
+ {
164
+ "_prepare_inputs_in_ms": 9.344144803879317,
165
+ "compute_loss_in_ms": 535.5388605375774,
166
+ "epoch": 11.57,
167
+ "learning_rate/full": 0.0003814979428002389,
168
+ "loss": 3.7786,
169
+ "step": 14000,
170
+ "training_step_in_ms": 959.83031323459
171
+ },
172
+ {
173
+ "_prepare_inputs_in_ms": 9.39019125822233,
174
+ "compute_loss_in_ms": 536.7152543000993,
175
+ "epoch": 12.4,
176
+ "learning_rate/full": 0.00037876659104596076,
177
+ "loss": 3.7703,
178
+ "step": 15000,
179
+ "training_step_in_ms": 961.1087728133425
180
+ },
181
+ {
182
+ "epoch": 12.4,
183
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.6609387397766113,
184
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2538100106775413,
185
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 103.2498,
186
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.748,
187
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.242,
188
+ "step": 15000
189
+ },
190
+ {
191
+ "_prepare_inputs_in_ms": 9.56299589696999,
192
+ "compute_loss_in_ms": 535.2517742190976,
193
+ "epoch": 13.22,
194
+ "learning_rate/full": 0.00037585846455191155,
195
+ "loss": 3.7622,
196
+ "step": 16000,
197
+ "training_step_in_ms": 952.1916261643055
198
+ },
199
+ {
200
+ "_prepare_inputs_in_ms": 9.559556159831118,
201
+ "compute_loss_in_ms": 535.5560795084457,
202
+ "epoch": 14.05,
203
+ "learning_rate/full": 0.00037277643904168816,
204
+ "loss": 3.7606,
205
+ "step": 17000,
206
+ "training_step_in_ms": 957.2516361214803
207
+ },
208
+ {
209
+ "_prepare_inputs_in_ms": 9.455631462449674,
210
+ "compute_loss_in_ms": 535.3892399296165,
211
+ "epoch": 14.88,
212
+ "learning_rate/full": 0.0003695235622002878,
213
+ "loss": 3.749,
214
+ "step": 18000,
215
+ "training_step_in_ms": 953.2538345798966
216
+ },
217
+ {
218
+ "_prepare_inputs_in_ms": 9.365507787151728,
219
+ "compute_loss_in_ms": 535.8022946891142,
220
+ "epoch": 15.7,
221
+ "learning_rate/full": 0.00036609954385629034,
222
+ "loss": 3.7464,
223
+ "step": 19000,
224
+ "training_step_in_ms": 959.837038420781
225
+ },
226
+ {
227
+ "_prepare_inputs_in_ms": 9.457632376637775,
228
+ "compute_loss_in_ms": 535.8551492407569,
229
+ "epoch": 16.53,
230
+ "learning_rate/full": 0.00036251461734986354,
231
+ "loss": 3.7357,
232
+ "step": 20000,
233
+ "training_step_in_ms": 960.2882608400541
234
+ },
235
+ {
236
+ "epoch": 16.53,
237
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.6332855224609375,
238
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.26106709230289454,
239
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 103.6434,
240
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.719,
241
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.241,
242
+ "step": 20000
243
+ },
244
+ {
245
+ "_prepare_inputs_in_ms": 9.350896289958278,
246
+ "compute_loss_in_ms": 534.3410268089501,
247
+ "epoch": 17.36,
248
+ "learning_rate/full": 0.0003587689869947874,
249
+ "loss": 3.7335,
250
+ "step": 21000,
251
+ "training_step_in_ms": 951.9007690685103
252
+ },
253
+ {
254
+ "_prepare_inputs_in_ms": 9.444510843255557,
255
+ "compute_loss_in_ms": 536.0995619180612,
256
+ "epoch": 18.18,
257
+ "learning_rate/full": 0.0003548663566868928,
258
+ "loss": 3.726,
259
+ "step": 22000,
260
+ "training_step_in_ms": 959.7129821323324
261
+ },
262
+ {
263
+ "_prepare_inputs_in_ms": 9.432463558274321,
264
+ "compute_loss_in_ms": 535.7645625439472,
265
+ "epoch": 19.01,
266
+ "learning_rate/full": 0.00035081058557264036,
267
+ "loss": 3.7237,
268
+ "step": 23000,
269
+ "training_step_in_ms": 963.4282936626696
270
+ },
271
+ {
272
+ "_prepare_inputs_in_ms": 9.293582127720583,
273
+ "compute_loss_in_ms": 535.7767343233572,
274
+ "epoch": 19.83,
275
+ "learning_rate/full": 0.00034660568423297317,
276
+ "loss": 3.7142,
277
+ "step": 24000,
278
+ "training_step_in_ms": 953.5687257153331
279
+ },
280
+ {
281
+ "_prepare_inputs_in_ms": 9.35004804620985,
282
+ "compute_loss_in_ms": 537.011823366629,
283
+ "epoch": 20.66,
284
+ "learning_rate/full": 0.00034225581071742215,
285
+ "loss": 3.7071,
286
+ "step": 25000,
287
+ "training_step_in_ms": 957.869783453003
288
+ },
289
+ {
290
+ "epoch": 20.66,
291
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.6175005435943604,
292
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.26405073790614886,
293
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 104.9682,
294
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.621,
295
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.238,
296
+ "step": 25000
297
+ },
298
+ {
299
+ "_prepare_inputs_in_ms": 9.984895624163583,
300
+ "compute_loss_in_ms": 534.7242227215902,
301
+ "epoch": 21.49,
302
+ "learning_rate/full": 0.0003377607023892813,
303
+ "loss": 3.7083,
304
+ "step": 26000,
305
+ "training_step_in_ms": 955.9584859979805
306
+ },
307
+ {
308
+ "_prepare_inputs_in_ms": 10.137336196319666,
309
+ "compute_loss_in_ms": 535.9911008346826,
310
+ "epoch": 22.31,
311
+ "learning_rate/full": 0.00033313379374801615,
312
+ "loss": 3.7022,
313
+ "step": 27000,
314
+ "training_step_in_ms": 965.8537974991486
315
+ },
316
+ {
317
+ "_prepare_inputs_in_ms": 10.160301688476466,
318
+ "compute_loss_in_ms": 536.8555397295277,
319
+ "epoch": 23.14,
320
+ "learning_rate/full": 0.0003283704069974003,
321
+ "loss": 3.7009,
322
+ "step": 28000,
323
+ "training_step_in_ms": 961.128851325775
324
+ },
325
+ {
326
+ "_prepare_inputs_in_ms": 10.110118357348256,
327
+ "compute_loss_in_ms": 536.1848762420123,
328
+ "epoch": 23.97,
329
+ "learning_rate/full": 0.0003234847784387827,
330
+ "loss": 3.6952,
331
+ "step": 29000,
332
+ "training_step_in_ms": 951.6901445918484
333
+ },
334
+ {
335
+ "_prepare_inputs_in_ms": 10.067090163414832,
336
+ "compute_loss_in_ms": 535.8437895118841,
337
+ "epoch": 24.79,
338
+ "learning_rate/full": 0.0003184770409925566,
339
+ "loss": 3.6897,
340
+ "step": 30000,
341
+ "training_step_in_ms": 964.9359193513519
342
+ },
343
+ {
344
+ "epoch": 24.79,
345
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.603607416152954,
346
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.26295626788132803,
347
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 101.4282,
348
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.887,
349
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.246,
350
+ "step": 30000
351
+ },
352
+ {
353
+ "_prepare_inputs_in_ms": 10.085794753678961,
354
+ "compute_loss_in_ms": 535.1409671568545,
355
+ "epoch": 25.62,
356
+ "learning_rate/full": 0.00031335214659900727,
357
+ "loss": 3.6866,
358
+ "step": 31000,
359
+ "training_step_in_ms": 961.3275795525988
360
+ },
361
+ {
362
+ "_prepare_inputs_in_ms": 10.185186771384906,
363
+ "compute_loss_in_ms": 536.1119842829066,
364
+ "epoch": 26.45,
365
+ "learning_rate/full": 0.0003081098663889108,
366
+ "loss": 3.6829,
367
+ "step": 32000,
368
+ "training_step_in_ms": 963.5977011280484
369
+ },
370
+ {
371
+ "_prepare_inputs_in_ms": 10.249891238170676,
372
+ "compute_loss_in_ms": 535.0950576688629,
373
+ "epoch": 27.27,
374
+ "learning_rate/full": 0.0003027712689775676,
375
+ "loss": 3.6771,
376
+ "step": 33000,
377
+ "training_step_in_ms": 955.397748134099
378
+ },
379
+ {
380
+ "_prepare_inputs_in_ms": 10.17424620629754,
381
+ "compute_loss_in_ms": 534.6862363539985,
382
+ "epoch": 28.1,
383
+ "learning_rate/full": 0.0002973202486383942,
384
+ "loss": 3.672,
385
+ "step": 34000,
386
+ "training_step_in_ms": 958.4871930885711
387
+ },
388
+ {
389
+ "_prepare_inputs_in_ms": 10.059338139777537,
390
+ "compute_loss_in_ms": 535.8044806576218,
391
+ "epoch": 28.93,
392
+ "learning_rate/full": 0.000291778393459607,
393
+ "loss": 3.6714,
394
+ "step": 35000,
395
+ "training_step_in_ms": 956.3396593880607
396
+ },
397
+ {
398
+ "epoch": 28.93,
399
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.590414524078369,
400
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.26513770557999966,
401
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 104.3253,
402
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.668,
403
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.24,
404
+ "step": 35000
405
+ },
406
+ {
407
+ "_prepare_inputs_in_ms": 10.062245466610099,
408
+ "compute_loss_in_ms": 534.5042656344594,
409
+ "epoch": 29.75,
410
+ "learning_rate/full": 0.0002861457824996332,
411
+ "loss": 3.6645,
412
+ "step": 36000,
413
+ "training_step_in_ms": 959.2977655951399
414
+ },
415
+ {
416
+ "_prepare_inputs_in_ms": 10.064813164470252,
417
+ "compute_loss_in_ms": 536.1598941528937,
418
+ "epoch": 30.58,
419
+ "learning_rate/full": 0.00028042798560981287,
420
+ "loss": 3.6574,
421
+ "step": 37000,
422
+ "training_step_in_ms": 956.0697433989844
423
+ },
424
+ {
425
+ "_prepare_inputs_in_ms": 10.116965677938424,
426
+ "compute_loss_in_ms": 536.2070164434845,
427
+ "epoch": 31.4,
428
+ "learning_rate/full": 0.0002746248158102387,
429
+ "loss": 3.6578,
430
+ "step": 38000,
431
+ "training_step_in_ms": 956.2041009759996
432
+ },
433
+ {
434
+ "_prepare_inputs_in_ms": 10.094019736570772,
435
+ "compute_loss_in_ms": 535.4710150305182,
436
+ "epoch": 32.23,
437
+ "learning_rate/full": 0.0002687536169947349,
438
+ "loss": 3.6524,
439
+ "step": 39000,
440
+ "training_step_in_ms": 959.96617779386
441
+ },
442
+ {
443
+ "_prepare_inputs_in_ms": 10.109433323028497,
444
+ "compute_loss_in_ms": 535.6941579723498,
445
+ "epoch": 33.06,
446
+ "learning_rate/full": 0.0002628144306280816,
447
+ "loss": 3.6524,
448
+ "step": 40000,
449
+ "training_step_in_ms": 961.5450095872511
450
+ },
451
+ {
452
+ "epoch": 33.06,
453
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.580965280532837,
454
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2693198298047019,
455
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 99.8174,
456
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 8.015,
457
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.25,
458
+ "step": 40000
459
+ },
460
+ {
461
+ "_prepare_inputs_in_ms": 10.042415707621997,
462
+ "compute_loss_in_ms": 535.0675269728526,
463
+ "epoch": 33.88,
464
+ "learning_rate/full": 0.000256813129721104,
465
+ "loss": 3.6463,
466
+ "step": 41000,
467
+ "training_step_in_ms": 951.0752835389576
468
+ },
469
+ {
470
+ "_prepare_inputs_in_ms": 10.117303489823826,
471
+ "compute_loss_in_ms": 535.5392771296902,
472
+ "epoch": 34.71,
473
+ "learning_rate/full": 0.00025076173835033525,
474
+ "loss": 3.6408,
475
+ "step": 42000,
476
+ "training_step_in_ms": 959.7704490462202
477
+ },
478
+ {
479
+ "_prepare_inputs_in_ms": 10.175786619714927,
480
+ "compute_loss_in_ms": 536.3846810262767,
481
+ "epoch": 35.54,
482
+ "learning_rate/full": 0.0002446479775734085,
483
+ "loss": 3.6381,
484
+ "step": 43000,
485
+ "training_step_in_ms": 963.5900993177202
486
+ },
487
+ {
488
+ "_prepare_inputs_in_ms": 10.058058980386704,
489
+ "compute_loss_in_ms": 535.5972880260088,
490
+ "epoch": 36.36,
491
+ "learning_rate/full": 0.00023849615593840492,
492
+ "loss": 3.6361,
493
+ "step": 44000,
494
+ "training_step_in_ms": 966.5910823547165
495
+ },
496
+ {
497
+ "_prepare_inputs_in_ms": 10.140807795512956,
498
+ "compute_loss_in_ms": 535.745742837491,
499
+ "epoch": 37.19,
500
+ "learning_rate/full": 0.00023230626707893625,
501
+ "loss": 3.6344,
502
+ "step": 45000,
503
+ "training_step_in_ms": 960.7837667464628
504
+ },
505
+ {
506
+ "epoch": 37.19,
507
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.575321912765503,
508
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2694013022299941,
509
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 103.7207,
510
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.713,
511
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.241,
512
+ "step": 45000
513
+ },
514
+ {
515
+ "_prepare_inputs_in_ms": 10.123616369532012,
516
+ "compute_loss_in_ms": 534.5586088547134,
517
+ "epoch": 38.02,
518
+ "learning_rate/full": 0.00022608443191494596,
519
+ "loss": 3.6259,
520
+ "step": 46000,
521
+ "training_step_in_ms": 954.3300566331018
522
+ },
523
+ {
524
+ "_prepare_inputs_in_ms": 10.126525112020317,
525
+ "compute_loss_in_ms": 536.6205943481764,
526
+ "epoch": 38.84,
527
+ "learning_rate/full": 0.0002198305382138328,
528
+ "loss": 3.6279,
529
+ "step": 47000,
530
+ "training_step_in_ms": 953.759260071849
531
+ },
532
+ {
533
+ "_prepare_inputs_in_ms": 10.257417954970151,
534
+ "compute_loss_in_ms": 535.2681058159797,
535
+ "epoch": 39.67,
536
+ "learning_rate/full": 0.00021356327694485794,
537
+ "loss": 3.6213,
538
+ "step": 48000,
539
+ "training_step_in_ms": 962.4967881785124
540
+ },
541
+ {
542
+ "_prepare_inputs_in_ms": 10.271113389520906,
543
+ "compute_loss_in_ms": 535.4450263003819,
544
+ "epoch": 40.5,
545
+ "learning_rate/full": 0.0002072826035235433,
546
+ "loss": 3.6186,
547
+ "step": 49000,
548
+ "training_step_in_ms": 961.3730522751575
549
+ },
550
+ {
551
+ "_prepare_inputs_in_ms": 10.129716445459053,
552
+ "compute_loss_in_ms": 536.4764073403785,
553
+ "epoch": 41.32,
554
+ "learning_rate/full": 0.00020099472864285533,
555
+ "loss": 3.6137,
556
+ "step": 50000,
557
+ "training_step_in_ms": 960.2726457127137
558
+ },
559
+ {
560
+ "epoch": 41.32,
561
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5703847408294678,
562
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2688142864806811,
563
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 100.2164,
564
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.983,
565
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.249,
566
+ "step": 50000
567
+ },
568
+ {
569
+ "_prepare_inputs_in_ms": 10.502501730693549,
570
+ "compute_loss_in_ms": 535.0548804986756,
571
+ "epoch": 42.15,
572
+ "learning_rate/full": 0.0001947058701169798,
573
+ "loss": 3.6106,
574
+ "step": 51000,
575
+ "training_step_in_ms": 958.0683015501127
576
+ },
577
+ {
578
+ "_prepare_inputs_in_ms": 10.785648202290758,
579
+ "compute_loss_in_ms": 536.7012275556335,
580
+ "epoch": 42.98,
581
+ "learning_rate/full": 0.0001884222467327876,
582
+ "loss": 3.6073,
583
+ "step": 52000,
584
+ "training_step_in_ms": 951.947691895999
585
+ },
586
+ {
587
+ "_prepare_inputs_in_ms": 10.585681669297628,
588
+ "compute_loss_in_ms": 535.5102476192405,
589
+ "epoch": 43.8,
590
+ "learning_rate/full": 0.00018214380145695523,
591
+ "loss": 3.6024,
592
+ "step": 53000,
593
+ "training_step_in_ms": 962.6988452640362
594
+ },
595
+ {
596
+ "_prepare_inputs_in_ms": 10.68288057774771,
597
+ "compute_loss_in_ms": 535.9786380403675,
598
+ "epoch": 44.63,
599
+ "learning_rate/full": 0.00017588929863586686,
600
+ "loss": 3.6046,
601
+ "step": 54000,
602
+ "training_step_in_ms": 966.1844932027161
603
+ },
604
+ {
605
+ "_prepare_inputs_in_ms": 10.645952994469553,
606
+ "compute_loss_in_ms": 535.4971501872642,
607
+ "epoch": 45.45,
608
+ "learning_rate/full": 0.00016965863787013347,
609
+ "loss": 3.5954,
610
+ "step": 55000,
611
+ "training_step_in_ms": 966.1277901912108
612
+ },
613
+ {
614
+ "epoch": 45.45,
615
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5649678707122803,
616
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.27166900209048683,
617
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 102.2773,
618
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.822,
619
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.244,
620
+ "step": 55000
621
+ },
622
+ {
623
+ "_prepare_inputs_in_ms": 10.577075158859172,
624
+ "compute_loss_in_ms": 534.4740462127374,
625
+ "epoch": 46.28,
626
+ "learning_rate/full": 0.00016345179061642948,
627
+ "loss": 3.5963,
628
+ "step": 56000,
629
+ "training_step_in_ms": 961.5655309080612
630
+ },
631
+ {
632
+ "_prepare_inputs_in_ms": 10.732970108627342,
633
+ "compute_loss_in_ms": 537.2660472553689,
634
+ "epoch": 47.11,
635
+ "learning_rate/full": 0.0001572873072366209,
636
+ "loss": 3.597,
637
+ "step": 57000,
638
+ "training_step_in_ms": 964.5027116436977
639
+ },
640
+ {
641
+ "_prepare_inputs_in_ms": 10.73382615565788,
642
+ "compute_loss_in_ms": 538.1741794921691,
643
+ "epoch": 47.93,
644
+ "learning_rate/full": 0.0001511650606366491,
645
+ "loss": 3.5895,
646
+ "step": 58000,
647
+ "training_step_in_ms": 949.1175830988213
648
+ },
649
+ {
650
+ "_prepare_inputs_in_ms": 10.706503831432201,
651
+ "compute_loss_in_ms": 536.7453673920827,
652
+ "epoch": 48.76,
653
+ "learning_rate/full": 0.0001450911048478807,
654
+ "loss": 3.5876,
655
+ "step": 59000,
656
+ "training_step_in_ms": 968.0035566822626
657
+ },
658
+ {
659
+ "_prepare_inputs_in_ms": 10.903483389178291,
660
+ "compute_loss_in_ms": 537.1148272417486,
661
+ "epoch": 49.59,
662
+ "learning_rate/full": 0.00013906544966141887,
663
+ "loss": 3.5819,
664
+ "step": 60000,
665
+ "training_step_in_ms": 964.3682058413979
666
+ },
667
+ {
668
+ "epoch": 49.59,
669
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5601305961608887,
670
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.27116285100803245,
671
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 101.8706,
672
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.853,
673
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.245,
674
+ "step": 60000
675
+ },
676
+ {
677
+ "_prepare_inputs_in_ms": 10.826663774233765,
678
+ "compute_loss_in_ms": 535.5709582263371,
679
+ "epoch": 50.41,
680
+ "learning_rate/full": 0.00013310610391163933,
681
+ "loss": 3.5762,
682
+ "step": 61000,
683
+ "training_step_in_ms": 957.2617566076806
684
+ },
685
+ {
686
+ "_prepare_inputs_in_ms": 10.595198371564038,
687
+ "compute_loss_in_ms": 536.0367681181524,
688
+ "epoch": 51.24,
689
+ "learning_rate/full": 0.0001272129067134662,
690
+ "loss": 3.5751,
691
+ "step": 62000,
692
+ "training_step_in_ms": 959.1705903129186
693
+ },
694
+ {
695
+ "_prepare_inputs_in_ms": 10.456255728611723,
696
+ "compute_loss_in_ms": 536.2733452994144,
697
+ "epoch": 52.07,
698
+ "learning_rate/full": 0.00012139747473708569,
699
+ "loss": 3.5774,
700
+ "step": 63000,
701
+ "training_step_in_ms": 955.730251706671
702
+ },
703
+ {
704
+ "_prepare_inputs_in_ms": 10.639551113941707,
705
+ "compute_loss_in_ms": 535.7200796955731,
706
+ "epoch": 52.89,
707
+ "learning_rate/full": 0.00011564819693413189,
708
+ "loss": 3.568,
709
+ "step": 64000,
710
+ "training_step_in_ms": 951.6928666429594
711
+ },
712
+ {
713
+ "_prepare_inputs_in_ms": 10.60645360336639,
714
+ "compute_loss_in_ms": 535.3036272318568,
715
+ "epoch": 53.72,
716
+ "learning_rate/full": 0.00010998812020655949,
717
+ "loss": 3.5703,
718
+ "step": 65000,
719
+ "training_step_in_ms": 963.1167565376963
720
+ },
721
+ {
722
+ "epoch": 53.72,
723
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5590660572052,
724
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2733920686032914,
725
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 99.9831,
726
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 8.001,
727
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.25,
728
+ "step": 65000
729
+ },
730
+ {
731
+ "_prepare_inputs_in_ms": 10.624523456094831,
732
+ "compute_loss_in_ms": 534.0653136165347,
733
+ "epoch": 54.55,
734
+ "learning_rate/full": 0.00010441152222708468,
735
+ "loss": 3.5693,
736
+ "step": 66000,
737
+ "training_step_in_ms": 955.8435329974163
738
+ },
739
+ {
740
+ "_prepare_inputs_in_ms": 10.65835806389805,
741
+ "compute_loss_in_ms": 536.2088124424918,
742
+ "epoch": 55.37,
743
+ "learning_rate/full": 9.893506973588506e-05,
744
+ "loss": 3.5599,
745
+ "step": 67000,
746
+ "training_step_in_ms": 957.1059285002993
747
+ },
748
+ {
749
+ "_prepare_inputs_in_ms": 10.751230709021911,
750
+ "compute_loss_in_ms": 536.6291307259817,
751
+ "epoch": 56.2,
752
+ "learning_rate/full": 9.355322604944605e-05,
753
+ "loss": 3.5668,
754
+ "step": 68000,
755
+ "training_step_in_ms": 959.1418899303535
756
+ },
757
+ {
758
+ "_prepare_inputs_in_ms": 10.653449523961172,
759
+ "compute_loss_in_ms": 536.7383008667966,
760
+ "epoch": 57.02,
761
+ "learning_rate/full": 8.829252005938348e-05,
762
+ "loss": 3.5592,
763
+ "step": 69000,
764
+ "training_step_in_ms": 955.6575022591278
765
+ },
766
+ {
767
+ "_prepare_inputs_in_ms": 10.65822267276235,
768
+ "compute_loss_in_ms": 535.9257607464679,
769
+ "epoch": 57.85,
770
+ "learning_rate/full": 8.312650768346744e-05,
771
+ "loss": 3.5575,
772
+ "step": 70000,
773
+ "training_step_in_ms": 951.2662082569441
774
+ },
775
+ {
776
+ "epoch": 57.85,
777
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5556719303131104,
778
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2734467694599133,
779
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 104.2955,
780
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.671,
781
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.24,
782
+ "step": 70000
783
+ },
784
+ {
785
+ "_prepare_inputs_in_ms": 10.608355628053953,
786
+ "compute_loss_in_ms": 534.1021929110866,
787
+ "epoch": 58.68,
788
+ "learning_rate/full": 7.80762980438341e-05,
789
+ "loss": 3.5556,
790
+ "step": 71000,
791
+ "training_step_in_ms": 948.2094520897372
792
+ },
793
+ {
794
+ "_prepare_inputs_in_ms": 10.676257735467516,
795
+ "compute_loss_in_ms": 536.0682506592711,
796
+ "epoch": 59.5,
797
+ "learning_rate/full": 7.315176250595717e-05,
798
+ "loss": 3.5537,
799
+ "step": 72000,
800
+ "training_step_in_ms": 954.8686325427843
801
+ },
802
+ {
803
+ "_prepare_inputs_in_ms": 10.610922348219901,
804
+ "compute_loss_in_ms": 536.3908133659279,
805
+ "epoch": 60.33,
806
+ "learning_rate/full": 6.835266183844516e-05,
807
+ "loss": 3.5479,
808
+ "step": 73000,
809
+ "training_step_in_ms": 954.1712517963024
810
+ },
811
+ {
812
+ "_prepare_inputs_in_ms": 10.579945259494707,
813
+ "compute_loss_in_ms": 534.4352571795462,
814
+ "epoch": 61.16,
815
+ "learning_rate/full": 6.368374166947542e-05,
816
+ "loss": 3.5467,
817
+ "step": 74000,
818
+ "training_step_in_ms": 953.0113322847756
819
+ },
820
+ {
821
+ "_prepare_inputs_in_ms": 10.577161580207758,
822
+ "compute_loss_in_ms": 536.7000861178385,
823
+ "epoch": 61.98,
824
+ "learning_rate/full": 5.914514927911328e-05,
825
+ "loss": 3.5466,
826
+ "step": 75000,
827
+ "training_step_in_ms": 950.8998943779152
828
+ },
829
+ {
830
+ "epoch": 61.98,
831
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5562994480133057,
832
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.27468764903823617,
833
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 102.8368,
834
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.779,
835
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.243,
836
+ "step": 75000
837
+ },
838
+ {
839
+ "_prepare_inputs_in_ms": 10.397925437655209,
840
+ "compute_loss_in_ms": 535.1076509790728,
841
+ "epoch": 62.81,
842
+ "learning_rate/full": 5.475477712440255e-05,
843
+ "loss": 3.5454,
844
+ "step": 76000,
845
+ "training_step_in_ms": 949.9264260384953
846
+ },
847
+ {
848
+ "_prepare_inputs_in_ms": 10.516429967130534,
849
+ "compute_loss_in_ms": 537.9902690803865,
850
+ "epoch": 63.64,
851
+ "learning_rate/full": 5.0499380128392283e-05,
852
+ "loss": 3.5418,
853
+ "step": 77000,
854
+ "training_step_in_ms": 963.6520826652413
855
+ },
856
+ {
857
+ "_prepare_inputs_in_ms": 10.470940343337134,
858
+ "compute_loss_in_ms": 536.5116302901879,
859
+ "epoch": 64.46,
860
+ "learning_rate/full": 4.639614598504125e-05,
861
+ "loss": 3.5397,
862
+ "step": 78000,
863
+ "training_step_in_ms": 957.950764612644
864
+ },
865
+ {
866
+ "_prepare_inputs_in_ms": 10.59993867285084,
867
+ "compute_loss_in_ms": 537.1390544432215,
868
+ "epoch": 65.29,
869
+ "learning_rate/full": 4.244480421242036e-05,
870
+ "loss": 3.5388,
871
+ "step": 79000,
872
+ "training_step_in_ms": 961.8771279493812
873
+ },
874
+ {
875
+ "_prepare_inputs_in_ms": 10.679984404356219,
876
+ "compute_loss_in_ms": 536.696684517432,
877
+ "epoch": 66.12,
878
+ "learning_rate/full": 3.8649262125702656e-05,
879
+ "loss": 3.5329,
880
+ "step": 80000,
881
+ "training_step_in_ms": 957.4748168167425
882
+ },
883
+ {
884
+ "epoch": 66.12,
885
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.556597948074341,
886
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2742539533100543,
887
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 100.6419,
888
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.949,
889
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.248,
890
+ "step": 80000
891
+ },
892
+ {
893
+ "_prepare_inputs_in_ms": 10.708052520753771,
894
+ "compute_loss_in_ms": 535.2645241598366,
895
+ "epoch": 66.94,
896
+ "learning_rate/full": 3.500971449864994e-05,
897
+ "loss": 3.5345,
898
+ "step": 81000,
899
+ "training_step_in_ms": 948.9210075238952
900
+ },
901
+ {
902
+ "_prepare_inputs_in_ms": 10.605949840741232,
903
+ "compute_loss_in_ms": 535.3940441570012,
904
+ "epoch": 67.77,
905
+ "learning_rate/full": 3.153703882232173e-05,
906
+ "loss": 3.5346,
907
+ "step": 82000,
908
+ "training_step_in_ms": 957.2232636878034
909
+ },
910
+ {
911
+ "_prepare_inputs_in_ms": 10.527875950676389,
912
+ "compute_loss_in_ms": 535.3903734084452,
913
+ "epoch": 68.6,
914
+ "learning_rate/full": 2.823094906089525e-05,
915
+ "loss": 3.5362,
916
+ "step": 83000,
917
+ "training_step_in_ms": 960.9660885017365
918
+ },
919
+ {
920
+ "_prepare_inputs_in_ms": 10.645452778204344,
921
+ "compute_loss_in_ms": 535.3771834741347,
922
+ "epoch": 69.42,
923
+ "learning_rate/full": 2.509166124130553e-05,
924
+ "loss": 3.5284,
925
+ "step": 84000,
926
+ "training_step_in_ms": 959.7084383748006
927
+ },
928
+ {
929
+ "_prepare_inputs_in_ms": 10.593148670741357,
930
+ "compute_loss_in_ms": 534.9863913216395,
931
+ "epoch": 70.25,
932
+ "learning_rate/full": 2.212855773155269e-05,
933
+ "loss": 3.5273,
934
+ "step": 85000,
935
+ "training_step_in_ms": 970.6172955055954
936
+ },
937
+ {
938
+ "epoch": 70.25,
939
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.555929660797119,
940
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2741459251366367,
941
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 104.7737,
942
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.636,
943
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.239,
944
+ "step": 85000
945
+ },
946
+ {
947
+ "_prepare_inputs_in_ms": 10.723522963888216,
948
+ "compute_loss_in_ms": 534.6476732452866,
949
+ "epoch": 71.07,
950
+ "learning_rate/full": 1.9341343786710864e-05,
951
+ "loss": 3.5266,
952
+ "step": 86000,
953
+ "training_step_in_ms": 961.9524979006965
954
+ },
955
+ {
956
+ "_prepare_inputs_in_ms": 10.785187994129956,
957
+ "compute_loss_in_ms": 536.4809199275915,
958
+ "epoch": 71.9,
959
+ "learning_rate/full": 1.6732775565058435e-05,
960
+ "loss": 3.5253,
961
+ "step": 87000,
962
+ "training_step_in_ms": 950.8976757206256
963
+ },
964
+ {
965
+ "_prepare_inputs_in_ms": 10.603952513309196,
966
+ "compute_loss_in_ms": 535.7741147053894,
967
+ "epoch": 72.73,
968
+ "learning_rate/full": 1.4305432569654864e-05,
969
+ "loss": 3.524,
970
+ "step": 88000,
971
+ "training_step_in_ms": 959.2451942999614
972
+ },
973
+ {
974
+ "_prepare_inputs_in_ms": 10.706391342449933,
975
+ "compute_loss_in_ms": 536.408079084591,
976
+ "epoch": 73.55,
977
+ "learning_rate/full": 1.2059561887499037e-05,
978
+ "loss": 3.5265,
979
+ "step": 89000,
980
+ "training_step_in_ms": 973.4634857769124
981
+ },
982
+ {
983
+ "_prepare_inputs_in_ms": 10.6856812821934,
984
+ "compute_loss_in_ms": 537.2633295034757,
985
+ "epoch": 74.38,
986
+ "learning_rate/full": 1.0003841866378549e-05,
987
+ "loss": 3.5218,
988
+ "step": 90000,
989
+ "training_step_in_ms": 966.5726283045951
990
+ },
991
+ {
992
+ "epoch": 74.38,
993
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5546064376831055,
994
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.27359656588473774,
995
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 104.0763,
996
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.687,
997
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.24,
998
+ "step": 90000
999
+ },
1000
+ {
1001
+ "_prepare_inputs_in_ms": 10.64931857888019,
1002
+ "compute_loss_in_ms": 535.808490979718,
1003
+ "epoch": 75.21,
1004
+ "learning_rate/full": 8.132070715440754e-06,
1005
+ "loss": 3.5219,
1006
+ "step": 91000,
1007
+ "training_step_in_ms": 957.4841072742129
1008
+ },
1009
+ {
1010
+ "_prepare_inputs_in_ms": 10.87383456970565,
1011
+ "compute_loss_in_ms": 537.6603767276974,
1012
+ "epoch": 76.03,
1013
+ "learning_rate/full": 6.453582116869461e-06,
1014
+ "loss": 3.5235,
1015
+ "step": 92000,
1016
+ "training_step_in_ms": 954.7427223158302
1017
+ },
1018
+ {
1019
+ "_prepare_inputs_in_ms": 10.69017239450477,
1020
+ "compute_loss_in_ms": 537.0892604731489,
1021
+ "epoch": 76.86,
1022
+ "learning_rate/full": 4.964706300643118e-06,
1023
+ "loss": 3.5189,
1024
+ "step": 93000,
1025
+ "training_step_in_ms": 950.3190122217638
1026
+ },
1027
+ {
1028
+ "_prepare_inputs_in_ms": 10.618111693882383,
1029
+ "compute_loss_in_ms": 535.7142543839291,
1030
+ "epoch": 77.69,
1031
+ "learning_rate/full": 3.6686926578696213e-06,
1032
+ "loss": 3.5235,
1033
+ "step": 94000,
1034
+ "training_step_in_ms": 958.8555470507126
1035
+ },
1036
+ {
1037
+ "_prepare_inputs_in_ms": 10.73988960427232,
1038
+ "compute_loss_in_ms": 536.3263423398603,
1039
+ "epoch": 78.51,
1040
+ "learning_rate/full": 2.5658174353882404e-06,
1041
+ "loss": 3.5215,
1042
+ "step": 95000,
1043
+ "training_step_in_ms": 964.6057669939473
1044
+ },
1045
+ {
1046
+ "epoch": 78.51,
1047
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.5548150539398193,
1048
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.27406488207696067,
1049
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 104.9846,
1050
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.62,
1051
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.238,
1052
+ "step": 95000
1053
+ },
1054
+ {
1055
+ "_prepare_inputs_in_ms": 10.761066970824286,
1056
+ "compute_loss_in_ms": 535.5862640386913,
1057
+ "epoch": 79.34,
1058
+ "learning_rate/full": 1.6593767888209988e-06,
1059
+ "loss": 3.5201,
1060
+ "step": 96000,
1061
+ "training_step_in_ms": 953.487945659901
1062
+ },
1063
+ {
1064
+ "_prepare_inputs_in_ms": 10.744887009612285,
1065
+ "compute_loss_in_ms": 536.8042176247109,
1066
+ "epoch": 80.17,
1067
+ "learning_rate/full": 9.484543083217335e-07,
1068
+ "loss": 3.5242,
1069
+ "step": 97000,
1070
+ "training_step_in_ms": 955.935797311482
1071
+ },
1072
+ {
1073
+ "_prepare_inputs_in_ms": 10.609967146418057,
1074
+ "compute_loss_in_ms": 536.5163776981644,
1075
+ "epoch": 80.99,
1076
+ "learning_rate/full": 4.3558991431862373e-07,
1077
+ "loss": 3.5217,
1078
+ "step": 98000,
1079
+ "training_step_in_ms": 951.0243763268227
1080
+ },
1081
+ {
1082
+ "_prepare_inputs_in_ms": 10.550453630159609,
1083
+ "compute_loss_in_ms": 535.8989973879652,
1084
+ "epoch": 81.82,
1085
+ "learning_rate/full": 1.1945383759244255e-07,
1086
+ "loss": 3.523,
1087
+ "step": 99000,
1088
+ "training_step_in_ms": 959.1436755338218
1089
+ },
1090
+ {
1091
+ "_prepare_inputs_in_ms": 10.565008323756047,
1092
+ "compute_loss_in_ms": 536.139583913493,
1093
+ "epoch": 82.64,
1094
+ "learning_rate/full": 9.51678964100644e-10,
1095
+ "loss": 3.523,
1096
+ "step": 100000,
1097
+ "training_step_in_ms": 958.2332628678996
1098
+ },
1099
+ {
1100
+ "epoch": 82.64,
1101
+ "eval_visual_genome-region_descriptions_v1.2.0-test_loss": 3.554699182510376,
1102
+ "eval_visual_genome-region_descriptions_v1.2.0-test_meteor": 0.2739906528866304,
1103
+ "eval_visual_genome-region_descriptions_v1.2.0-test_runtime": 105.8588,
1104
+ "eval_visual_genome-region_descriptions_v1.2.0-test_samples_per_second": 7.557,
1105
+ "eval_visual_genome-region_descriptions_v1.2.0-test_steps_per_second": 0.236,
1106
+ "step": 100000
1107
+ }
1108
+ ],
1109
+ "max_steps": 100000,
1110
+ "num_train_epochs": 83,
1111
+ "total_flos": 1.7305644974792963e+23,
1112
+ "trial_name": null,
1113
+ "trial_params": null
1114
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7040a71e26bc778074c20ff073d403c43f0ca0843108f7c14f1ed43e641fe11c
3
+ size 5432
vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
zero_to_fp32.py ADDED
@@ -0,0 +1,587 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example: python zero_to_fp32.py . pytorch_model.bin
14
+
15
+ import argparse
16
+ import torch
17
+ import glob
18
+ import math
19
+ import os
20
+ import re
21
+ from collections import OrderedDict
22
+ from dataclasses import dataclass
23
+
24
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
25
+ # DeepSpeed data structures it has to be available in the current python environment.
26
+ from deepspeed.utils import logger
27
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
28
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
29
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
30
+
31
+
32
+ @dataclass
33
+ class zero_model_state:
34
+ buffers: dict()
35
+ param_shapes: dict()
36
+ shared_params: list
37
+ ds_version: int
38
+ frozen_param_shapes: dict()
39
+ frozen_param_fragments: dict()
40
+
41
+
42
+ debug = 0
43
+
44
+ # load to cpu
45
+ device = torch.device('cpu')
46
+
47
+
48
+ def atoi(text):
49
+ return int(text) if text.isdigit() else text
50
+
51
+
52
+ def natural_keys(text):
53
+ '''
54
+ alist.sort(key=natural_keys) sorts in human order
55
+ http://nedbatchelder.com/blog/200712/human_sorting.html
56
+ (See Toothy's implementation in the comments)
57
+ '''
58
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
59
+
60
+
61
+ def get_model_state_file(checkpoint_dir, zero_stage):
62
+ if not os.path.isdir(checkpoint_dir):
63
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
64
+
65
+ # there should be only one file
66
+ if zero_stage <= 2:
67
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
68
+ elif zero_stage == 3:
69
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
70
+
71
+ if not os.path.exists(file):
72
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
73
+
74
+ return file
75
+
76
+
77
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
78
+ # XXX: need to test that this simple glob rule works for multi-node setup too
79
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
80
+
81
+ if len(ckpt_files) == 0:
82
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
83
+
84
+ return ckpt_files
85
+
86
+
87
+ def get_optim_files(checkpoint_dir):
88
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
89
+
90
+
91
+ def get_model_state_files(checkpoint_dir):
92
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
93
+
94
+
95
+ def parse_model_states(files):
96
+ zero_model_states = []
97
+ for file in files:
98
+ state_dict = torch.load(file, map_location=device)
99
+
100
+ if BUFFER_NAMES not in state_dict:
101
+ raise ValueError(f"{file} is not a model state checkpoint")
102
+ buffer_names = state_dict[BUFFER_NAMES]
103
+ if debug:
104
+ print("Found buffers:", buffer_names)
105
+
106
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
107
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
108
+ param_shapes = state_dict[PARAM_SHAPES]
109
+
110
+ # collect parameters that are included in param_shapes
111
+ param_names = []
112
+ for s in param_shapes:
113
+ for name in s.keys():
114
+ param_names.append(name)
115
+
116
+ # update with frozen parameters
117
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
118
+ if frozen_param_shapes is not None:
119
+ if debug:
120
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
121
+ param_names += list(frozen_param_shapes.keys())
122
+
123
+ # handle shared params
124
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
125
+
126
+ ds_version = state_dict.get(DS_VERSION, None)
127
+
128
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
129
+
130
+ z_model_state = zero_model_state(buffers=buffers,
131
+ param_shapes=param_shapes,
132
+ shared_params=shared_params,
133
+ ds_version=ds_version,
134
+ frozen_param_shapes=frozen_param_shapes,
135
+ frozen_param_fragments=frozen_param_fragments)
136
+ zero_model_states.append(z_model_state)
137
+
138
+ return zero_model_states
139
+
140
+
141
+ def parse_optim_states(files, ds_checkpoint_dir):
142
+
143
+ total_files = len(files)
144
+ state_dicts = []
145
+ for f in files:
146
+ state_dict = torch.load(f, map_location=device)
147
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
148
+ # and also handle the case where it was already removed by another helper script
149
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
150
+ state_dicts.append(state_dict)
151
+
152
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
153
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
154
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
155
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
156
+
157
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
158
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
159
+ # use the max of the partition_count to get the dp world_size.
160
+
161
+ if type(world_size) is list:
162
+ world_size = max(world_size)
163
+
164
+ if world_size != total_files:
165
+ raise ValueError(
166
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
167
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
168
+ )
169
+
170
+ # the groups are named differently in each stage
171
+ if zero_stage <= 2:
172
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
173
+ elif zero_stage == 3:
174
+ fp32_groups_key = FP32_FLAT_GROUPS
175
+ else:
176
+ raise ValueError(f"unknown zero stage {zero_stage}")
177
+
178
+ if zero_stage <= 2:
179
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
180
+ elif zero_stage == 3:
181
+ # if there is more than one param group, there will be multiple flattened tensors - one
182
+ # flattened tensor per group - for simplicity merge them into a single tensor
183
+ #
184
+ # XXX: could make the script more memory efficient for when there are multiple groups - it
185
+ # will require matching the sub-lists of param_shapes for each param group flattened tensor
186
+
187
+ fp32_flat_groups = [
188
+ torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) for i in range(len(state_dicts))
189
+ ]
190
+
191
+ return zero_stage, world_size, fp32_flat_groups
192
+
193
+
194
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir):
195
+ """
196
+ Returns fp32 state_dict reconstructed from ds checkpoint
197
+
198
+ Args:
199
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
200
+
201
+ """
202
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
203
+
204
+ optim_files = get_optim_files(ds_checkpoint_dir)
205
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
206
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
207
+
208
+ model_files = get_model_state_files(ds_checkpoint_dir)
209
+
210
+ zero_model_states = parse_model_states(model_files)
211
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
212
+
213
+ if zero_stage <= 2:
214
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states)
215
+ elif zero_stage == 3:
216
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states)
217
+
218
+
219
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
220
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
221
+ return
222
+
223
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
224
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
225
+
226
+ if debug:
227
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
228
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
229
+
230
+ wanted_params = len(frozen_param_shapes)
231
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
232
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
233
+ print(f'Frozen params: Have {avail_numel} numels to process.')
234
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
235
+
236
+ total_params = 0
237
+ total_numel = 0
238
+ for name, shape in frozen_param_shapes.items():
239
+ total_params += 1
240
+ unpartitioned_numel = shape.numel()
241
+ total_numel += unpartitioned_numel
242
+
243
+ state_dict[name] = frozen_param_fragments[name]
244
+
245
+ if debug:
246
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
247
+
248
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
249
+
250
+
251
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
252
+ param_shapes = zero_model_states[0].param_shapes
253
+
254
+ # Reconstruction protocol:
255
+ #
256
+ # XXX: document this
257
+
258
+ if debug:
259
+ for i in range(world_size):
260
+ for j in range(len(fp32_flat_groups[0])):
261
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
262
+
263
+ # XXX: memory usage doubles here (zero2)
264
+ num_param_groups = len(fp32_flat_groups[0])
265
+ merged_single_partition_of_fp32_groups = []
266
+ for i in range(num_param_groups):
267
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
268
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
269
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
270
+ avail_numel = sum(
271
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
272
+
273
+ if debug:
274
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
275
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
276
+ # not asserting if there is a mismatch due to possible padding
277
+ print(f"Have {avail_numel} numels to process.")
278
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
279
+
280
+ # params
281
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
282
+ # out-of-core computing solution
283
+ total_numel = 0
284
+ total_params = 0
285
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
286
+ offset = 0
287
+ avail_numel = full_single_fp32_vector.numel()
288
+ for name, shape in shapes.items():
289
+
290
+ unpartitioned_numel = shape.numel()
291
+ total_numel += unpartitioned_numel
292
+ total_params += 1
293
+
294
+ if debug:
295
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
296
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
297
+ offset += unpartitioned_numel
298
+
299
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
300
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
301
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
302
+ # live optimizer object, so we are checking that the numbers are within the right range
303
+ align_to = 2 * world_size
304
+
305
+ def zero2_align(x):
306
+ return align_to * math.ceil(x / align_to)
307
+
308
+ if debug:
309
+ print(f"original offset={offset}, avail_numel={avail_numel}")
310
+
311
+ offset = zero2_align(offset)
312
+ avail_numel = zero2_align(avail_numel)
313
+
314
+ if debug:
315
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
316
+
317
+ # Sanity check
318
+ if offset != avail_numel:
319
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
320
+
321
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
322
+
323
+
324
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states):
325
+ state_dict = OrderedDict()
326
+
327
+ # buffers
328
+ buffers = zero_model_states[0].buffers
329
+ state_dict.update(buffers)
330
+ if debug:
331
+ print(f"added {len(buffers)} buffers")
332
+
333
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
334
+
335
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
336
+
337
+ # recover shared parameters
338
+ for pair in zero_model_states[0].shared_params:
339
+ if pair[1] in state_dict:
340
+ state_dict[pair[0]] = state_dict[pair[1]]
341
+
342
+ return state_dict
343
+
344
+
345
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
346
+ remainder = unpartitioned_numel % world_size
347
+ padding_numel = (world_size - remainder) if remainder else 0
348
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
349
+ return partitioned_numel, padding_numel
350
+
351
+
352
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
353
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
354
+ return
355
+
356
+ if debug:
357
+ for i in range(world_size):
358
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
359
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
360
+
361
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
362
+ wanted_params = len(frozen_param_shapes)
363
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
364
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
365
+ print(f'Frozen params: Have {avail_numel} numels to process.')
366
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
367
+
368
+ total_params = 0
369
+ total_numel = 0
370
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
371
+ total_params += 1
372
+ unpartitioned_numel = shape.numel()
373
+ total_numel += unpartitioned_numel
374
+
375
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
376
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
377
+
378
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
379
+
380
+ if debug:
381
+ print(
382
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
383
+ )
384
+
385
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
386
+
387
+
388
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
389
+ param_shapes = zero_model_states[0].param_shapes
390
+ avail_numel = fp32_flat_groups[0].numel() * world_size
391
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
392
+ # param, re-consolidating each param, while dealing with padding if any
393
+
394
+ # merge list of dicts, preserving order
395
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
396
+
397
+ if debug:
398
+ for i in range(world_size):
399
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
400
+
401
+ wanted_params = len(param_shapes)
402
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
403
+ # not asserting if there is a mismatch due to possible padding
404
+ avail_numel = fp32_flat_groups[0].numel() * world_size
405
+ print(f"Trainable params: Have {avail_numel} numels to process.")
406
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
407
+
408
+ # params
409
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
410
+ # out-of-core computing solution
411
+ offset = 0
412
+ total_numel = 0
413
+ total_params = 0
414
+ for name, shape in param_shapes.items():
415
+
416
+ unpartitioned_numel = shape.numel()
417
+ total_numel += unpartitioned_numel
418
+ total_params += 1
419
+
420
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
421
+
422
+ if debug:
423
+ print(
424
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
425
+ )
426
+
427
+ # XXX: memory usage doubles here
428
+ state_dict[name] = torch.cat(
429
+ tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
430
+ 0).narrow(0, 0, unpartitioned_numel).view(shape)
431
+ offset += partitioned_numel
432
+
433
+ offset *= world_size
434
+
435
+ # Sanity check
436
+ if offset != avail_numel:
437
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
438
+
439
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
440
+
441
+
442
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states):
443
+ state_dict = OrderedDict()
444
+
445
+ # buffers
446
+ buffers = zero_model_states[0].buffers
447
+ state_dict.update(buffers)
448
+ if debug:
449
+ print(f"added {len(buffers)} buffers")
450
+
451
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
452
+
453
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
454
+
455
+ # recover shared parameters
456
+ for pair in zero_model_states[0].shared_params:
457
+ if pair[1] in state_dict:
458
+ state_dict[pair[0]] = state_dict[pair[1]]
459
+
460
+ return state_dict
461
+
462
+
463
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None):
464
+ """
465
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
466
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
467
+ via a model hub.
468
+
469
+ Args:
470
+ - ``checkpoint_dir``: path to the desired checkpoint folder
471
+ - ``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``
472
+
473
+ Returns:
474
+ - pytorch ``state_dict``
475
+
476
+ Note: this approach may not work if your application doesn't have sufficient free CPU memory and
477
+ you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
478
+ the checkpoint.
479
+
480
+ A typical usage might be ::
481
+
482
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
483
+ # do the training and checkpoint saving
484
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
485
+ model = model.cpu() # move to cpu
486
+ model.load_state_dict(state_dict)
487
+ # submit to model hub or save the model to share with others
488
+
489
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
490
+ application. i.e. you will need to re-initialize the deepspeed engine, since
491
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
492
+
493
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
494
+
495
+ """
496
+ if tag is None:
497
+ latest_path = os.path.join(checkpoint_dir, 'latest')
498
+ if os.path.isfile(latest_path):
499
+ with open(latest_path, 'r') as fd:
500
+ tag = fd.read().strip()
501
+ else:
502
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
503
+
504
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
505
+
506
+ if not os.path.isdir(ds_checkpoint_dir):
507
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
508
+
509
+ return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir)
510
+
511
+
512
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, tag=None):
513
+ """
514
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
515
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
516
+
517
+ Args:
518
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
519
+ - ``output_file``: path to the pytorch fp32 state_dict output file (e.g. path/pytorch_model.bin)
520
+ - ``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``
521
+ """
522
+
523
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
524
+ print(f"Saving fp32 state dict to {output_file}")
525
+ torch.save(state_dict, output_file)
526
+
527
+
528
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
529
+ """
530
+ 1. Put the provided model to cpu
531
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
532
+ 3. Load it into the provided model
533
+
534
+ Args:
535
+ - ``model``: the model object to update
536
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
537
+ - ``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``
538
+
539
+ Returns:
540
+ - ``model`: modified model
541
+
542
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
543
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
544
+ conveniently placed for you in the checkpoint folder.
545
+
546
+ A typical usage might be ::
547
+
548
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
549
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
550
+ # submit to model hub or save the model to share with others
551
+
552
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
553
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
554
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
555
+
556
+ """
557
+ logger.info(f"Extracting fp32 weights")
558
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
559
+
560
+ logger.info(f"Overwriting model with fp32 weights")
561
+ model = model.cpu()
562
+ model.load_state_dict(state_dict, strict=False)
563
+
564
+ return model
565
+
566
+
567
+ if __name__ == "__main__":
568
+
569
+ parser = argparse.ArgumentParser()
570
+ parser.add_argument("checkpoint_dir",
571
+ type=str,
572
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
573
+ parser.add_argument(
574
+ "output_file",
575
+ type=str,
576
+ help="path to the pytorch fp32 state_dict output file (e.g. path/checkpoint-12/pytorch_model.bin)")
577
+ parser.add_argument("-t",
578
+ "--tag",
579
+ type=str,
580
+ default=None,
581
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
582
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
583
+ args = parser.parse_args()
584
+
585
+ debug = args.debug
586
+
587
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir, args.output_file, tag=args.tag)