moussaKam commited on
Commit
0250119
·
verified ·
1 Parent(s): 3e26a56
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
added_tokens.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</tool_call>": 151658,
3
+ "<tool_call>": 151657,
4
+ "<|box_end|>": 151649,
5
+ "<|box_start|>": 151648,
6
+ "<|endoftext|>": 151643,
7
+ "<|file_sep|>": 151664,
8
+ "<|fim_middle|>": 151660,
9
+ "<|fim_pad|>": 151662,
10
+ "<|fim_prefix|>": 151659,
11
+ "<|fim_suffix|>": 151661,
12
+ "<|im_end|>": 151645,
13
+ "<|im_start|>": 151644,
14
+ "<|image_pad|>": 151655,
15
+ "<|object_ref_end|>": 151647,
16
+ "<|object_ref_start|>": 151646,
17
+ "<|quad_end|>": 151651,
18
+ "<|quad_start|>": 151650,
19
+ "<|repo_name|>": 151663,
20
+ "<|video_pad|>": 151656,
21
+ "<|vision_end|>": 151653,
22
+ "<|vision_pad|>": 151654,
23
+ "<|vision_start|>": 151652
24
+ }
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/lustre/fsn1/projects/rech/gkb/uua32zb/grand_challenge/checkpoints/Qwen__Qwen2.5-1.5B-annealing_continual-0.0002LR-8192CL-2GAS-2BS-1EPOCHS-0.9BETA1-0.95BETA2/",
3
+ "architectures": [
4
+ "Qwen2ForCausalLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 151643,
8
+ "eos_token_id": 151643,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 1536,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 8960,
13
+ "max_position_embeddings": 131072,
14
+ "max_window_layers": 28,
15
+ "model_type": "qwen2",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 28,
18
+ "num_key_value_heads": 2,
19
+ "rms_norm_eps": 1e-06,
20
+ "rope_scaling": null,
21
+ "rope_theta": 1000000.0,
22
+ "sliding_window": null,
23
+ "tie_word_embeddings": true,
24
+ "torch_dtype": "bfloat16",
25
+ "transformers_version": "4.46.1",
26
+ "use_cache": false,
27
+ "use_mrope": false,
28
+ "use_sliding_window": false,
29
+ "vocab_size": 151936
30
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "eos_token_id": 151643,
4
+ "max_new_tokens": 2048,
5
+ "transformers_version": "4.46.1"
6
+ }
latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step13267
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4b5b37446d5d6a79e85a543dc616b531a8701e7e7a53d275b8aaa67eda91543
3
+ size 3554214752
special_tokens_map.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|object_ref_start|>",
6
+ "<|object_ref_end|>",
7
+ "<|box_start|>",
8
+ "<|box_end|>",
9
+ "<|quad_start|>",
10
+ "<|quad_end|>",
11
+ "<|vision_start|>",
12
+ "<|vision_end|>",
13
+ "<|vision_pad|>",
14
+ "<|image_pad|>",
15
+ "<|video_pad|>"
16
+ ],
17
+ "eos_token": {
18
+ "content": "<|im_end|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": {
25
+ "content": "<|endoftext|>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ }
31
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
3
+ size 11421896
tokenizer_config.json ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ }
181
+ },
182
+ "additional_special_tokens": [
183
+ "<|im_start|>",
184
+ "<|im_end|>",
185
+ "<|object_ref_start|>",
186
+ "<|object_ref_end|>",
187
+ "<|box_start|>",
188
+ "<|box_end|>",
189
+ "<|quad_start|>",
190
+ "<|quad_end|>",
191
+ "<|vision_start|>",
192
+ "<|vision_end|>",
193
+ "<|vision_pad|>",
194
+ "<|image_pad|>",
195
+ "<|video_pad|>"
196
+ ],
197
+ "bos_token": null,
198
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
199
+ "clean_up_tokenization_spaces": false,
200
+ "eos_token": "<|im_end|>",
201
+ "errors": "replace",
202
+ "model_max_length": 131072,
203
+ "pad_token": "<|endoftext|>",
204
+ "padding_side": "right",
205
+ "split_special_tokens": false,
206
+ "tokenizer_class": "Qwen2Tokenizer",
207
+ "unk_token": null
208
+ }
trainer_state.json ADDED
@@ -0,0 +1,1888 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 1.0,
5
+ "eval_steps": 500.0,
6
+ "global_step": 13267,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.003768749528906309,
13
+ "grad_norm": 0.35509032011032104,
14
+ "learning_rate": 9.999649547444612e-05,
15
+ "loss": 0.5094,
16
+ "step": 50
17
+ },
18
+ {
19
+ "epoch": 0.007537499057812618,
20
+ "grad_norm": 0.3374439477920532,
21
+ "learning_rate": 9.998598238905239e-05,
22
+ "loss": 0.4888,
23
+ "step": 100
24
+ },
25
+ {
26
+ "epoch": 0.011306248586718927,
27
+ "grad_norm": 0.3017200827598572,
28
+ "learning_rate": 9.996846221755392e-05,
29
+ "loss": 0.4871,
30
+ "step": 150
31
+ },
32
+ {
33
+ "epoch": 0.015074998115625236,
34
+ "grad_norm": 0.29322266578674316,
35
+ "learning_rate": 9.994393741594623e-05,
36
+ "loss": 0.4899,
37
+ "step": 200
38
+ },
39
+ {
40
+ "epoch": 0.018843747644531544,
41
+ "grad_norm": 0.3081373870372772,
42
+ "learning_rate": 9.99124114221411e-05,
43
+ "loss": 0.4896,
44
+ "step": 250
45
+ },
46
+ {
47
+ "epoch": 0.022612497173437853,
48
+ "grad_norm": 0.29016199707984924,
49
+ "learning_rate": 9.987388865548454e-05,
50
+ "loss": 0.4889,
51
+ "step": 300
52
+ },
53
+ {
54
+ "epoch": 0.026381246702344163,
55
+ "grad_norm": 0.265391081571579,
56
+ "learning_rate": 9.982837451613738e-05,
57
+ "loss": 0.4898,
58
+ "step": 350
59
+ },
60
+ {
61
+ "epoch": 0.030149996231250472,
62
+ "grad_norm": 0.27272671461105347,
63
+ "learning_rate": 9.977587538431816e-05,
64
+ "loss": 0.4894,
65
+ "step": 400
66
+ },
67
+ {
68
+ "epoch": 0.03391874576015678,
69
+ "grad_norm": 0.28726664185523987,
70
+ "learning_rate": 9.971639861940889e-05,
71
+ "loss": 0.4869,
72
+ "step": 450
73
+ },
74
+ {
75
+ "epoch": 0.03768749528906309,
76
+ "grad_norm": 0.28651759028434753,
77
+ "learning_rate": 9.964995255892323e-05,
78
+ "loss": 0.4912,
79
+ "step": 500
80
+ },
81
+ {
82
+ "epoch": 0.0414562448179694,
83
+ "grad_norm": 0.24553848803043365,
84
+ "learning_rate": 9.957654651733788e-05,
85
+ "loss": 0.4897,
86
+ "step": 550
87
+ },
88
+ {
89
+ "epoch": 0.045224994346875706,
90
+ "grad_norm": 0.24010591208934784,
91
+ "learning_rate": 9.949619078478677e-05,
92
+ "loss": 0.4866,
93
+ "step": 600
94
+ },
95
+ {
96
+ "epoch": 0.048993743875782016,
97
+ "grad_norm": 0.26084381341934204,
98
+ "learning_rate": 9.940889662561864e-05,
99
+ "loss": 0.4892,
100
+ "step": 650
101
+ },
102
+ {
103
+ "epoch": 0.052762493404688325,
104
+ "grad_norm": 0.2248304784297943,
105
+ "learning_rate": 9.931467627681792e-05,
106
+ "loss": 0.4849,
107
+ "step": 700
108
+ },
109
+ {
110
+ "epoch": 0.056531242933594635,
111
+ "grad_norm": 0.23623178899288177,
112
+ "learning_rate": 9.921354294628944e-05,
113
+ "loss": 0.4852,
114
+ "step": 750
115
+ },
116
+ {
117
+ "epoch": 0.060299992462500944,
118
+ "grad_norm": 0.23275640606880188,
119
+ "learning_rate": 9.910551081100684e-05,
120
+ "loss": 0.4855,
121
+ "step": 800
122
+ },
123
+ {
124
+ "epoch": 0.06406874199140725,
125
+ "grad_norm": 0.22925056517124176,
126
+ "learning_rate": 9.899059501502526e-05,
127
+ "loss": 0.4849,
128
+ "step": 850
129
+ },
130
+ {
131
+ "epoch": 0.06783749152031356,
132
+ "grad_norm": 0.23725946247577667,
133
+ "learning_rate": 9.886881166735846e-05,
134
+ "loss": 0.4839,
135
+ "step": 900
136
+ },
137
+ {
138
+ "epoch": 0.07160624104921987,
139
+ "grad_norm": 0.2293645143508911,
140
+ "learning_rate": 9.874017783972058e-05,
141
+ "loss": 0.486,
142
+ "step": 950
143
+ },
144
+ {
145
+ "epoch": 0.07537499057812617,
146
+ "grad_norm": 0.24602073431015015,
147
+ "learning_rate": 9.860471156413309e-05,
148
+ "loss": 0.4835,
149
+ "step": 1000
150
+ },
151
+ {
152
+ "epoch": 0.07914374010703248,
153
+ "grad_norm": 0.20568886399269104,
154
+ "learning_rate": 9.846243183039694e-05,
155
+ "loss": 0.4838,
156
+ "step": 1050
157
+ },
158
+ {
159
+ "epoch": 0.0829124896359388,
160
+ "grad_norm": 0.2165093570947647,
161
+ "learning_rate": 9.831335858343064e-05,
162
+ "loss": 0.4827,
163
+ "step": 1100
164
+ },
165
+ {
166
+ "epoch": 0.0866812391648451,
167
+ "grad_norm": 0.2424800992012024,
168
+ "learning_rate": 9.815751272047434e-05,
169
+ "loss": 0.4832,
170
+ "step": 1150
171
+ },
172
+ {
173
+ "epoch": 0.09044998869375141,
174
+ "grad_norm": 0.207057386636734,
175
+ "learning_rate": 9.79949160881604e-05,
176
+ "loss": 0.4809,
177
+ "step": 1200
178
+ },
179
+ {
180
+ "epoch": 0.09421873822265772,
181
+ "grad_norm": 0.21975122392177582,
182
+ "learning_rate": 9.782559147945094e-05,
183
+ "loss": 0.4827,
184
+ "step": 1250
185
+ },
186
+ {
187
+ "epoch": 0.09798748775156403,
188
+ "grad_norm": 0.21343478560447693,
189
+ "learning_rate": 9.76495626304427e-05,
190
+ "loss": 0.4812,
191
+ "step": 1300
192
+ },
193
+ {
194
+ "epoch": 0.10175623728047034,
195
+ "grad_norm": 0.20896418392658234,
196
+ "learning_rate": 9.746685421703961e-05,
197
+ "loss": 0.4792,
198
+ "step": 1350
199
+ },
200
+ {
201
+ "epoch": 0.10552498680937665,
202
+ "grad_norm": 0.2270091027021408,
203
+ "learning_rate": 9.727749185149388e-05,
204
+ "loss": 0.4795,
205
+ "step": 1400
206
+ },
207
+ {
208
+ "epoch": 0.10929373633828296,
209
+ "grad_norm": 0.2058868557214737,
210
+ "learning_rate": 9.708150207881543e-05,
211
+ "loss": 0.4794,
212
+ "step": 1450
213
+ },
214
+ {
215
+ "epoch": 0.11306248586718927,
216
+ "grad_norm": 0.19969668984413147,
217
+ "learning_rate": 9.687891237305096e-05,
218
+ "loss": 0.4803,
219
+ "step": 1500
220
+ },
221
+ {
222
+ "epoch": 0.11683123539609558,
223
+ "grad_norm": 0.19804421067237854,
224
+ "learning_rate": 9.666975113343246e-05,
225
+ "loss": 0.4782,
226
+ "step": 1550
227
+ },
228
+ {
229
+ "epoch": 0.12059998492500189,
230
+ "grad_norm": 0.19650672376155853,
231
+ "learning_rate": 9.645404768039633e-05,
232
+ "loss": 0.4773,
233
+ "step": 1600
234
+ },
235
+ {
236
+ "epoch": 0.1243687344539082,
237
+ "grad_norm": 0.20196650922298431,
238
+ "learning_rate": 9.623183225147308e-05,
239
+ "loss": 0.4769,
240
+ "step": 1650
241
+ },
242
+ {
243
+ "epoch": 0.1281374839828145,
244
+ "grad_norm": 0.20083576440811157,
245
+ "learning_rate": 9.600313599704869e-05,
246
+ "loss": 0.4748,
247
+ "step": 1700
248
+ },
249
+ {
250
+ "epoch": 0.13190623351172082,
251
+ "grad_norm": 0.19036008417606354,
252
+ "learning_rate": 9.576799097599786e-05,
253
+ "loss": 0.4751,
254
+ "step": 1750
255
+ },
256
+ {
257
+ "epoch": 0.1356749830406271,
258
+ "grad_norm": 0.20416900515556335,
259
+ "learning_rate": 9.552643015118998e-05,
260
+ "loss": 0.4727,
261
+ "step": 1800
262
+ },
263
+ {
264
+ "epoch": 0.13944373256953344,
265
+ "grad_norm": 0.19550226628780365,
266
+ "learning_rate": 9.527848738486842e-05,
267
+ "loss": 0.4731,
268
+ "step": 1850
269
+ },
270
+ {
271
+ "epoch": 0.14321248209843973,
272
+ "grad_norm": 0.20287151634693146,
273
+ "learning_rate": 9.502419743390357e-05,
274
+ "loss": 0.4745,
275
+ "step": 1900
276
+ },
277
+ {
278
+ "epoch": 0.14698123162734605,
279
+ "grad_norm": 0.18741615116596222,
280
+ "learning_rate": 9.476359594492068e-05,
281
+ "loss": 0.4734,
282
+ "step": 1950
283
+ },
284
+ {
285
+ "epoch": 0.15074998115625235,
286
+ "grad_norm": 0.20605124533176422,
287
+ "learning_rate": 9.449671944930288e-05,
288
+ "loss": 0.4732,
289
+ "step": 2000
290
+ },
291
+ {
292
+ "epoch": 0.15451873068515867,
293
+ "grad_norm": 0.20259861648082733,
294
+ "learning_rate": 9.422360535807009e-05,
295
+ "loss": 0.4745,
296
+ "step": 2050
297
+ },
298
+ {
299
+ "epoch": 0.15828748021406497,
300
+ "grad_norm": 0.19558943808078766,
301
+ "learning_rate": 9.394429195663478e-05,
302
+ "loss": 0.4723,
303
+ "step": 2100
304
+ },
305
+ {
306
+ "epoch": 0.1620562297429713,
307
+ "grad_norm": 0.20177054405212402,
308
+ "learning_rate": 9.365881839943508e-05,
309
+ "loss": 0.4699,
310
+ "step": 2150
311
+ },
312
+ {
313
+ "epoch": 0.1658249792718776,
314
+ "grad_norm": 0.20023804903030396,
315
+ "learning_rate": 9.336722470444604e-05,
316
+ "loss": 0.4719,
317
+ "step": 2200
318
+ },
319
+ {
320
+ "epoch": 0.1695937288007839,
321
+ "grad_norm": 0.19571995735168457,
322
+ "learning_rate": 9.306955174756985e-05,
323
+ "loss": 0.4708,
324
+ "step": 2250
325
+ },
326
+ {
327
+ "epoch": 0.1733624783296902,
328
+ "grad_norm": 0.18980449438095093,
329
+ "learning_rate": 9.27658412569059e-05,
330
+ "loss": 0.4697,
331
+ "step": 2300
332
+ },
333
+ {
334
+ "epoch": 0.17713122785859653,
335
+ "grad_norm": 0.18121857941150665,
336
+ "learning_rate": 9.24561358069012e-05,
337
+ "loss": 0.4692,
338
+ "step": 2350
339
+ },
340
+ {
341
+ "epoch": 0.18089997738750282,
342
+ "grad_norm": 0.18635448813438416,
343
+ "learning_rate": 9.214047881238233e-05,
344
+ "loss": 0.4682,
345
+ "step": 2400
346
+ },
347
+ {
348
+ "epoch": 0.18466872691640915,
349
+ "grad_norm": 0.18292276561260223,
350
+ "learning_rate": 9.181891452246937e-05,
351
+ "loss": 0.4717,
352
+ "step": 2450
353
+ },
354
+ {
355
+ "epoch": 0.18843747644531544,
356
+ "grad_norm": 0.4070293605327606,
357
+ "learning_rate": 9.149148801437321e-05,
358
+ "loss": 0.4685,
359
+ "step": 2500
360
+ },
361
+ {
362
+ "epoch": 0.19220622597422174,
363
+ "grad_norm": 0.19017393887043,
364
+ "learning_rate": 9.115824518707644e-05,
365
+ "loss": 0.4675,
366
+ "step": 2550
367
+ },
368
+ {
369
+ "epoch": 0.19597497550312806,
370
+ "grad_norm": 0.2028086632490158,
371
+ "learning_rate": 9.08192327548992e-05,
372
+ "loss": 0.4668,
373
+ "step": 2600
374
+ },
375
+ {
376
+ "epoch": 0.19974372503203436,
377
+ "grad_norm": 0.18879903852939606,
378
+ "learning_rate": 9.047449824095075e-05,
379
+ "loss": 0.466,
380
+ "step": 2650
381
+ },
382
+ {
383
+ "epoch": 0.20351247456094068,
384
+ "grad_norm": 0.18708941340446472,
385
+ "learning_rate": 9.012408997046766e-05,
386
+ "loss": 0.467,
387
+ "step": 2700
388
+ },
389
+ {
390
+ "epoch": 0.20728122408984698,
391
+ "grad_norm": 0.18148259818553925,
392
+ "learning_rate": 8.976805706403942e-05,
393
+ "loss": 0.4657,
394
+ "step": 2750
395
+ },
396
+ {
397
+ "epoch": 0.2110499736187533,
398
+ "grad_norm": 0.18493063747882843,
399
+ "learning_rate": 8.94064494307228e-05,
400
+ "loss": 0.4638,
401
+ "step": 2800
402
+ },
403
+ {
404
+ "epoch": 0.2148187231476596,
405
+ "grad_norm": 0.18034948408603668,
406
+ "learning_rate": 8.903931776104545e-05,
407
+ "loss": 0.4624,
408
+ "step": 2850
409
+ },
410
+ {
411
+ "epoch": 0.21858747267656592,
412
+ "grad_norm": 0.18979419767856598,
413
+ "learning_rate": 8.866671351990007e-05,
414
+ "loss": 0.4629,
415
+ "step": 2900
416
+ },
417
+ {
418
+ "epoch": 0.22235622220547221,
419
+ "grad_norm": 0.18408875167369843,
420
+ "learning_rate": 8.82886889393301e-05,
421
+ "loss": 0.4638,
422
+ "step": 2950
423
+ },
424
+ {
425
+ "epoch": 0.22612497173437854,
426
+ "grad_norm": 0.17015992105007172,
427
+ "learning_rate": 8.790529701120759e-05,
428
+ "loss": 0.4608,
429
+ "step": 3000
430
+ },
431
+ {
432
+ "epoch": 0.22989372126328483,
433
+ "grad_norm": 0.17827536165714264,
434
+ "learning_rate": 8.751659147980493e-05,
435
+ "loss": 0.4635,
436
+ "step": 3050
437
+ },
438
+ {
439
+ "epoch": 0.23366247079219116,
440
+ "grad_norm": 0.1894233673810959,
441
+ "learning_rate": 8.712262683426082e-05,
442
+ "loss": 0.4593,
443
+ "step": 3100
444
+ },
445
+ {
446
+ "epoch": 0.23743122032109745,
447
+ "grad_norm": 0.19764114916324615,
448
+ "learning_rate": 8.672345830094199e-05,
449
+ "loss": 0.4622,
450
+ "step": 3150
451
+ },
452
+ {
453
+ "epoch": 0.24119996985000378,
454
+ "grad_norm": 0.18290351331233978,
455
+ "learning_rate": 8.631914183570143e-05,
456
+ "loss": 0.4608,
457
+ "step": 3200
458
+ },
459
+ {
460
+ "epoch": 0.24496871937891007,
461
+ "grad_norm": 0.18013353645801544,
462
+ "learning_rate": 8.590973411603452e-05,
463
+ "loss": 0.4601,
464
+ "step": 3250
465
+ },
466
+ {
467
+ "epoch": 0.2487374689078164,
468
+ "grad_norm": 0.17729552090168,
469
+ "learning_rate": 8.549529253313386e-05,
470
+ "loss": 0.4611,
471
+ "step": 3300
472
+ },
473
+ {
474
+ "epoch": 0.2525062184367227,
475
+ "grad_norm": 0.1892414540052414,
476
+ "learning_rate": 8.507587518384421e-05,
477
+ "loss": 0.4583,
478
+ "step": 3350
479
+ },
480
+ {
481
+ "epoch": 0.256274967965629,
482
+ "grad_norm": 0.17193005979061127,
483
+ "learning_rate": 8.465154086251828e-05,
484
+ "loss": 0.4572,
485
+ "step": 3400
486
+ },
487
+ {
488
+ "epoch": 0.2600437174945353,
489
+ "grad_norm": 0.18148685991764069,
490
+ "learning_rate": 8.422234905277495e-05,
491
+ "loss": 0.4583,
492
+ "step": 3450
493
+ },
494
+ {
495
+ "epoch": 0.26381246702344163,
496
+ "grad_norm": 0.19143982231616974,
497
+ "learning_rate": 8.378835991916083e-05,
498
+ "loss": 0.4582,
499
+ "step": 3500
500
+ },
501
+ {
502
+ "epoch": 0.26758121655234796,
503
+ "grad_norm": 0.18079186975955963,
504
+ "learning_rate": 8.334963429871627e-05,
505
+ "loss": 0.4599,
506
+ "step": 3550
507
+ },
508
+ {
509
+ "epoch": 0.2713499660812542,
510
+ "grad_norm": 0.17887386679649353,
511
+ "learning_rate": 8.290623369244721e-05,
512
+ "loss": 0.4574,
513
+ "step": 3600
514
+ },
515
+ {
516
+ "epoch": 0.27511871561016055,
517
+ "grad_norm": 0.17481209337711334,
518
+ "learning_rate": 8.245822025670384e-05,
519
+ "loss": 0.4588,
520
+ "step": 3650
521
+ },
522
+ {
523
+ "epoch": 0.27888746513906687,
524
+ "grad_norm": 0.17591702938079834,
525
+ "learning_rate": 8.200565679446753e-05,
526
+ "loss": 0.4543,
527
+ "step": 3700
528
+ },
529
+ {
530
+ "epoch": 0.2826562146679732,
531
+ "grad_norm": 0.17434370517730713,
532
+ "learning_rate": 8.154860674654698e-05,
533
+ "loss": 0.4552,
534
+ "step": 3750
535
+ },
536
+ {
537
+ "epoch": 0.28642496419687946,
538
+ "grad_norm": 0.17741286754608154,
539
+ "learning_rate": 8.108713418268514e-05,
540
+ "loss": 0.4551,
541
+ "step": 3800
542
+ },
543
+ {
544
+ "epoch": 0.2901937137257858,
545
+ "grad_norm": 0.1794031709432602,
546
+ "learning_rate": 8.062130379257764e-05,
547
+ "loss": 0.4557,
548
+ "step": 3850
549
+ },
550
+ {
551
+ "epoch": 0.2939624632546921,
552
+ "grad_norm": 0.17624689638614655,
553
+ "learning_rate": 8.015118087680477e-05,
554
+ "loss": 0.4558,
555
+ "step": 3900
556
+ },
557
+ {
558
+ "epoch": 0.2977312127835984,
559
+ "grad_norm": 0.173648402094841,
560
+ "learning_rate": 7.96768313376774e-05,
561
+ "loss": 0.4519,
562
+ "step": 3950
563
+ },
564
+ {
565
+ "epoch": 0.3014999623125047,
566
+ "grad_norm": 0.17087939381599426,
567
+ "learning_rate": 7.919832166999874e-05,
568
+ "loss": 0.454,
569
+ "step": 4000
570
+ },
571
+ {
572
+ "epoch": 0.305268711841411,
573
+ "grad_norm": 0.1744805872440338,
574
+ "learning_rate": 7.871571895174316e-05,
575
+ "loss": 0.4511,
576
+ "step": 4050
577
+ },
578
+ {
579
+ "epoch": 0.30903746137031735,
580
+ "grad_norm": 0.1831275224685669,
581
+ "learning_rate": 7.822909083465298e-05,
582
+ "loss": 0.4537,
583
+ "step": 4100
584
+ },
585
+ {
586
+ "epoch": 0.3128062108992236,
587
+ "grad_norm": 0.17621232569217682,
588
+ "learning_rate": 7.773850553475508e-05,
589
+ "loss": 0.4506,
590
+ "step": 4150
591
+ },
592
+ {
593
+ "epoch": 0.31657496042812994,
594
+ "grad_norm": 0.1809280514717102,
595
+ "learning_rate": 7.724403182279823e-05,
596
+ "loss": 0.4537,
597
+ "step": 4200
598
+ },
599
+ {
600
+ "epoch": 0.32034370995703626,
601
+ "grad_norm": 0.18568743765354156,
602
+ "learning_rate": 7.674573901461282e-05,
603
+ "loss": 0.4484,
604
+ "step": 4250
605
+ },
606
+ {
607
+ "epoch": 0.3241124594859426,
608
+ "grad_norm": 0.17346200346946716,
609
+ "learning_rate": 7.624369696139402e-05,
610
+ "loss": 0.4492,
611
+ "step": 4300
612
+ },
613
+ {
614
+ "epoch": 0.32788120901484885,
615
+ "grad_norm": 0.16987943649291992,
616
+ "learning_rate": 7.573797603991004e-05,
617
+ "loss": 0.4511,
618
+ "step": 4350
619
+ },
620
+ {
621
+ "epoch": 0.3316499585437552,
622
+ "grad_norm": 0.1740700751543045,
623
+ "learning_rate": 7.522864714263655e-05,
624
+ "loss": 0.4504,
625
+ "step": 4400
626
+ },
627
+ {
628
+ "epoch": 0.3354187080726615,
629
+ "grad_norm": 0.18099980056285858,
630
+ "learning_rate": 7.471578166781899e-05,
631
+ "loss": 0.4509,
632
+ "step": 4450
633
+ },
634
+ {
635
+ "epoch": 0.3391874576015678,
636
+ "grad_norm": 0.1742471605539322,
637
+ "learning_rate": 7.419945150946386e-05,
638
+ "loss": 0.4482,
639
+ "step": 4500
640
+ },
641
+ {
642
+ "epoch": 0.3429562071304741,
643
+ "grad_norm": 0.17314079403877258,
644
+ "learning_rate": 7.367972904726055e-05,
645
+ "loss": 0.4497,
646
+ "step": 4550
647
+ },
648
+ {
649
+ "epoch": 0.3467249566593804,
650
+ "grad_norm": 0.1672036498785019,
651
+ "learning_rate": 7.3156687136435e-05,
652
+ "loss": 0.4476,
653
+ "step": 4600
654
+ },
655
+ {
656
+ "epoch": 0.35049370618828674,
657
+ "grad_norm": 0.1716027557849884,
658
+ "learning_rate": 7.26303990975369e-05,
659
+ "loss": 0.4484,
660
+ "step": 4650
661
+ },
662
+ {
663
+ "epoch": 0.35426245571719306,
664
+ "grad_norm": 0.16599993407726288,
665
+ "learning_rate": 7.210093870616155e-05,
666
+ "loss": 0.4478,
667
+ "step": 4700
668
+ },
669
+ {
670
+ "epoch": 0.3580312052460993,
671
+ "grad_norm": 0.16980785131454468,
672
+ "learning_rate": 7.156838018260776e-05,
673
+ "loss": 0.4468,
674
+ "step": 4750
675
+ },
676
+ {
677
+ "epoch": 0.36179995477500565,
678
+ "grad_norm": 0.17415867745876312,
679
+ "learning_rate": 7.103279818147371e-05,
680
+ "loss": 0.4444,
681
+ "step": 4800
682
+ },
683
+ {
684
+ "epoch": 0.365568704303912,
685
+ "grad_norm": 0.17735563218593597,
686
+ "learning_rate": 7.049426778119179e-05,
687
+ "loss": 0.4454,
688
+ "step": 4850
689
+ },
690
+ {
691
+ "epoch": 0.3693374538328183,
692
+ "grad_norm": 0.1772989183664322,
693
+ "learning_rate": 6.995286447350397e-05,
694
+ "loss": 0.4456,
695
+ "step": 4900
696
+ },
697
+ {
698
+ "epoch": 0.37310620336172456,
699
+ "grad_norm": 0.17225749790668488,
700
+ "learning_rate": 6.940866415287931e-05,
701
+ "loss": 0.4453,
702
+ "step": 4950
703
+ },
704
+ {
705
+ "epoch": 0.3768749528906309,
706
+ "grad_norm": 0.16734232008457184,
707
+ "learning_rate": 6.886174310587501e-05,
708
+ "loss": 0.4429,
709
+ "step": 5000
710
+ },
711
+ {
712
+ "epoch": 0.3806437024195372,
713
+ "grad_norm": 0.17711064219474792,
714
+ "learning_rate": 6.831217800044252e-05,
715
+ "loss": 0.4455,
716
+ "step": 5050
717
+ },
718
+ {
719
+ "epoch": 0.3844124519484435,
720
+ "grad_norm": 0.16528938710689545,
721
+ "learning_rate": 6.776004587518001e-05,
722
+ "loss": 0.4452,
723
+ "step": 5100
724
+ },
725
+ {
726
+ "epoch": 0.3881812014773498,
727
+ "grad_norm": 0.16722093522548676,
728
+ "learning_rate": 6.720542412853319e-05,
729
+ "loss": 0.4427,
730
+ "step": 5150
731
+ },
732
+ {
733
+ "epoch": 0.3919499510062561,
734
+ "grad_norm": 0.16517098248004913,
735
+ "learning_rate": 6.66483905079454e-05,
736
+ "loss": 0.4424,
737
+ "step": 5200
738
+ },
739
+ {
740
+ "epoch": 0.39571870053516245,
741
+ "grad_norm": 0.16755063831806183,
742
+ "learning_rate": 6.608902309895895e-05,
743
+ "loss": 0.4405,
744
+ "step": 5250
745
+ },
746
+ {
747
+ "epoch": 0.3994874500640687,
748
+ "grad_norm": 0.1688978523015976,
749
+ "learning_rate": 6.552740031426902e-05,
750
+ "loss": 0.437,
751
+ "step": 5300
752
+ },
753
+ {
754
+ "epoch": 0.40325619959297504,
755
+ "grad_norm": 0.16191639006137848,
756
+ "learning_rate": 6.496360088273161e-05,
757
+ "loss": 0.4405,
758
+ "step": 5350
759
+ },
760
+ {
761
+ "epoch": 0.40702494912188136,
762
+ "grad_norm": 0.1776248961687088,
763
+ "learning_rate": 6.439770383832732e-05,
764
+ "loss": 0.4405,
765
+ "step": 5400
766
+ },
767
+ {
768
+ "epoch": 0.4107936986507877,
769
+ "grad_norm": 0.16206714510917664,
770
+ "learning_rate": 6.382978850908226e-05,
771
+ "loss": 0.44,
772
+ "step": 5450
773
+ },
774
+ {
775
+ "epoch": 0.41456244817969395,
776
+ "grad_norm": 0.16774949431419373,
777
+ "learning_rate": 6.325993450594782e-05,
778
+ "loss": 0.4405,
779
+ "step": 5500
780
+ },
781
+ {
782
+ "epoch": 0.4183311977086003,
783
+ "grad_norm": 0.16804030537605286,
784
+ "learning_rate": 6.26882217116406e-05,
785
+ "loss": 0.4386,
786
+ "step": 5550
787
+ },
788
+ {
789
+ "epoch": 0.4220999472375066,
790
+ "grad_norm": 0.16452039778232574,
791
+ "learning_rate": 6.211473026944452e-05,
792
+ "loss": 0.4369,
793
+ "step": 5600
794
+ },
795
+ {
796
+ "epoch": 0.4258686967664129,
797
+ "grad_norm": 0.15764504671096802,
798
+ "learning_rate": 6.153954057197612e-05,
799
+ "loss": 0.438,
800
+ "step": 5650
801
+ },
802
+ {
803
+ "epoch": 0.4296374462953192,
804
+ "grad_norm": 0.16407234966754913,
805
+ "learning_rate": 6.0962733249915135e-05,
806
+ "loss": 0.4366,
807
+ "step": 5700
808
+ },
809
+ {
810
+ "epoch": 0.4334061958242255,
811
+ "grad_norm": 0.16679194569587708,
812
+ "learning_rate": 6.038438916070155e-05,
813
+ "loss": 0.4381,
814
+ "step": 5750
815
+ },
816
+ {
817
+ "epoch": 0.43717494535313184,
818
+ "grad_norm": 0.16508112847805023,
819
+ "learning_rate": 5.9804589377200946e-05,
820
+ "loss": 0.4369,
821
+ "step": 5800
822
+ },
823
+ {
824
+ "epoch": 0.44094369488203816,
825
+ "grad_norm": 0.16879412531852722,
826
+ "learning_rate": 5.922341517633965e-05,
827
+ "loss": 0.4382,
828
+ "step": 5850
829
+ },
830
+ {
831
+ "epoch": 0.44471244441094443,
832
+ "grad_norm": 0.16117092967033386,
833
+ "learning_rate": 5.864094802771115e-05,
834
+ "loss": 0.4348,
835
+ "step": 5900
836
+ },
837
+ {
838
+ "epoch": 0.44848119393985075,
839
+ "grad_norm": 0.1632978767156601,
840
+ "learning_rate": 5.8057269582155735e-05,
841
+ "loss": 0.4371,
842
+ "step": 5950
843
+ },
844
+ {
845
+ "epoch": 0.4522499434687571,
846
+ "grad_norm": 0.16430360078811646,
847
+ "learning_rate": 5.7472461660314504e-05,
848
+ "loss": 0.435,
849
+ "step": 6000
850
+ },
851
+ {
852
+ "epoch": 0.4560186929976634,
853
+ "grad_norm": 0.16830819845199585,
854
+ "learning_rate": 5.6886606241159714e-05,
855
+ "loss": 0.4337,
856
+ "step": 6050
857
+ },
858
+ {
859
+ "epoch": 0.45978744252656967,
860
+ "grad_norm": 0.16006672382354736,
861
+ "learning_rate": 5.6299785450502853e-05,
862
+ "loss": 0.4336,
863
+ "step": 6100
864
+ },
865
+ {
866
+ "epoch": 0.463556192055476,
867
+ "grad_norm": 0.16786810755729675,
868
+ "learning_rate": 5.571208154948218e-05,
869
+ "loss": 0.4335,
870
+ "step": 6150
871
+ },
872
+ {
873
+ "epoch": 0.4673249415843823,
874
+ "grad_norm": 0.16502316296100616,
875
+ "learning_rate": 5.5123576923031253e-05,
876
+ "loss": 0.433,
877
+ "step": 6200
878
+ },
879
+ {
880
+ "epoch": 0.47109369111328864,
881
+ "grad_norm": 0.16036230325698853,
882
+ "learning_rate": 5.453435406833017e-05,
883
+ "loss": 0.4296,
884
+ "step": 6250
885
+ },
886
+ {
887
+ "epoch": 0.4748624406421949,
888
+ "grad_norm": 0.16277125477790833,
889
+ "learning_rate": 5.3944495583240987e-05,
890
+ "loss": 0.4349,
891
+ "step": 6300
892
+ },
893
+ {
894
+ "epoch": 0.47863119017110123,
895
+ "grad_norm": 0.1639643758535385,
896
+ "learning_rate": 5.3354084154729034e-05,
897
+ "loss": 0.4311,
898
+ "step": 6350
899
+ },
900
+ {
901
+ "epoch": 0.48239993970000755,
902
+ "grad_norm": 0.1611129492521286,
903
+ "learning_rate": 5.276320254727187e-05,
904
+ "loss": 0.4315,
905
+ "step": 6400
906
+ },
907
+ {
908
+ "epoch": 0.4861686892289138,
909
+ "grad_norm": 0.1649327427148819,
910
+ "learning_rate": 5.217193359125724e-05,
911
+ "loss": 0.433,
912
+ "step": 6450
913
+ },
914
+ {
915
+ "epoch": 0.48993743875782014,
916
+ "grad_norm": 0.16595204174518585,
917
+ "learning_rate": 5.15803601713717e-05,
918
+ "loss": 0.432,
919
+ "step": 6500
920
+ },
921
+ {
922
+ "epoch": 0.49370618828672647,
923
+ "grad_norm": 0.16455797851085663,
924
+ "learning_rate": 5.0988565214981976e-05,
925
+ "loss": 0.4291,
926
+ "step": 6550
927
+ },
928
+ {
929
+ "epoch": 0.4974749378156328,
930
+ "grad_norm": 0.16371013224124908,
931
+ "learning_rate": 5.0396631680509945e-05,
932
+ "loss": 0.4299,
933
+ "step": 6600
934
+ },
935
+ {
936
+ "epoch": 0.5012436873445391,
937
+ "grad_norm": 0.16786278784275055,
938
+ "learning_rate": 4.9804642545803524e-05,
939
+ "loss": 0.43,
940
+ "step": 6650
941
+ },
942
+ {
943
+ "epoch": 0.5050124368734454,
944
+ "grad_norm": 0.16633006930351257,
945
+ "learning_rate": 4.9212680796504704e-05,
946
+ "loss": 0.4289,
947
+ "step": 6700
948
+ },
949
+ {
950
+ "epoch": 0.5087811864023517,
951
+ "grad_norm": 0.1592586487531662,
952
+ "learning_rate": 4.8620829414416615e-05,
953
+ "loss": 0.4296,
954
+ "step": 6750
955
+ },
956
+ {
957
+ "epoch": 0.512549935931258,
958
+ "grad_norm": 0.16653411090373993,
959
+ "learning_rate": 4.8029171365870926e-05,
960
+ "loss": 0.4282,
961
+ "step": 6800
962
+ },
963
+ {
964
+ "epoch": 0.5163186854601644,
965
+ "grad_norm": 0.16303293406963348,
966
+ "learning_rate": 4.743778959009766e-05,
967
+ "loss": 0.4267,
968
+ "step": 6850
969
+ },
970
+ {
971
+ "epoch": 0.5200874349890706,
972
+ "grad_norm": 0.1592382937669754,
973
+ "learning_rate": 4.684676698759864e-05,
974
+ "loss": 0.4268,
975
+ "step": 6900
976
+ },
977
+ {
978
+ "epoch": 0.5238561845179769,
979
+ "grad_norm": 0.15816909074783325,
980
+ "learning_rate": 4.62561864085264e-05,
981
+ "loss": 0.4261,
982
+ "step": 6950
983
+ },
984
+ {
985
+ "epoch": 0.5276249340468833,
986
+ "grad_norm": 0.1695041060447693,
987
+ "learning_rate": 4.566613064107015e-05,
988
+ "loss": 0.427,
989
+ "step": 7000
990
+ },
991
+ {
992
+ "epoch": 0.5313936835757895,
993
+ "grad_norm": 0.16515901684761047,
994
+ "learning_rate": 4.507668239985055e-05,
995
+ "loss": 0.4263,
996
+ "step": 7050
997
+ },
998
+ {
999
+ "epoch": 0.5351624331046959,
1000
+ "grad_norm": 0.15738603472709656,
1001
+ "learning_rate": 4.448792431432451e-05,
1002
+ "loss": 0.4277,
1003
+ "step": 7100
1004
+ },
1005
+ {
1006
+ "epoch": 0.5389311826336022,
1007
+ "grad_norm": 0.17032016813755035,
1008
+ "learning_rate": 4.389993891720232e-05,
1009
+ "loss": 0.4262,
1010
+ "step": 7150
1011
+ },
1012
+ {
1013
+ "epoch": 0.5426999321625084,
1014
+ "grad_norm": 0.1652156412601471,
1015
+ "learning_rate": 4.3312808632877924e-05,
1016
+ "loss": 0.4228,
1017
+ "step": 7200
1018
+ },
1019
+ {
1020
+ "epoch": 0.5464686816914148,
1021
+ "grad_norm": 0.161549910902977,
1022
+ "learning_rate": 4.27266157658747e-05,
1023
+ "loss": 0.4231,
1024
+ "step": 7250
1025
+ },
1026
+ {
1027
+ "epoch": 0.5502374312203211,
1028
+ "grad_norm": 0.15818439424037933,
1029
+ "learning_rate": 4.214144248930797e-05,
1030
+ "loss": 0.4238,
1031
+ "step": 7300
1032
+ },
1033
+ {
1034
+ "epoch": 0.5540061807492274,
1035
+ "grad_norm": 0.15689703822135925,
1036
+ "learning_rate": 4.155737083336575e-05,
1037
+ "loss": 0.4242,
1038
+ "step": 7350
1039
+ },
1040
+ {
1041
+ "epoch": 0.5577749302781337,
1042
+ "grad_norm": 0.16835862398147583,
1043
+ "learning_rate": 4.097448267380979e-05,
1044
+ "loss": 0.4246,
1045
+ "step": 7400
1046
+ },
1047
+ {
1048
+ "epoch": 0.56154367980704,
1049
+ "grad_norm": 0.162080317735672,
1050
+ "learning_rate": 4.03928597204981e-05,
1051
+ "loss": 0.4204,
1052
+ "step": 7450
1053
+ },
1054
+ {
1055
+ "epoch": 0.5653124293359464,
1056
+ "grad_norm": 0.16594427824020386,
1057
+ "learning_rate": 3.9812583505930786e-05,
1058
+ "loss": 0.4236,
1059
+ "step": 7500
1060
+ },
1061
+ {
1062
+ "epoch": 0.5690811788648527,
1063
+ "grad_norm": 0.1567797213792801,
1064
+ "learning_rate": 3.923373537382074e-05,
1065
+ "loss": 0.422,
1066
+ "step": 7550
1067
+ },
1068
+ {
1069
+ "epoch": 0.5728499283937589,
1070
+ "grad_norm": 0.1608632504940033,
1071
+ "learning_rate": 3.86563964676908e-05,
1072
+ "loss": 0.4213,
1073
+ "step": 7600
1074
+ },
1075
+ {
1076
+ "epoch": 0.5766186779226653,
1077
+ "grad_norm": 0.16220742464065552,
1078
+ "learning_rate": 3.808064771949893e-05,
1079
+ "loss": 0.4208,
1080
+ "step": 7650
1081
+ },
1082
+ {
1083
+ "epoch": 0.5803874274515716,
1084
+ "grad_norm": 0.16180914640426636,
1085
+ "learning_rate": 3.75065698382932e-05,
1086
+ "loss": 0.4213,
1087
+ "step": 7700
1088
+ },
1089
+ {
1090
+ "epoch": 0.5841561769804778,
1091
+ "grad_norm": 0.17086252570152283,
1092
+ "learning_rate": 3.693424329889776e-05,
1093
+ "loss": 0.4209,
1094
+ "step": 7750
1095
+ },
1096
+ {
1097
+ "epoch": 0.5879249265093842,
1098
+ "grad_norm": 0.1601138710975647,
1099
+ "learning_rate": 3.636374833063191e-05,
1100
+ "loss": 0.4206,
1101
+ "step": 7800
1102
+ },
1103
+ {
1104
+ "epoch": 0.5916936760382905,
1105
+ "grad_norm": 0.15639857947826385,
1106
+ "learning_rate": 3.579516490606346e-05,
1107
+ "loss": 0.4191,
1108
+ "step": 7850
1109
+ },
1110
+ {
1111
+ "epoch": 0.5954624255671968,
1112
+ "grad_norm": 0.16204357147216797,
1113
+ "learning_rate": 3.522857272979804e-05,
1114
+ "loss": 0.4185,
1115
+ "step": 7900
1116
+ },
1117
+ {
1118
+ "epoch": 0.5992311750961031,
1119
+ "grad_norm": 0.1710115373134613,
1120
+ "learning_rate": 3.4664051227306026e-05,
1121
+ "loss": 0.4178,
1122
+ "step": 7950
1123
+ },
1124
+ {
1125
+ "epoch": 0.6029999246250094,
1126
+ "grad_norm": 0.15990346670150757,
1127
+ "learning_rate": 3.4101679533788734e-05,
1128
+ "loss": 0.4161,
1129
+ "step": 8000
1130
+ },
1131
+ {
1132
+ "epoch": 0.6067686741539158,
1133
+ "grad_norm": 0.15846975147724152,
1134
+ "learning_rate": 3.354153648308492e-05,
1135
+ "loss": 0.4168,
1136
+ "step": 8050
1137
+ },
1138
+ {
1139
+ "epoch": 0.610537423682822,
1140
+ "grad_norm": 0.15800924599170685,
1141
+ "learning_rate": 3.298370059662004e-05,
1142
+ "loss": 0.4165,
1143
+ "step": 8100
1144
+ },
1145
+ {
1146
+ "epoch": 0.6143061732117283,
1147
+ "grad_norm": 0.1673530787229538,
1148
+ "learning_rate": 3.2428250072398846e-05,
1149
+ "loss": 0.4164,
1150
+ "step": 8150
1151
+ },
1152
+ {
1153
+ "epoch": 0.6180749227406347,
1154
+ "grad_norm": 0.16620007157325745,
1155
+ "learning_rate": 3.187526277404355e-05,
1156
+ "loss": 0.4193,
1157
+ "step": 8200
1158
+ },
1159
+ {
1160
+ "epoch": 0.621843672269541,
1161
+ "grad_norm": 0.1582447588443756,
1162
+ "learning_rate": 3.1324816219878903e-05,
1163
+ "loss": 0.416,
1164
+ "step": 8250
1165
+ },
1166
+ {
1167
+ "epoch": 0.6256124217984472,
1168
+ "grad_norm": 0.16663286089897156,
1169
+ "learning_rate": 3.077698757206552e-05,
1170
+ "loss": 0.4172,
1171
+ "step": 8300
1172
+ },
1173
+ {
1174
+ "epoch": 0.6293811713273536,
1175
+ "grad_norm": 0.16307072341442108,
1176
+ "learning_rate": 3.0231853625783163e-05,
1177
+ "loss": 0.4145,
1178
+ "step": 8350
1179
+ },
1180
+ {
1181
+ "epoch": 0.6331499208562599,
1182
+ "grad_norm": 0.1569572240114212,
1183
+ "learning_rate": 2.9689490798465698e-05,
1184
+ "loss": 0.4146,
1185
+ "step": 8400
1186
+ },
1187
+ {
1188
+ "epoch": 0.6369186703851663,
1189
+ "grad_norm": 0.1609562188386917,
1190
+ "learning_rate": 2.9149975119088596e-05,
1191
+ "loss": 0.4146,
1192
+ "step": 8450
1193
+ },
1194
+ {
1195
+ "epoch": 0.6406874199140725,
1196
+ "grad_norm": 0.15904489159584045,
1197
+ "learning_rate": 2.8613382217511265e-05,
1198
+ "loss": 0.4125,
1199
+ "step": 8500
1200
+ },
1201
+ {
1202
+ "epoch": 0.6444561694429788,
1203
+ "grad_norm": 0.16079629957675934,
1204
+ "learning_rate": 2.807978731387516e-05,
1205
+ "loss": 0.4151,
1206
+ "step": 8550
1207
+ },
1208
+ {
1209
+ "epoch": 0.6482249189718852,
1210
+ "grad_norm": 0.16790254414081573,
1211
+ "learning_rate": 2.754926520805925e-05,
1212
+ "loss": 0.4141,
1213
+ "step": 8600
1214
+ },
1215
+ {
1216
+ "epoch": 0.6519936685007914,
1217
+ "grad_norm": 0.16292473673820496,
1218
+ "learning_rate": 2.702189026919465e-05,
1219
+ "loss": 0.4143,
1220
+ "step": 8650
1221
+ },
1222
+ {
1223
+ "epoch": 0.6557624180296977,
1224
+ "grad_norm": 0.16475141048431396,
1225
+ "learning_rate": 2.6497736425239315e-05,
1226
+ "loss": 0.4129,
1227
+ "step": 8700
1228
+ },
1229
+ {
1230
+ "epoch": 0.6595311675586041,
1231
+ "grad_norm": 0.1627720594406128,
1232
+ "learning_rate": 2.597687715261484e-05,
1233
+ "loss": 0.4127,
1234
+ "step": 8750
1235
+ },
1236
+ {
1237
+ "epoch": 0.6632999170875103,
1238
+ "grad_norm": 0.1639036387205124,
1239
+ "learning_rate": 2.5459385465906517e-05,
1240
+ "loss": 0.4121,
1241
+ "step": 8800
1242
+ },
1243
+ {
1244
+ "epoch": 0.6670686666164167,
1245
+ "grad_norm": 0.16833463311195374,
1246
+ "learning_rate": 2.4945333907627892e-05,
1247
+ "loss": 0.4129,
1248
+ "step": 8850
1249
+ },
1250
+ {
1251
+ "epoch": 0.670837416145323,
1252
+ "grad_norm": 0.15790612995624542,
1253
+ "learning_rate": 2.443479453805189e-05,
1254
+ "loss": 0.4098,
1255
+ "step": 8900
1256
+ },
1257
+ {
1258
+ "epoch": 0.6746061656742293,
1259
+ "grad_norm": 0.16387607157230377,
1260
+ "learning_rate": 2.392783892510917e-05,
1261
+ "loss": 0.411,
1262
+ "step": 8950
1263
+ },
1264
+ {
1265
+ "epoch": 0.6783749152031356,
1266
+ "grad_norm": 0.16562491655349731,
1267
+ "learning_rate": 2.3424538134355715e-05,
1268
+ "loss": 0.4122,
1269
+ "step": 9000
1270
+ },
1271
+ {
1272
+ "epoch": 0.6821436647320419,
1273
+ "grad_norm": 0.15516149997711182,
1274
+ "learning_rate": 2.2924962719010874e-05,
1275
+ "loss": 0.4112,
1276
+ "step": 9050
1277
+ },
1278
+ {
1279
+ "epoch": 0.6859124142609482,
1280
+ "grad_norm": 0.16322891414165497,
1281
+ "learning_rate": 2.242918271006698e-05,
1282
+ "loss": 0.4109,
1283
+ "step": 9100
1284
+ },
1285
+ {
1286
+ "epoch": 0.6896811637898546,
1287
+ "grad_norm": 0.16053235530853271,
1288
+ "learning_rate": 2.193726760647245e-05,
1289
+ "loss": 0.4088,
1290
+ "step": 9150
1291
+ },
1292
+ {
1293
+ "epoch": 0.6934499133187608,
1294
+ "grad_norm": 0.1649434119462967,
1295
+ "learning_rate": 2.1449286365389342e-05,
1296
+ "loss": 0.4103,
1297
+ "step": 9200
1298
+ },
1299
+ {
1300
+ "epoch": 0.6972186628476671,
1301
+ "grad_norm": 0.1640276312828064,
1302
+ "learning_rate": 2.0965307392526818e-05,
1303
+ "loss": 0.409,
1304
+ "step": 9250
1305
+ },
1306
+ {
1307
+ "epoch": 0.7009874123765735,
1308
+ "grad_norm": 0.1616964489221573,
1309
+ "learning_rate": 2.048539853255197e-05,
1310
+ "loss": 0.4105,
1311
+ "step": 9300
1312
+ },
1313
+ {
1314
+ "epoch": 0.7047561619054797,
1315
+ "grad_norm": 0.1595754474401474,
1316
+ "learning_rate": 2.0009627059579372e-05,
1317
+ "loss": 0.4108,
1318
+ "step": 9350
1319
+ },
1320
+ {
1321
+ "epoch": 0.7085249114343861,
1322
+ "grad_norm": 0.1613272726535797,
1323
+ "learning_rate": 1.953805966774037e-05,
1324
+ "loss": 0.4114,
1325
+ "step": 9400
1326
+ },
1327
+ {
1328
+ "epoch": 0.7122936609632924,
1329
+ "grad_norm": 0.15698370337486267,
1330
+ "learning_rate": 1.9070762461834018e-05,
1331
+ "loss": 0.4087,
1332
+ "step": 9450
1333
+ },
1334
+ {
1335
+ "epoch": 0.7160624104921987,
1336
+ "grad_norm": 0.17342697083950043,
1337
+ "learning_rate": 1.8607800948060266e-05,
1338
+ "loss": 0.4072,
1339
+ "step": 9500
1340
+ },
1341
+ {
1342
+ "epoch": 0.719831160021105,
1343
+ "grad_norm": 0.16098545491695404,
1344
+ "learning_rate": 1.8149240024837315e-05,
1345
+ "loss": 0.4071,
1346
+ "step": 9550
1347
+ },
1348
+ {
1349
+ "epoch": 0.7235999095500113,
1350
+ "grad_norm": 0.16427302360534668,
1351
+ "learning_rate": 1.7695143973704143e-05,
1352
+ "loss": 0.4067,
1353
+ "step": 9600
1354
+ },
1355
+ {
1356
+ "epoch": 0.7273686590789176,
1357
+ "grad_norm": 0.1618986576795578,
1358
+ "learning_rate": 1.7245576450309316e-05,
1359
+ "loss": 0.4081,
1360
+ "step": 9650
1361
+ },
1362
+ {
1363
+ "epoch": 0.731137408607824,
1364
+ "grad_norm": 0.15955495834350586,
1365
+ "learning_rate": 1.6800600475487826e-05,
1366
+ "loss": 0.4085,
1367
+ "step": 9700
1368
+ },
1369
+ {
1370
+ "epoch": 0.7349061581367302,
1371
+ "grad_norm": 0.159365713596344,
1372
+ "learning_rate": 1.6360278426426624e-05,
1373
+ "loss": 0.4069,
1374
+ "step": 9750
1375
+ },
1376
+ {
1377
+ "epoch": 0.7386749076656366,
1378
+ "grad_norm": 0.1574493795633316,
1379
+ "learning_rate": 1.5924672027920663e-05,
1380
+ "loss": 0.4058,
1381
+ "step": 9800
1382
+ },
1383
+ {
1384
+ "epoch": 0.7424436571945429,
1385
+ "grad_norm": 0.16413567960262299,
1386
+ "learning_rate": 1.5493842343720104e-05,
1387
+ "loss": 0.4047,
1388
+ "step": 9850
1389
+ },
1390
+ {
1391
+ "epoch": 0.7462124067234491,
1392
+ "grad_norm": 0.1662568747997284,
1393
+ "learning_rate": 1.5067849767970488e-05,
1394
+ "loss": 0.4046,
1395
+ "step": 9900
1396
+ },
1397
+ {
1398
+ "epoch": 0.7499811562523555,
1399
+ "grad_norm": 0.16023589670658112,
1400
+ "learning_rate": 1.4646754016746483e-05,
1401
+ "loss": 0.4072,
1402
+ "step": 9950
1403
+ },
1404
+ {
1405
+ "epoch": 0.7537499057812618,
1406
+ "grad_norm": 0.16238714754581451,
1407
+ "learning_rate": 1.4230614119680957e-05,
1408
+ "loss": 0.4072,
1409
+ "step": 10000
1410
+ },
1411
+ {
1412
+ "epoch": 0.757518655310168,
1413
+ "grad_norm": 0.16267696022987366,
1414
+ "learning_rate": 1.3819488411690018e-05,
1415
+ "loss": 0.4056,
1416
+ "step": 10050
1417
+ },
1418
+ {
1419
+ "epoch": 0.7612874048390744,
1420
+ "grad_norm": 0.1596570760011673,
1421
+ "learning_rate": 1.3413434524795631e-05,
1422
+ "loss": 0.4049,
1423
+ "step": 10100
1424
+ },
1425
+ {
1426
+ "epoch": 0.7650561543679807,
1427
+ "grad_norm": 0.17054887115955353,
1428
+ "learning_rate": 1.3012509380046745e-05,
1429
+ "loss": 0.4032,
1430
+ "step": 10150
1431
+ },
1432
+ {
1433
+ "epoch": 0.768824903896887,
1434
+ "grad_norm": 0.15980112552642822,
1435
+ "learning_rate": 1.2616769179539944e-05,
1436
+ "loss": 0.405,
1437
+ "step": 10200
1438
+ },
1439
+ {
1440
+ "epoch": 0.7725936534257933,
1441
+ "grad_norm": 0.16071230173110962,
1442
+ "learning_rate": 1.222626939854103e-05,
1443
+ "loss": 0.4027,
1444
+ "step": 10250
1445
+ },
1446
+ {
1447
+ "epoch": 0.7763624029546996,
1448
+ "grad_norm": 0.15903015434741974,
1449
+ "learning_rate": 1.1841064777708483e-05,
1450
+ "loss": 0.4043,
1451
+ "step": 10300
1452
+ },
1453
+ {
1454
+ "epoch": 0.780131152483606,
1455
+ "grad_norm": 0.16393496096134186,
1456
+ "learning_rate": 1.1461209315419758e-05,
1457
+ "loss": 0.4009,
1458
+ "step": 10350
1459
+ },
1460
+ {
1461
+ "epoch": 0.7838999020125123,
1462
+ "grad_norm": 0.16215142607688904,
1463
+ "learning_rate": 1.1086756260201859e-05,
1464
+ "loss": 0.4032,
1465
+ "step": 10400
1466
+ },
1467
+ {
1468
+ "epoch": 0.7876686515414185,
1469
+ "grad_norm": 0.16436554491519928,
1470
+ "learning_rate": 1.0717758103266805e-05,
1471
+ "loss": 0.4035,
1472
+ "step": 10450
1473
+ },
1474
+ {
1475
+ "epoch": 0.7914374010703249,
1476
+ "grad_norm": 0.16526173055171967,
1477
+ "learning_rate": 1.0354266571153399e-05,
1478
+ "loss": 0.4023,
1479
+ "step": 10500
1480
+ },
1481
+ {
1482
+ "epoch": 0.7952061505992312,
1483
+ "grad_norm": 0.1610834300518036,
1484
+ "learning_rate": 9.996332618476172e-06,
1485
+ "loss": 0.4031,
1486
+ "step": 10550
1487
+ },
1488
+ {
1489
+ "epoch": 0.7989749001281374,
1490
+ "grad_norm": 0.1577410101890564,
1491
+ "learning_rate": 9.644006420782476e-06,
1492
+ "loss": 0.4006,
1493
+ "step": 10600
1494
+ },
1495
+ {
1496
+ "epoch": 0.8027436496570438,
1497
+ "grad_norm": 0.15618577599525452,
1498
+ "learning_rate": 9.29733736751881e-06,
1499
+ "loss": 0.4037,
1500
+ "step": 10650
1501
+ },
1502
+ {
1503
+ "epoch": 0.8065123991859501,
1504
+ "grad_norm": 0.15943607687950134,
1505
+ "learning_rate": 8.956374055107442e-06,
1506
+ "loss": 0.4026,
1507
+ "step": 10700
1508
+ },
1509
+ {
1510
+ "epoch": 0.8102811487148565,
1511
+ "grad_norm": 0.1561410278081894,
1512
+ "learning_rate": 8.621164280134004e-06,
1513
+ "loss": 0.4021,
1514
+ "step": 10750
1515
+ },
1516
+ {
1517
+ "epoch": 0.8140498982437627,
1518
+ "grad_norm": 0.166486918926239,
1519
+ "learning_rate": 8.291755032647402e-06,
1520
+ "loss": 0.4017,
1521
+ "step": 10800
1522
+ },
1523
+ {
1524
+ "epoch": 0.817818647772669,
1525
+ "grad_norm": 0.16270950436592102,
1526
+ "learning_rate": 7.96819248957265e-06,
1527
+ "loss": 0.4019,
1528
+ "step": 10850
1529
+ },
1530
+ {
1531
+ "epoch": 0.8215873973015754,
1532
+ "grad_norm": 0.1590346395969391,
1533
+ "learning_rate": 7.650522008237754e-06,
1534
+ "loss": 0.4014,
1535
+ "step": 10900
1536
+ },
1537
+ {
1538
+ "epoch": 0.8253561468304816,
1539
+ "grad_norm": 0.15762105584144592,
1540
+ "learning_rate": 7.338788120015522e-06,
1541
+ "loss": 0.4005,
1542
+ "step": 10950
1543
+ },
1544
+ {
1545
+ "epoch": 0.8291248963593879,
1546
+ "grad_norm": 0.1578063815832138,
1547
+ "learning_rate": 7.033034524081023e-06,
1548
+ "loss": 0.4008,
1549
+ "step": 11000
1550
+ },
1551
+ {
1552
+ "epoch": 0.8328936458882943,
1553
+ "grad_norm": 0.1597341001033783,
1554
+ "learning_rate": 6.733304081285874e-06,
1555
+ "loss": 0.4005,
1556
+ "step": 11050
1557
+ },
1558
+ {
1559
+ "epoch": 0.8366623954172006,
1560
+ "grad_norm": 0.16171535849571228,
1561
+ "learning_rate": 6.439638808149923e-06,
1562
+ "loss": 0.4018,
1563
+ "step": 11100
1564
+ },
1565
+ {
1566
+ "epoch": 0.8404311449461069,
1567
+ "grad_norm": 0.16193453967571259,
1568
+ "learning_rate": 6.152079870971311e-06,
1569
+ "loss": 0.3993,
1570
+ "step": 11150
1571
+ },
1572
+ {
1573
+ "epoch": 0.8441998944750132,
1574
+ "grad_norm": 0.15683096647262573,
1575
+ "learning_rate": 5.870667580055805e-06,
1576
+ "loss": 0.4014,
1577
+ "step": 11200
1578
+ },
1579
+ {
1580
+ "epoch": 0.8479686440039195,
1581
+ "grad_norm": 0.16238045692443848,
1582
+ "learning_rate": 5.595441384065986e-06,
1583
+ "loss": 0.402,
1584
+ "step": 11250
1585
+ },
1586
+ {
1587
+ "epoch": 0.8517373935328258,
1588
+ "grad_norm": 0.15774257481098175,
1589
+ "learning_rate": 5.3264398644913114e-06,
1590
+ "loss": 0.4,
1591
+ "step": 11300
1592
+ },
1593
+ {
1594
+ "epoch": 0.8555061430617321,
1595
+ "grad_norm": 0.15233269333839417,
1596
+ "learning_rate": 5.063700730239784e-06,
1597
+ "loss": 0.3994,
1598
+ "step": 11350
1599
+ },
1600
+ {
1601
+ "epoch": 0.8592748925906384,
1602
+ "grad_norm": 0.16699600219726562,
1603
+ "learning_rate": 4.807260812351793e-06,
1604
+ "loss": 0.399,
1605
+ "step": 11400
1606
+ },
1607
+ {
1608
+ "epoch": 0.8630436421195448,
1609
+ "grad_norm": 0.1617075353860855,
1610
+ "learning_rate": 4.557156058837137e-06,
1611
+ "loss": 0.3988,
1612
+ "step": 11450
1613
+ },
1614
+ {
1615
+ "epoch": 0.866812391648451,
1616
+ "grad_norm": 0.1602969914674759,
1617
+ "learning_rate": 4.31342152963583e-06,
1618
+ "loss": 0.3999,
1619
+ "step": 11500
1620
+ },
1621
+ {
1622
+ "epoch": 0.8705811411773573,
1623
+ "grad_norm": 0.15863758325576782,
1624
+ "learning_rate": 4.076091391703302e-06,
1625
+ "loss": 0.3999,
1626
+ "step": 11550
1627
+ },
1628
+ {
1629
+ "epoch": 0.8743498907062637,
1630
+ "grad_norm": 0.1571153998374939,
1631
+ "learning_rate": 3.845198914220871e-06,
1632
+ "loss": 0.3984,
1633
+ "step": 11600
1634
+ },
1635
+ {
1636
+ "epoch": 0.87811864023517,
1637
+ "grad_norm": 0.15634584426879883,
1638
+ "learning_rate": 3.6207764639320462e-06,
1639
+ "loss": 0.3989,
1640
+ "step": 11650
1641
+ },
1642
+ {
1643
+ "epoch": 0.8818873897640763,
1644
+ "grad_norm": 0.16058678925037384,
1645
+ "learning_rate": 3.4028555006052953e-06,
1646
+ "loss": 0.4015,
1647
+ "step": 11700
1648
+ },
1649
+ {
1650
+ "epoch": 0.8856561392929826,
1651
+ "grad_norm": 0.15872234106063843,
1652
+ "learning_rate": 3.191466572624019e-06,
1653
+ "loss": 0.3979,
1654
+ "step": 11750
1655
+ },
1656
+ {
1657
+ "epoch": 0.8894248888218889,
1658
+ "grad_norm": 0.16169828176498413,
1659
+ "learning_rate": 2.986639312704209e-06,
1660
+ "loss": 0.3984,
1661
+ "step": 11800
1662
+ },
1663
+ {
1664
+ "epoch": 0.8931936383507952,
1665
+ "grad_norm": 0.16279493272304535,
1666
+ "learning_rate": 2.788402433740517e-06,
1667
+ "loss": 0.3982,
1668
+ "step": 11850
1669
+ },
1670
+ {
1671
+ "epoch": 0.8969623878797015,
1672
+ "grad_norm": 0.1638520359992981,
1673
+ "learning_rate": 2.596783724781282e-06,
1674
+ "loss": 0.4002,
1675
+ "step": 11900
1676
+ },
1677
+ {
1678
+ "epoch": 0.9007311374086078,
1679
+ "grad_norm": 0.15517061948776245,
1680
+ "learning_rate": 2.4118100471329787e-06,
1681
+ "loss": 0.3974,
1682
+ "step": 11950
1683
+ },
1684
+ {
1685
+ "epoch": 0.9044998869375142,
1686
+ "grad_norm": 0.1604815125465393,
1687
+ "learning_rate": 2.2335073305948086e-06,
1688
+ "loss": 0.3992,
1689
+ "step": 12000
1690
+ },
1691
+ {
1692
+ "epoch": 0.9082686364664204,
1693
+ "grad_norm": 0.157390296459198,
1694
+ "learning_rate": 2.0619005698238437e-06,
1695
+ "loss": 0.3989,
1696
+ "step": 12050
1697
+ },
1698
+ {
1699
+ "epoch": 0.9120373859953268,
1700
+ "grad_norm": 0.15608523786067963,
1701
+ "learning_rate": 1.8970138208311949e-06,
1702
+ "loss": 0.3971,
1703
+ "step": 12100
1704
+ },
1705
+ {
1706
+ "epoch": 0.9158061355242331,
1707
+ "grad_norm": 0.15673068165779114,
1708
+ "learning_rate": 1.7388701976099041e-06,
1709
+ "loss": 0.3994,
1710
+ "step": 12150
1711
+ },
1712
+ {
1713
+ "epoch": 0.9195748850531393,
1714
+ "grad_norm": 0.1587488353252411,
1715
+ "learning_rate": 1.5874918688946972e-06,
1716
+ "loss": 0.3985,
1717
+ "step": 12200
1718
+ },
1719
+ {
1720
+ "epoch": 0.9233436345820457,
1721
+ "grad_norm": 0.16035687923431396,
1722
+ "learning_rate": 1.4429000550544414e-06,
1723
+ "loss": 0.399,
1724
+ "step": 12250
1725
+ },
1726
+ {
1727
+ "epoch": 0.927112384110952,
1728
+ "grad_norm": 0.15816493332386017,
1729
+ "learning_rate": 1.305115025117387e-06,
1730
+ "loss": 0.4,
1731
+ "step": 12300
1732
+ },
1733
+ {
1734
+ "epoch": 0.9308811336398582,
1735
+ "grad_norm": 0.16530562937259674,
1736
+ "learning_rate": 1.1741560939298791e-06,
1737
+ "loss": 0.3995,
1738
+ "step": 12350
1739
+ },
1740
+ {
1741
+ "epoch": 0.9346498831687646,
1742
+ "grad_norm": 0.1594778597354889,
1743
+ "learning_rate": 1.0500416194487384e-06,
1744
+ "loss": 0.3997,
1745
+ "step": 12400
1746
+ },
1747
+ {
1748
+ "epoch": 0.9384186326976709,
1749
+ "grad_norm": 0.15754447877407074,
1750
+ "learning_rate": 9.327890001678719e-07,
1751
+ "loss": 0.3972,
1752
+ "step": 12450
1753
+ },
1754
+ {
1755
+ "epoch": 0.9421873822265773,
1756
+ "grad_norm": 0.15905898809432983,
1757
+ "learning_rate": 8.224146726792947e-07,
1758
+ "loss": 0.3972,
1759
+ "step": 12500
1760
+ },
1761
+ {
1762
+ "epoch": 0.9459561317554835,
1763
+ "grad_norm": 0.15947633981704712,
1764
+ "learning_rate": 7.189341093690627e-07,
1765
+ "loss": 0.3964,
1766
+ "step": 12550
1767
+ },
1768
+ {
1769
+ "epoch": 0.9497248812843898,
1770
+ "grad_norm": 0.16022710502147675,
1771
+ "learning_rate": 6.223618162483014e-07,
1772
+ "loss": 0.3993,
1773
+ "step": 12600
1774
+ },
1775
+ {
1776
+ "epoch": 0.9534936308132962,
1777
+ "grad_norm": 0.16380661725997925,
1778
+ "learning_rate": 5.327113309197828e-07,
1779
+ "loss": 0.4,
1780
+ "step": 12650
1781
+ },
1782
+ {
1783
+ "epoch": 0.9572623803422025,
1784
+ "grad_norm": 0.15692880749702454,
1785
+ "learning_rate": 4.4999522068017164e-07,
1786
+ "loss": 0.3982,
1787
+ "step": 12700
1788
+ },
1789
+ {
1790
+ "epoch": 0.9610311298711087,
1791
+ "grad_norm": 0.16599752008914948,
1792
+ "learning_rate": 3.7422508075835583e-07,
1793
+ "loss": 0.397,
1794
+ "step": 12750
1795
+ },
1796
+ {
1797
+ "epoch": 0.9647998794000151,
1798
+ "grad_norm": 0.15927733480930328,
1799
+ "learning_rate": 3.05411532689992e-07,
1800
+ "loss": 0.396,
1801
+ "step": 12800
1802
+ },
1803
+ {
1804
+ "epoch": 0.9685686289289214,
1805
+ "grad_norm": 0.15940117835998535,
1806
+ "learning_rate": 2.435642228285906e-07,
1807
+ "loss": 0.3983,
1808
+ "step": 12850
1809
+ },
1810
+ {
1811
+ "epoch": 0.9723373784578276,
1812
+ "grad_norm": 0.16387763619422913,
1813
+ "learning_rate": 1.886918209932642e-07,
1814
+ "loss": 0.398,
1815
+ "step": 12900
1816
+ },
1817
+ {
1818
+ "epoch": 0.976106127986734,
1819
+ "grad_norm": 0.15747365355491638,
1820
+ "learning_rate": 1.4080201925338322e-07,
1821
+ "loss": 0.3978,
1822
+ "step": 12950
1823
+ },
1824
+ {
1825
+ "epoch": 0.9798748775156403,
1826
+ "grad_norm": 0.1579546183347702,
1827
+ "learning_rate": 9.99015308503215e-08,
1828
+ "loss": 0.4005,
1829
+ "step": 13000
1830
+ },
1831
+ {
1832
+ "epoch": 0.9836436270445467,
1833
+ "grad_norm": 0.15818338096141815,
1834
+ "learning_rate": 6.599608925633715e-08,
1835
+ "loss": 0.3978,
1836
+ "step": 13050
1837
+ },
1838
+ {
1839
+ "epoch": 0.9874123765734529,
1840
+ "grad_norm": 0.15863798558712006,
1841
+ "learning_rate": 3.909044737089307e-08,
1842
+ "loss": 0.3991,
1843
+ "step": 13100
1844
+ },
1845
+ {
1846
+ "epoch": 0.9911811261023592,
1847
+ "grad_norm": 0.1556527018547058,
1848
+ "learning_rate": 1.9188376854373246e-08,
1849
+ "loss": 0.3985,
1850
+ "step": 13150
1851
+ },
1852
+ {
1853
+ "epoch": 0.9949498756312656,
1854
+ "grad_norm": 0.16225971281528473,
1855
+ "learning_rate": 6.292667599366864e-09,
1856
+ "loss": 0.3979,
1857
+ "step": 13200
1858
+ },
1859
+ {
1860
+ "epoch": 0.9987186251601718,
1861
+ "grad_norm": 0.16236484050750732,
1862
+ "learning_rate": 4.0512733956998837e-10,
1863
+ "loss": 0.3953,
1864
+ "step": 13250
1865
+ }
1866
+ ],
1867
+ "logging_steps": 50,
1868
+ "max_steps": 13267,
1869
+ "num_input_tokens_seen": 0,
1870
+ "num_train_epochs": 1,
1871
+ "save_steps": 500,
1872
+ "stateful_callbacks": {
1873
+ "TrainerControl": {
1874
+ "args": {
1875
+ "should_epoch_stop": false,
1876
+ "should_evaluate": false,
1877
+ "should_log": false,
1878
+ "should_save": true,
1879
+ "should_training_stop": true
1880
+ },
1881
+ "attributes": {}
1882
+ }
1883
+ },
1884
+ "total_flos": 6.892725356142474e+19,
1885
+ "train_batch_size": 2,
1886
+ "trial_name": null,
1887
+ "trial_params": null
1888
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0085c343f2206a794f40a3e085ec366c9dc3ce02d1c86bbca36834ab3eb500ea
3
+ size 6968
vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
zero_to_fp32.py ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example:
14
+ # python zero_to_fp32.py . output_dir/
15
+ # or
16
+ # python zero_to_fp32.py . output_dir/ --safe_serialization
17
+
18
+ import argparse
19
+ import torch
20
+ import glob
21
+ import math
22
+ import os
23
+ import re
24
+ import json
25
+ from tqdm import tqdm
26
+ from collections import OrderedDict
27
+ from dataclasses import dataclass
28
+
29
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
30
+ # DeepSpeed data structures it has to be available in the current python environment.
31
+ from deepspeed.utils import logger
32
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
33
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
34
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
35
+
36
+
37
+ @dataclass
38
+ class zero_model_state:
39
+ buffers: dict()
40
+ param_shapes: dict()
41
+ shared_params: list
42
+ ds_version: int
43
+ frozen_param_shapes: dict()
44
+ frozen_param_fragments: dict()
45
+
46
+
47
+ debug = 0
48
+
49
+ # load to cpu
50
+ device = torch.device('cpu')
51
+
52
+
53
+ def atoi(text):
54
+ return int(text) if text.isdigit() else text
55
+
56
+
57
+ def natural_keys(text):
58
+ '''
59
+ alist.sort(key=natural_keys) sorts in human order
60
+ http://nedbatchelder.com/blog/200712/human_sorting.html
61
+ (See Toothy's implementation in the comments)
62
+ '''
63
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
64
+
65
+
66
+ def get_model_state_file(checkpoint_dir, zero_stage):
67
+ if not os.path.isdir(checkpoint_dir):
68
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
69
+
70
+ # there should be only one file
71
+ if zero_stage <= 2:
72
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
73
+ elif zero_stage == 3:
74
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
75
+
76
+ if not os.path.exists(file):
77
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
78
+
79
+ return file
80
+
81
+
82
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
83
+ # XXX: need to test that this simple glob rule works for multi-node setup too
84
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
85
+
86
+ if len(ckpt_files) == 0:
87
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
88
+
89
+ return ckpt_files
90
+
91
+
92
+ def get_optim_files(checkpoint_dir):
93
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
94
+
95
+
96
+ def get_model_state_files(checkpoint_dir):
97
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
98
+
99
+
100
+ def parse_model_states(files):
101
+ zero_model_states = []
102
+ for file in files:
103
+ state_dict = torch.load(file, map_location=device)
104
+
105
+ if BUFFER_NAMES not in state_dict:
106
+ raise ValueError(f"{file} is not a model state checkpoint")
107
+ buffer_names = state_dict[BUFFER_NAMES]
108
+ if debug:
109
+ print("Found buffers:", buffer_names)
110
+
111
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
112
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
113
+ param_shapes = state_dict[PARAM_SHAPES]
114
+
115
+ # collect parameters that are included in param_shapes
116
+ param_names = []
117
+ for s in param_shapes:
118
+ for name in s.keys():
119
+ param_names.append(name)
120
+
121
+ # update with frozen parameters
122
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
123
+ if frozen_param_shapes is not None:
124
+ if debug:
125
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
126
+ param_names += list(frozen_param_shapes.keys())
127
+
128
+ # handle shared params
129
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
130
+
131
+ ds_version = state_dict.get(DS_VERSION, None)
132
+
133
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
134
+
135
+ z_model_state = zero_model_state(buffers=buffers,
136
+ param_shapes=param_shapes,
137
+ shared_params=shared_params,
138
+ ds_version=ds_version,
139
+ frozen_param_shapes=frozen_param_shapes,
140
+ frozen_param_fragments=frozen_param_fragments)
141
+ zero_model_states.append(z_model_state)
142
+
143
+ return zero_model_states
144
+
145
+
146
+ def parse_optim_states(files, ds_checkpoint_dir):
147
+ total_files = len(files)
148
+ state_dicts = []
149
+ for f in files:
150
+ state_dict = torch.load(f, map_location=device)
151
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
152
+ # and also handle the case where it was already removed by another helper script
153
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
154
+ state_dicts.append(state_dict)
155
+
156
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
157
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
158
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
159
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
160
+
161
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
162
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
163
+ # use the max of the partition_count to get the dp world_size.
164
+
165
+ if type(world_size) is list:
166
+ world_size = max(world_size)
167
+
168
+ if world_size != total_files:
169
+ raise ValueError(
170
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
171
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
172
+ )
173
+
174
+ # the groups are named differently in each stage
175
+ if zero_stage <= 2:
176
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
177
+ elif zero_stage == 3:
178
+ fp32_groups_key = FP32_FLAT_GROUPS
179
+ else:
180
+ raise ValueError(f"unknown zero stage {zero_stage}")
181
+
182
+ if zero_stage <= 2:
183
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
184
+ elif zero_stage == 3:
185
+ # if there is more than one param group, there will be multiple flattened tensors - one
186
+ # flattened tensor per group - for simplicity merge them into a single tensor
187
+ #
188
+ # XXX: could make the script more memory efficient for when there are multiple groups - it
189
+ # will require matching the sub-lists of param_shapes for each param group flattened tensor
190
+
191
+ fp32_flat_groups = [
192
+ torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) for i in range(len(state_dicts))
193
+ ]
194
+
195
+ return zero_stage, world_size, fp32_flat_groups
196
+
197
+
198
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
199
+ """
200
+ Returns fp32 state_dict reconstructed from ds checkpoint
201
+
202
+ Args:
203
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
204
+
205
+ """
206
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
207
+
208
+ optim_files = get_optim_files(ds_checkpoint_dir)
209
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
210
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
211
+
212
+ model_files = get_model_state_files(ds_checkpoint_dir)
213
+
214
+ zero_model_states = parse_model_states(model_files)
215
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
216
+
217
+ if zero_stage <= 2:
218
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
219
+ exclude_frozen_parameters)
220
+ elif zero_stage == 3:
221
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
222
+ exclude_frozen_parameters)
223
+
224
+
225
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
226
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
227
+ return
228
+
229
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
230
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
231
+
232
+ if debug:
233
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
234
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
235
+
236
+ wanted_params = len(frozen_param_shapes)
237
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
238
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
239
+ print(f'Frozen params: Have {avail_numel} numels to process.')
240
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
241
+
242
+ total_params = 0
243
+ total_numel = 0
244
+ for name, shape in frozen_param_shapes.items():
245
+ total_params += 1
246
+ unpartitioned_numel = shape.numel()
247
+ total_numel += unpartitioned_numel
248
+
249
+ state_dict[name] = frozen_param_fragments[name]
250
+
251
+ if debug:
252
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
253
+
254
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
255
+
256
+
257
+ def _has_callable(obj, fn):
258
+ attr = getattr(obj, fn, None)
259
+ return callable(attr)
260
+
261
+
262
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
263
+ param_shapes = zero_model_states[0].param_shapes
264
+
265
+ # Reconstruction protocol:
266
+ #
267
+ # XXX: document this
268
+
269
+ if debug:
270
+ for i in range(world_size):
271
+ for j in range(len(fp32_flat_groups[0])):
272
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
273
+
274
+ # XXX: memory usage doubles here (zero2)
275
+ num_param_groups = len(fp32_flat_groups[0])
276
+ merged_single_partition_of_fp32_groups = []
277
+ for i in range(num_param_groups):
278
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
279
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
280
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
281
+ avail_numel = sum(
282
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
283
+
284
+ if debug:
285
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
286
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
287
+ # not asserting if there is a mismatch due to possible padding
288
+ print(f"Have {avail_numel} numels to process.")
289
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
290
+
291
+ # params
292
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
293
+ # out-of-core computing solution
294
+ total_numel = 0
295
+ total_params = 0
296
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
297
+ offset = 0
298
+ avail_numel = full_single_fp32_vector.numel()
299
+ for name, shape in shapes.items():
300
+
301
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
302
+ total_numel += unpartitioned_numel
303
+ total_params += 1
304
+
305
+ if debug:
306
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
307
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
308
+ offset += unpartitioned_numel
309
+
310
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
311
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
312
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
313
+ # live optimizer object, so we are checking that the numbers are within the right range
314
+ align_to = 2 * world_size
315
+
316
+ def zero2_align(x):
317
+ return align_to * math.ceil(x / align_to)
318
+
319
+ if debug:
320
+ print(f"original offset={offset}, avail_numel={avail_numel}")
321
+
322
+ offset = zero2_align(offset)
323
+ avail_numel = zero2_align(avail_numel)
324
+
325
+ if debug:
326
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
327
+
328
+ # Sanity check
329
+ if offset != avail_numel:
330
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
331
+
332
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
333
+
334
+
335
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
336
+ exclude_frozen_parameters):
337
+ state_dict = OrderedDict()
338
+
339
+ # buffers
340
+ buffers = zero_model_states[0].buffers
341
+ state_dict.update(buffers)
342
+ if debug:
343
+ print(f"added {len(buffers)} buffers")
344
+
345
+ if not exclude_frozen_parameters:
346
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
347
+
348
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
349
+
350
+ # recover shared parameters
351
+ for pair in zero_model_states[0].shared_params:
352
+ if pair[1] in state_dict:
353
+ state_dict[pair[0]] = state_dict[pair[1]]
354
+
355
+ return state_dict
356
+
357
+
358
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
359
+ remainder = unpartitioned_numel % world_size
360
+ padding_numel = (world_size - remainder) if remainder else 0
361
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
362
+ return partitioned_numel, padding_numel
363
+
364
+
365
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
366
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
367
+ return
368
+
369
+ if debug:
370
+ for i in range(world_size):
371
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
372
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
373
+
374
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
375
+ wanted_params = len(frozen_param_shapes)
376
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
377
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
378
+ print(f'Frozen params: Have {avail_numel} numels to process.')
379
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
380
+
381
+ total_params = 0
382
+ total_numel = 0
383
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
384
+ total_params += 1
385
+ unpartitioned_numel = shape.numel()
386
+ total_numel += unpartitioned_numel
387
+
388
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
389
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
390
+
391
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
392
+
393
+ if debug:
394
+ print(
395
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
396
+ )
397
+
398
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
399
+
400
+
401
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
402
+ param_shapes = zero_model_states[0].param_shapes
403
+ avail_numel = fp32_flat_groups[0].numel() * world_size
404
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
405
+ # param, re-consolidating each param, while dealing with padding if any
406
+
407
+ # merge list of dicts, preserving order
408
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
409
+
410
+ if debug:
411
+ for i in range(world_size):
412
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
413
+
414
+ wanted_params = len(param_shapes)
415
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
416
+ # not asserting if there is a mismatch due to possible padding
417
+ avail_numel = fp32_flat_groups[0].numel() * world_size
418
+ print(f"Trainable params: Have {avail_numel} numels to process.")
419
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
420
+
421
+ # params
422
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
423
+ # out-of-core computing solution
424
+ offset = 0
425
+ total_numel = 0
426
+ total_params = 0
427
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering Sharded Weights'):
428
+ unpartitioned_numel = shape.numel()
429
+ total_numel += unpartitioned_numel
430
+ total_params += 1
431
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
432
+
433
+ if debug:
434
+ print(
435
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
436
+ )
437
+
438
+ # XXX: memory usage doubles here
439
+ state_dict[name] = torch.cat(
440
+ tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
441
+ 0).narrow(0, 0, unpartitioned_numel).view(shape)
442
+ offset += partitioned_numel
443
+
444
+ offset *= world_size
445
+
446
+ # Sanity check
447
+ if offset != avail_numel:
448
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
449
+
450
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
451
+
452
+
453
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
454
+ exclude_frozen_parameters):
455
+ state_dict = OrderedDict()
456
+
457
+ # buffers
458
+ buffers = zero_model_states[0].buffers
459
+ state_dict.update(buffers)
460
+ if debug:
461
+ print(f"added {len(buffers)} buffers")
462
+
463
+ if not exclude_frozen_parameters:
464
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
465
+
466
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
467
+
468
+ # recover shared parameters
469
+ for pair in zero_model_states[0].shared_params:
470
+ if pair[1] in state_dict:
471
+ state_dict[pair[0]] = state_dict[pair[1]]
472
+
473
+ return state_dict
474
+
475
+
476
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=False):
477
+ """
478
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
479
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
480
+ via a model hub.
481
+
482
+ Args:
483
+ - ``checkpoint_dir``: path to the desired checkpoint folder
484
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
485
+ - ``exclude_frozen_parameters``: exclude frozen parameters
486
+
487
+ Returns:
488
+ - pytorch ``state_dict``
489
+
490
+ Note: this approach may not work if your application doesn't have sufficient free CPU memory and
491
+ you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
492
+ the checkpoint.
493
+
494
+ A typical usage might be ::
495
+
496
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
497
+ # do the training and checkpoint saving
498
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
499
+ model = model.cpu() # move to cpu
500
+ model.load_state_dict(state_dict)
501
+ # submit to model hub or save the model to share with others
502
+
503
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
504
+ application. i.e. you will need to re-initialize the deepspeed engine, since
505
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
506
+
507
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
508
+
509
+ """
510
+ if tag is None:
511
+ latest_path = os.path.join(checkpoint_dir, 'latest')
512
+ if os.path.isfile(latest_path):
513
+ with open(latest_path, 'r') as fd:
514
+ tag = fd.read().strip()
515
+ else:
516
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
517
+
518
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
519
+
520
+ if not os.path.isdir(ds_checkpoint_dir):
521
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
522
+
523
+ return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
524
+
525
+
526
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
527
+ output_dir,
528
+ max_shard_size="5GB",
529
+ safe_serialization=False,
530
+ tag=None,
531
+ exclude_frozen_parameters=False):
532
+ """
533
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
534
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
535
+
536
+ Args:
537
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
538
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
539
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
540
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
541
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
542
+ - ``exclude_frozen_parameters``: exclude frozen parameters
543
+ """
544
+ # Dependency pre-check
545
+ if safe_serialization:
546
+ try:
547
+ from safetensors.torch import save_file
548
+ except ImportError:
549
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
550
+ raise
551
+ if max_shard_size is not None:
552
+ try:
553
+ from huggingface_hub import split_torch_state_dict_into_shards
554
+ except ImportError:
555
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
556
+ raise
557
+
558
+ # Convert zero checkpoint to state_dict
559
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
560
+
561
+ # Shard the model if it is too big.
562
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
563
+ if max_shard_size is not None:
564
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
565
+ state_dict_split = split_torch_state_dict_into_shards(state_dict,
566
+ filename_pattern=filename_pattern,
567
+ max_shard_size=max_shard_size)
568
+ else:
569
+ from collections import namedtuple
570
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
571
+ state_dict_split = StateDictSplit(is_sharded=False,
572
+ filename_to_tensors={weights_name: list(state_dict.keys())})
573
+
574
+ # Save the model
575
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
576
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
577
+ shard = {tensor: state_dict[tensor].contiguous() for tensor in tensors}
578
+ output_path = os.path.join(output_dir, shard_file)
579
+ if safe_serialization:
580
+ save_file(shard, output_path, metadata={"format": "pt"})
581
+ else:
582
+ torch.save(shard, output_path)
583
+
584
+ # Save index if sharded
585
+ if state_dict_split.is_sharded:
586
+ index = {
587
+ "metadata": state_dict_split.metadata,
588
+ "weight_map": state_dict_split.tensor_to_filename,
589
+ }
590
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
591
+ save_index_file = os.path.join(output_dir, save_index_file)
592
+ with open(save_index_file, "w", encoding="utf-8") as f:
593
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
594
+ f.write(content)
595
+
596
+
597
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
598
+ """
599
+ 1. Put the provided model to cpu
600
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
601
+ 3. Load it into the provided model
602
+
603
+ Args:
604
+ - ``model``: the model object to update
605
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
606
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
607
+
608
+ Returns:
609
+ - ``model`: modified model
610
+
611
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
612
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
613
+ conveniently placed for you in the checkpoint folder.
614
+
615
+ A typical usage might be ::
616
+
617
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
618
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
619
+ # submit to model hub or save the model to share with others
620
+
621
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
622
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
623
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
624
+
625
+ """
626
+ logger.info(f"Extracting fp32 weights")
627
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
628
+
629
+ logger.info(f"Overwriting model with fp32 weights")
630
+ model = model.cpu()
631
+ model.load_state_dict(state_dict, strict=False)
632
+
633
+ return model
634
+
635
+
636
+ if __name__ == "__main__":
637
+ parser = argparse.ArgumentParser()
638
+ parser.add_argument("checkpoint_dir",
639
+ type=str,
640
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
641
+ parser.add_argument("output_dir",
642
+ type=str,
643
+ help="directory to the pytorch fp32 state_dict output files"
644
+ "(e.g. path/checkpoint-12-output/)")
645
+ parser.add_argument(
646
+ "--max_shard_size",
647
+ type=str,
648
+ default="5GB",
649
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
650
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
651
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
652
+ "without CPU OOM issues.")
653
+ parser.add_argument(
654
+ "--safe_serialization",
655
+ default=False,
656
+ action='store_true',
657
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
658
+ parser.add_argument("-t",
659
+ "--tag",
660
+ type=str,
661
+ default=None,
662
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
663
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
664
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
665
+ args = parser.parse_args()
666
+
667
+ debug = args.debug
668
+
669
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
670
+ args.output_dir,
671
+ max_shard_size=args.max_shard_size,
672
+ safe_serialization=args.safe_serialization,
673
+ tag=args.tag,
674
+ exclude_frozen_parameters=args.exclude_frozen_parameters)