Journey9ni commited on
Commit
2edb1a6
·
verified ·
1 Parent(s): 37117b9

Upload checkpoint-2000

Browse files
Files changed (33) hide show
  1. checkpoint-2000/added_tokens.json +24 -0
  2. checkpoint-2000/config.json +84 -0
  3. checkpoint-2000/generation_config.json +12 -0
  4. checkpoint-2000/global_step2000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  5. checkpoint-2000/global_step2000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  6. checkpoint-2000/global_step2000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
  7. checkpoint-2000/global_step2000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
  8. checkpoint-2000/global_step2000/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
  9. checkpoint-2000/global_step2000/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
  10. checkpoint-2000/global_step2000/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
  11. checkpoint-2000/global_step2000/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt +3 -0
  12. checkpoint-2000/global_step2000/mp_rank_00_model_states.pt +3 -0
  13. checkpoint-2000/latest +1 -0
  14. checkpoint-2000/merges.txt +0 -0
  15. checkpoint-2000/model-00001-of-00003.safetensors +3 -0
  16. checkpoint-2000/model-00002-of-00003.safetensors +3 -0
  17. checkpoint-2000/model-00003-of-00003.safetensors +3 -0
  18. checkpoint-2000/model.safetensors.index.json +0 -0
  19. checkpoint-2000/rng_state_0.pth +3 -0
  20. checkpoint-2000/rng_state_1.pth +3 -0
  21. checkpoint-2000/rng_state_2.pth +3 -0
  22. checkpoint-2000/rng_state_3.pth +3 -0
  23. checkpoint-2000/rng_state_4.pth +3 -0
  24. checkpoint-2000/rng_state_5.pth +3 -0
  25. checkpoint-2000/rng_state_6.pth +3 -0
  26. checkpoint-2000/rng_state_7.pth +3 -0
  27. checkpoint-2000/scheduler.pt +3 -0
  28. checkpoint-2000/special_tokens_map.json +31 -0
  29. checkpoint-2000/tokenizer_config.json +209 -0
  30. checkpoint-2000/trainer_state.json +1434 -0
  31. checkpoint-2000/training_args.bin +3 -0
  32. checkpoint-2000/vocab.json +0 -0
  33. checkpoint-2000/zero_to_fp32.py +760 -0
checkpoint-2000/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
+ }
checkpoint-2000/config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2_5_VLForConditionalGenerationWithVGGT"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151645,
8
+ "feature_fusion_method": "deepstack_language_add",
9
+ "fusion_num_layers": 1,
10
+ "geometry_encoder_layers": [
11
+ 11,
12
+ 17,
13
+ 21
14
+ ],
15
+ "geometry_encoder_type": "vggt",
16
+ "geometry_fusion_layers": [
17
+ 0,
18
+ 1,
19
+ 2
20
+ ],
21
+ "geometry_merger_type": "mlp",
22
+ "hidden_act": "silu",
23
+ "hidden_size": 2048,
24
+ "image_token_id": 151655,
25
+ "include_camera_token": false,
26
+ "initializer_range": 0.02,
27
+ "intermediate_size": 11008,
28
+ "max_position_embeddings": 128000,
29
+ "max_window_layers": 70,
30
+ "model_type": "qwen2_5_vl",
31
+ "num_attention_heads": 16,
32
+ "num_hidden_layers": 36,
33
+ "num_key_value_heads": 2,
34
+ "pos_encoding_type": "none",
35
+ "reference_frame": "first",
36
+ "rms_norm_eps": 1e-06,
37
+ "rope_scaling": {
38
+ "mrope_section": [
39
+ 16,
40
+ 24,
41
+ 24
42
+ ],
43
+ "rope_type": "default",
44
+ "type": "default"
45
+ },
46
+ "rope_theta": 1000000.0,
47
+ "sliding_window": 32768,
48
+ "tie_word_embeddings": true,
49
+ "torch_dtype": "bfloat16",
50
+ "transformers_version": "4.50.0",
51
+ "use_cache": false,
52
+ "use_geometry_encoder": true,
53
+ "use_sliding_window": false,
54
+ "video_token_id": 151656,
55
+ "vision_config": {
56
+ "depth": 32,
57
+ "fullatt_block_indexes": [
58
+ 7,
59
+ 15,
60
+ 23,
61
+ 31
62
+ ],
63
+ "hidden_act": "silu",
64
+ "hidden_size": 1280,
65
+ "in_channels": 3,
66
+ "in_chans": 3,
67
+ "intermediate_size": 3420,
68
+ "model_type": "qwen2_5_vl",
69
+ "num_heads": 16,
70
+ "out_hidden_size": 2048,
71
+ "patch_size": 14,
72
+ "spatial_merge_size": 2,
73
+ "spatial_patch_size": 14,
74
+ "temporal_patch_size": 2,
75
+ "tokens_per_second": 2,
76
+ "torch_dtype": "bfloat16",
77
+ "window_size": 112
78
+ },
79
+ "vision_end_token_id": 151653,
80
+ "vision_language_fusion_layers": null,
81
+ "vision_start_token_id": 151652,
82
+ "vision_token_id": 151654,
83
+ "vocab_size": 151936
84
+ }
checkpoint-2000/generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 151645,
6
+ 151643
7
+ ],
8
+ "pad_token_id": 151643,
9
+ "repetition_penalty": 1.05,
10
+ "temperature": 1e-06,
11
+ "transformers_version": "4.50.0"
12
+ }
checkpoint-2000/global_step2000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c234173e1b7b1021f813ad8d9645e50fc8bf356bcadf1bd76db0fd50e6be38a
3
+ size 4817695729
checkpoint-2000/global_step2000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3304202060334f26c68ba9dd1742e53cd312dea416e1ab5d6b95c7e6aa43a4f
3
+ size 4817698545
checkpoint-2000/global_step2000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:252b55983d8583dc38413ba9e848746cc32ceb3b886321316e7567a19fe15d9f
3
+ size 4817699121
checkpoint-2000/global_step2000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c1e518697e2da90f0f519619ed6d635835d80a4ffa287a9fec73ac1a3de67fb
3
+ size 4817699569
checkpoint-2000/global_step2000/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d32a45e076dacafe7da70027cc350fbb2c2d77e878651ed67bc02b99554e1c7d
3
+ size 4817698993
checkpoint-2000/global_step2000/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fab3ab4ae9cd875c425ca5e50cc00d4ac0ca6acdd593c668429bb9cf105b400
3
+ size 4817699249
checkpoint-2000/global_step2000/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ef20cf06f792651c18eed21a686a41c8b098ba6aba48915ef26c2ba0fd1db45
3
+ size 4817699057
checkpoint-2000/global_step2000/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fb931aba92e7a88e07c39ecf12ae7f8056e2872a265c3b3e2125e548bcae715
3
+ size 4817699377
checkpoint-2000/global_step2000/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6000c9215dda6e3e9cb43e9f6cc65e1e1f30797a2f4e7b5111de8fcee3f48d6
3
+ size 12736254037
checkpoint-2000/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step2000
checkpoint-2000/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-2000/model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4eda8acf90dd0dad671385f9648f10ba812f3f3525693f2273de18d794759eb8
3
+ size 4962140952
checkpoint-2000/model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fcf624e817ede52821989d86116e5cb8e91a2f441928e65b3294bda61ddf3eb
3
+ size 4869006472
checkpoint-2000/model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d96a44998e4ddefae712b8571b47ba7bc13984a4a612769ee319f4b00a0d9e7a
3
+ size 622329984
checkpoint-2000/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-2000/rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93366b78442d88be019e36f3ea689d21ed498b09e95d530b448530a143cc3f36
3
+ size 16325
checkpoint-2000/rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d721cb58d3bd65db773d5c1f43927f5aad0aeb38d44f1201f9142e93b467b6ed
3
+ size 16325
checkpoint-2000/rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8cd3dabf2f4ae849586a5b78bf256d3ee47426368adf39ef0cfa60f97e31328
3
+ size 16325
checkpoint-2000/rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a6d3c132b137b6645ecb4941c37da51f062228a8f875e480ad1ab2786df8a46
3
+ size 16325
checkpoint-2000/rng_state_4.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70602ef413ff4a3a2b3c27c82c937c3edccab869afd9899600831facd1efa37d
3
+ size 16325
checkpoint-2000/rng_state_5.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5da8055d6f4011e5ec500f5e23cc87cbfed3e0e1aac3d8d331d42698da8e6aa6
3
+ size 16325
checkpoint-2000/rng_state_6.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3eca2914b1b5c55d14aafdc6a7517c617a86a987344214e557c3c5b9d74bc10
3
+ size 16325
checkpoint-2000/rng_state_7.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26f3977ddd6e391a32d3384758177f0212c6b30f62092335828dc6f5a279396f
3
+ size 16325
checkpoint-2000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55c8ab00eff0e3985fe0711a73c280a2872463cb5d58817c6c4c1710d7d62f57
3
+ size 1465
checkpoint-2000/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
+ }
checkpoint-2000/tokenizer_config.json ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n{% endif %}<|im_start|>{{ message['role'] }}\n{% if message['content'] is string %}{{ message['content'] }}<|im_end|>\n{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>\n{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant\n{% endif %}",
199
+ "clean_up_tokenization_spaces": false,
200
+ "eos_token": "<|im_end|>",
201
+ "errors": "replace",
202
+ "extra_special_tokens": {},
203
+ "model_max_length": 12800,
204
+ "pad_token": "<|endoftext|>",
205
+ "padding_side": "right",
206
+ "split_special_tokens": false,
207
+ "tokenizer_class": "Qwen2Tokenizer",
208
+ "unk_token": null
209
+ }
checkpoint-2000/trainer_state.json ADDED
@@ -0,0 +1,1434 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.604366548311551,
6
+ "eval_steps": 500,
7
+ "global_step": 2000,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.0030218327415577548,
14
+ "grad_norm": 165.52227783203125,
15
+ "learning_rate": 1.0000000000000002e-06,
16
+ "loss": 13.7981,
17
+ "step": 10
18
+ },
19
+ {
20
+ "epoch": 0.0060436654831155096,
21
+ "grad_norm": 78.14161682128906,
22
+ "learning_rate": 2.0000000000000003e-06,
23
+ "loss": 13.0602,
24
+ "step": 20
25
+ },
26
+ {
27
+ "epoch": 0.009065498224673264,
28
+ "grad_norm": 51.4779167175293,
29
+ "learning_rate": 3e-06,
30
+ "loss": 12.098,
31
+ "step": 30
32
+ },
33
+ {
34
+ "epoch": 0.012087330966231019,
35
+ "grad_norm": 48.51755905151367,
36
+ "learning_rate": 4.000000000000001e-06,
37
+ "loss": 10.3148,
38
+ "step": 40
39
+ },
40
+ {
41
+ "epoch": 0.015109163707788774,
42
+ "grad_norm": 45.85222244262695,
43
+ "learning_rate": 5e-06,
44
+ "loss": 9.5523,
45
+ "step": 50
46
+ },
47
+ {
48
+ "epoch": 0.01813099644934653,
49
+ "grad_norm": 40.89993667602539,
50
+ "learning_rate": 6e-06,
51
+ "loss": 8.3467,
52
+ "step": 60
53
+ },
54
+ {
55
+ "epoch": 0.021152829190904283,
56
+ "grad_norm": 31.405731201171875,
57
+ "learning_rate": 7e-06,
58
+ "loss": 6.9178,
59
+ "step": 70
60
+ },
61
+ {
62
+ "epoch": 0.024174661932462038,
63
+ "grad_norm": 53.975521087646484,
64
+ "learning_rate": 8.000000000000001e-06,
65
+ "loss": 6.779,
66
+ "step": 80
67
+ },
68
+ {
69
+ "epoch": 0.027196494674019793,
70
+ "grad_norm": 30.481246948242188,
71
+ "learning_rate": 9e-06,
72
+ "loss": 7.0495,
73
+ "step": 90
74
+ },
75
+ {
76
+ "epoch": 0.030218327415577548,
77
+ "grad_norm": 37.02349090576172,
78
+ "learning_rate": 1e-05,
79
+ "loss": 6.7093,
80
+ "step": 100
81
+ },
82
+ {
83
+ "epoch": 0.0332401601571353,
84
+ "grad_norm": 37.39162063598633,
85
+ "learning_rate": 9.999760394462267e-06,
86
+ "loss": 7.3573,
87
+ "step": 110
88
+ },
89
+ {
90
+ "epoch": 0.03626199289869306,
91
+ "grad_norm": 38.217613220214844,
92
+ "learning_rate": 9.999041600813393e-06,
93
+ "loss": 7.008,
94
+ "step": 120
95
+ },
96
+ {
97
+ "epoch": 0.03928382564025081,
98
+ "grad_norm": 31.28360366821289,
99
+ "learning_rate": 9.997843687944153e-06,
100
+ "loss": 6.2504,
101
+ "step": 130
102
+ },
103
+ {
104
+ "epoch": 0.04230565838180857,
105
+ "grad_norm": 29.08894920349121,
106
+ "learning_rate": 9.996166770665168e-06,
107
+ "loss": 5.5792,
108
+ "step": 140
109
+ },
110
+ {
111
+ "epoch": 0.04532749112336632,
112
+ "grad_norm": 31.739566802978516,
113
+ "learning_rate": 9.994011009695908e-06,
114
+ "loss": 5.6811,
115
+ "step": 150
116
+ },
117
+ {
118
+ "epoch": 0.048349323864924076,
119
+ "grad_norm": 30.99082374572754,
120
+ "learning_rate": 9.991376611649278e-06,
121
+ "loss": 6.0987,
122
+ "step": 160
123
+ },
124
+ {
125
+ "epoch": 0.05137115660648183,
126
+ "grad_norm": 26.928142547607422,
127
+ "learning_rate": 9.988263829011821e-06,
128
+ "loss": 5.4118,
129
+ "step": 170
130
+ },
131
+ {
132
+ "epoch": 0.054392989348039586,
133
+ "grad_norm": 25.255813598632812,
134
+ "learning_rate": 9.984672960119523e-06,
135
+ "loss": 5.3659,
136
+ "step": 180
137
+ },
138
+ {
139
+ "epoch": 0.05741482208959734,
140
+ "grad_norm": 39.82838439941406,
141
+ "learning_rate": 9.980604349129212e-06,
142
+ "loss": 5.763,
143
+ "step": 190
144
+ },
145
+ {
146
+ "epoch": 0.060436654831155096,
147
+ "grad_norm": 26.258312225341797,
148
+ "learning_rate": 9.976058385985575e-06,
149
+ "loss": 5.1983,
150
+ "step": 200
151
+ },
152
+ {
153
+ "epoch": 0.06345848757271286,
154
+ "grad_norm": 34.27275466918945,
155
+ "learning_rate": 9.971035506383791e-06,
156
+ "loss": 5.533,
157
+ "step": 210
158
+ },
159
+ {
160
+ "epoch": 0.0664803203142706,
161
+ "grad_norm": 29.04474449157715,
162
+ "learning_rate": 9.96553619172777e-06,
163
+ "loss": 5.0581,
164
+ "step": 220
165
+ },
166
+ {
167
+ "epoch": 0.06950215305582837,
168
+ "grad_norm": 30.255725860595703,
169
+ "learning_rate": 9.959560969084004e-06,
170
+ "loss": 5.3482,
171
+ "step": 230
172
+ },
173
+ {
174
+ "epoch": 0.07252398579738611,
175
+ "grad_norm": 27.225391387939453,
176
+ "learning_rate": 9.953110411131073e-06,
177
+ "loss": 4.7629,
178
+ "step": 240
179
+ },
180
+ {
181
+ "epoch": 0.07554581853894388,
182
+ "grad_norm": 28.110713958740234,
183
+ "learning_rate": 9.946185136104736e-06,
184
+ "loss": 5.4251,
185
+ "step": 250
186
+ },
187
+ {
188
+ "epoch": 0.07856765128050162,
189
+ "grad_norm": 30.360767364501953,
190
+ "learning_rate": 9.938785807738692e-06,
191
+ "loss": 4.8019,
192
+ "step": 260
193
+ },
194
+ {
195
+ "epoch": 0.08158948402205939,
196
+ "grad_norm": 31.589569091796875,
197
+ "learning_rate": 9.930913135200964e-06,
198
+ "loss": 5.4093,
199
+ "step": 270
200
+ },
201
+ {
202
+ "epoch": 0.08461131676361713,
203
+ "grad_norm": 23.243560791015625,
204
+ "learning_rate": 9.922567873025924e-06,
205
+ "loss": 5.2431,
206
+ "step": 280
207
+ },
208
+ {
209
+ "epoch": 0.0876331495051749,
210
+ "grad_norm": 37.121124267578125,
211
+ "learning_rate": 9.913750821041988e-06,
212
+ "loss": 4.5542,
213
+ "step": 290
214
+ },
215
+ {
216
+ "epoch": 0.09065498224673264,
217
+ "grad_norm": 25.293624877929688,
218
+ "learning_rate": 9.904462824294945e-06,
219
+ "loss": 4.5975,
220
+ "step": 300
221
+ },
222
+ {
223
+ "epoch": 0.0936768149882904,
224
+ "grad_norm": 26.541584014892578,
225
+ "learning_rate": 9.894704772966978e-06,
226
+ "loss": 4.4755,
227
+ "step": 310
228
+ },
229
+ {
230
+ "epoch": 0.09669864772984815,
231
+ "grad_norm": 23.836275100708008,
232
+ "learning_rate": 9.884477602291343e-06,
233
+ "loss": 4.4776,
234
+ "step": 320
235
+ },
236
+ {
237
+ "epoch": 0.09972048047140591,
238
+ "grad_norm": 33.217247009277344,
239
+ "learning_rate": 9.873782292462727e-06,
240
+ "loss": 4.3572,
241
+ "step": 330
242
+ },
243
+ {
244
+ "epoch": 0.10274231321296366,
245
+ "grad_norm": 27.012453079223633,
246
+ "learning_rate": 9.862619868543323e-06,
247
+ "loss": 8.1775,
248
+ "step": 340
249
+ },
250
+ {
251
+ "epoch": 0.10576414595452142,
252
+ "grad_norm": 37.925636291503906,
253
+ "learning_rate": 9.850991400364557e-06,
254
+ "loss": 5.1596,
255
+ "step": 350
256
+ },
257
+ {
258
+ "epoch": 0.10878597869607917,
259
+ "grad_norm": 25.5006046295166,
260
+ "learning_rate": 9.838898002424586e-06,
261
+ "loss": 6.0762,
262
+ "step": 360
263
+ },
264
+ {
265
+ "epoch": 0.11180781143763693,
266
+ "grad_norm": 30.08086585998535,
267
+ "learning_rate": 9.826340833781448e-06,
268
+ "loss": 5.8416,
269
+ "step": 370
270
+ },
271
+ {
272
+ "epoch": 0.11482964417919468,
273
+ "grad_norm": 19.61676788330078,
274
+ "learning_rate": 9.813321097942005e-06,
275
+ "loss": 5.0978,
276
+ "step": 380
277
+ },
278
+ {
279
+ "epoch": 0.11785147692075244,
280
+ "grad_norm": 27.508745193481445,
281
+ "learning_rate": 9.79984004274658e-06,
282
+ "loss": 4.8911,
283
+ "step": 390
284
+ },
285
+ {
286
+ "epoch": 0.12087330966231019,
287
+ "grad_norm": 21.87676239013672,
288
+ "learning_rate": 9.785898960249365e-06,
289
+ "loss": 4.2318,
290
+ "step": 400
291
+ },
292
+ {
293
+ "epoch": 0.12389514240386795,
294
+ "grad_norm": 19.91452407836914,
295
+ "learning_rate": 9.771499186594586e-06,
296
+ "loss": 5.0726,
297
+ "step": 410
298
+ },
299
+ {
300
+ "epoch": 0.12691697514542571,
301
+ "grad_norm": 30.188919067382812,
302
+ "learning_rate": 9.756642101888449e-06,
303
+ "loss": 5.1973,
304
+ "step": 420
305
+ },
306
+ {
307
+ "epoch": 0.12993880788698345,
308
+ "grad_norm": 36.87270736694336,
309
+ "learning_rate": 9.74132913006686e-06,
310
+ "loss": 3.6298,
311
+ "step": 430
312
+ },
313
+ {
314
+ "epoch": 0.1329606406285412,
315
+ "grad_norm": 20.732437133789062,
316
+ "learning_rate": 9.725561738758956e-06,
317
+ "loss": 3.5142,
318
+ "step": 440
319
+ },
320
+ {
321
+ "epoch": 0.13598247337009897,
322
+ "grad_norm": 22.868412017822266,
323
+ "learning_rate": 9.709341439146452e-06,
324
+ "loss": 5.1262,
325
+ "step": 450
326
+ },
327
+ {
328
+ "epoch": 0.13900430611165673,
329
+ "grad_norm": 25.75754737854004,
330
+ "learning_rate": 9.692669785818787e-06,
331
+ "loss": 6.4161,
332
+ "step": 460
333
+ },
334
+ {
335
+ "epoch": 0.14202613885321447,
336
+ "grad_norm": 35.30986785888672,
337
+ "learning_rate": 9.675548376624149e-06,
338
+ "loss": 5.7558,
339
+ "step": 470
340
+ },
341
+ {
342
+ "epoch": 0.14504797159477223,
343
+ "grad_norm": 27.885366439819336,
344
+ "learning_rate": 9.657978852516318e-06,
345
+ "loss": 5.6992,
346
+ "step": 480
347
+ },
348
+ {
349
+ "epoch": 0.14806980433633,
350
+ "grad_norm": 21.603235244750977,
351
+ "learning_rate": 9.639962897397405e-06,
352
+ "loss": 4.2,
353
+ "step": 490
354
+ },
355
+ {
356
+ "epoch": 0.15109163707788775,
357
+ "grad_norm": 21.881452560424805,
358
+ "learning_rate": 9.621502237956452e-06,
359
+ "loss": 5.0617,
360
+ "step": 500
361
+ },
362
+ {
363
+ "epoch": 0.1541134698194455,
364
+ "grad_norm": 21.701580047607422,
365
+ "learning_rate": 9.602598643503957e-06,
366
+ "loss": 3.2664,
367
+ "step": 510
368
+ },
369
+ {
370
+ "epoch": 0.15713530256100325,
371
+ "grad_norm": 29.036582946777344,
372
+ "learning_rate": 9.583253925802283e-06,
373
+ "loss": 4.2414,
374
+ "step": 520
375
+ },
376
+ {
377
+ "epoch": 0.160157135302561,
378
+ "grad_norm": 22.403575897216797,
379
+ "learning_rate": 9.563469938892023e-06,
380
+ "loss": 4.8757,
381
+ "step": 530
382
+ },
383
+ {
384
+ "epoch": 0.16317896804411877,
385
+ "grad_norm": 23.00878143310547,
386
+ "learning_rate": 9.543248578914309e-06,
387
+ "loss": 3.2053,
388
+ "step": 540
389
+ },
390
+ {
391
+ "epoch": 0.1662008007856765,
392
+ "grad_norm": 22.494098663330078,
393
+ "learning_rate": 9.522591783929069e-06,
394
+ "loss": 4.8134,
395
+ "step": 550
396
+ },
397
+ {
398
+ "epoch": 0.16922263352723427,
399
+ "grad_norm": 20.914226531982422,
400
+ "learning_rate": 9.501501533729297e-06,
401
+ "loss": 4.1195,
402
+ "step": 560
403
+ },
404
+ {
405
+ "epoch": 0.17224446626879203,
406
+ "grad_norm": 33.715003967285156,
407
+ "learning_rate": 9.479979849651287e-06,
408
+ "loss": 5.765,
409
+ "step": 570
410
+ },
411
+ {
412
+ "epoch": 0.1752662990103498,
413
+ "grad_norm": 23.223495483398438,
414
+ "learning_rate": 9.45802879438091e-06,
415
+ "loss": 6.3336,
416
+ "step": 580
417
+ },
418
+ {
419
+ "epoch": 0.17828813175190752,
420
+ "grad_norm": 23.889699935913086,
421
+ "learning_rate": 9.43565047175593e-06,
422
+ "loss": 4.1538,
423
+ "step": 590
424
+ },
425
+ {
426
+ "epoch": 0.1813099644934653,
427
+ "grad_norm": 24.332725524902344,
428
+ "learning_rate": 9.412847026564359e-06,
429
+ "loss": 3.9682,
430
+ "step": 600
431
+ },
432
+ {
433
+ "epoch": 0.18433179723502305,
434
+ "grad_norm": 21.96092414855957,
435
+ "learning_rate": 9.389620644338893e-06,
436
+ "loss": 4.1644,
437
+ "step": 610
438
+ },
439
+ {
440
+ "epoch": 0.1873536299765808,
441
+ "grad_norm": 36.027503967285156,
442
+ "learning_rate": 9.365973551147453e-06,
443
+ "loss": 4.7194,
444
+ "step": 620
445
+ },
446
+ {
447
+ "epoch": 0.19037546271813854,
448
+ "grad_norm": 22.030109405517578,
449
+ "learning_rate": 9.341908013379832e-06,
450
+ "loss": 4.7219,
451
+ "step": 630
452
+ },
453
+ {
454
+ "epoch": 0.1933972954596963,
455
+ "grad_norm": 23.482004165649414,
456
+ "learning_rate": 9.317426337530477e-06,
457
+ "loss": 4.0362,
458
+ "step": 640
459
+ },
460
+ {
461
+ "epoch": 0.19641912820125407,
462
+ "grad_norm": 22.311803817749023,
463
+ "learning_rate": 9.292530869977432e-06,
464
+ "loss": 5.5712,
465
+ "step": 650
466
+ },
467
+ {
468
+ "epoch": 0.19944096094281183,
469
+ "grad_norm": 22.5808162689209,
470
+ "learning_rate": 9.26722399675745e-06,
471
+ "loss": 3.225,
472
+ "step": 660
473
+ },
474
+ {
475
+ "epoch": 0.20246279368436956,
476
+ "grad_norm": 20.662601470947266,
477
+ "learning_rate": 9.24150814333732e-06,
478
+ "loss": 3.9247,
479
+ "step": 670
480
+ },
481
+ {
482
+ "epoch": 0.20548462642592732,
483
+ "grad_norm": 19.702299118041992,
484
+ "learning_rate": 9.215385774381395e-06,
485
+ "loss": 6.2027,
486
+ "step": 680
487
+ },
488
+ {
489
+ "epoch": 0.2085064591674851,
490
+ "grad_norm": 41.593204498291016,
491
+ "learning_rate": 9.188859393515382e-06,
492
+ "loss": 4.8472,
493
+ "step": 690
494
+ },
495
+ {
496
+ "epoch": 0.21152829190904285,
497
+ "grad_norm": 24.661819458007812,
498
+ "learning_rate": 9.16193154308638e-06,
499
+ "loss": 6.0424,
500
+ "step": 700
501
+ },
502
+ {
503
+ "epoch": 0.21455012465060058,
504
+ "grad_norm": 35.47103500366211,
505
+ "learning_rate": 9.13460480391922e-06,
506
+ "loss": 6.2253,
507
+ "step": 710
508
+ },
509
+ {
510
+ "epoch": 0.21757195739215834,
511
+ "grad_norm": 37.96540069580078,
512
+ "learning_rate": 9.106881795069116e-06,
513
+ "loss": 6.4773,
514
+ "step": 720
515
+ },
516
+ {
517
+ "epoch": 0.2205937901337161,
518
+ "grad_norm": 18.79058074951172,
519
+ "learning_rate": 9.078765173570649e-06,
520
+ "loss": 3.1354,
521
+ "step": 730
522
+ },
523
+ {
524
+ "epoch": 0.22361562287527387,
525
+ "grad_norm": 18.278860092163086,
526
+ "learning_rate": 9.0502576341831e-06,
527
+ "loss": 4.0845,
528
+ "step": 740
529
+ },
530
+ {
531
+ "epoch": 0.2266374556168316,
532
+ "grad_norm": 21.75337791442871,
533
+ "learning_rate": 9.02136190913219e-06,
534
+ "loss": 5.4407,
535
+ "step": 750
536
+ },
537
+ {
538
+ "epoch": 0.22965928835838936,
539
+ "grad_norm": 36.95095443725586,
540
+ "learning_rate": 8.99208076784822e-06,
541
+ "loss": 4.6502,
542
+ "step": 760
543
+ },
544
+ {
545
+ "epoch": 0.23268112109994712,
546
+ "grad_norm": 14.346115112304688,
547
+ "learning_rate": 8.962417016700624e-06,
548
+ "loss": 3.0298,
549
+ "step": 770
550
+ },
551
+ {
552
+ "epoch": 0.2357029538415049,
553
+ "grad_norm": 22.408119201660156,
554
+ "learning_rate": 8.932373498729026e-06,
555
+ "loss": 4.6357,
556
+ "step": 780
557
+ },
558
+ {
559
+ "epoch": 0.23872478658306262,
560
+ "grad_norm": 23.731843948364258,
561
+ "learning_rate": 8.901953093370734e-06,
562
+ "loss": 4.0057,
563
+ "step": 790
564
+ },
565
+ {
566
+ "epoch": 0.24174661932462038,
567
+ "grad_norm": 21.797941207885742,
568
+ "learning_rate": 8.871158716184784e-06,
569
+ "loss": 3.9041,
570
+ "step": 800
571
+ },
572
+ {
573
+ "epoch": 0.24476845206617814,
574
+ "grad_norm": 32.5623893737793,
575
+ "learning_rate": 8.839993318572497e-06,
576
+ "loss": 4.8501,
577
+ "step": 810
578
+ },
579
+ {
580
+ "epoch": 0.2477902848077359,
581
+ "grad_norm": 18.512962341308594,
582
+ "learning_rate": 8.808459887494617e-06,
583
+ "loss": 3.05,
584
+ "step": 820
585
+ },
586
+ {
587
+ "epoch": 0.25081211754929367,
588
+ "grad_norm": 16.462116241455078,
589
+ "learning_rate": 8.77656144518502e-06,
590
+ "loss": 3.8237,
591
+ "step": 830
592
+ },
593
+ {
594
+ "epoch": 0.25383395029085143,
595
+ "grad_norm": 18.127500534057617,
596
+ "learning_rate": 8.744301048861083e-06,
597
+ "loss": 2.9264,
598
+ "step": 840
599
+ },
600
+ {
601
+ "epoch": 0.25685578303240914,
602
+ "grad_norm": 22.66571044921875,
603
+ "learning_rate": 8.711681790430646e-06,
604
+ "loss": 2.9888,
605
+ "step": 850
606
+ },
607
+ {
608
+ "epoch": 0.2598776157739669,
609
+ "grad_norm": 24.76766586303711,
610
+ "learning_rate": 8.678706796195694e-06,
611
+ "loss": 4.7451,
612
+ "step": 860
613
+ },
614
+ {
615
+ "epoch": 0.26289944851552466,
616
+ "grad_norm": 20.290781021118164,
617
+ "learning_rate": 8.645379226552712e-06,
618
+ "loss": 3.7028,
619
+ "step": 870
620
+ },
621
+ {
622
+ "epoch": 0.2659212812570824,
623
+ "grad_norm": 19.00446891784668,
624
+ "learning_rate": 8.611702275689805e-06,
625
+ "loss": 4.6546,
626
+ "step": 880
627
+ },
628
+ {
629
+ "epoch": 0.2689431139986402,
630
+ "grad_norm": 34.68561935424805,
631
+ "learning_rate": 8.577679171280538e-06,
632
+ "loss": 4.4799,
633
+ "step": 890
634
+ },
635
+ {
636
+ "epoch": 0.27196494674019794,
637
+ "grad_norm": 18.584571838378906,
638
+ "learning_rate": 8.543313174174601e-06,
639
+ "loss": 5.2755,
640
+ "step": 900
641
+ },
642
+ {
643
+ "epoch": 0.2749867794817557,
644
+ "grad_norm": 23.914329528808594,
645
+ "learning_rate": 8.508607578085281e-06,
646
+ "loss": 3.846,
647
+ "step": 910
648
+ },
649
+ {
650
+ "epoch": 0.27800861222331347,
651
+ "grad_norm": 21.329547882080078,
652
+ "learning_rate": 8.473565709273786e-06,
653
+ "loss": 3.8483,
654
+ "step": 920
655
+ },
656
+ {
657
+ "epoch": 0.2810304449648712,
658
+ "grad_norm": 14.663247108459473,
659
+ "learning_rate": 8.438190926230439e-06,
660
+ "loss": 3.8175,
661
+ "step": 930
662
+ },
663
+ {
664
+ "epoch": 0.28405227770642894,
665
+ "grad_norm": 32.22755432128906,
666
+ "learning_rate": 8.40248661935281e-06,
667
+ "loss": 4.3899,
668
+ "step": 940
669
+ },
670
+ {
671
+ "epoch": 0.2870741104479867,
672
+ "grad_norm": 24.638607025146484,
673
+ "learning_rate": 8.366456210620756e-06,
674
+ "loss": 3.1177,
675
+ "step": 950
676
+ },
677
+ {
678
+ "epoch": 0.29009594318954446,
679
+ "grad_norm": 33.2247428894043,
680
+ "learning_rate": 8.330103153268464e-06,
681
+ "loss": 3.7424,
682
+ "step": 960
683
+ },
684
+ {
685
+ "epoch": 0.2931177759311022,
686
+ "grad_norm": 20.71030616760254,
687
+ "learning_rate": 8.29343093145347e-06,
688
+ "loss": 3.6926,
689
+ "step": 970
690
+ },
691
+ {
692
+ "epoch": 0.29613960867266,
693
+ "grad_norm": 21.19091033935547,
694
+ "learning_rate": 8.25644305992275e-06,
695
+ "loss": 3.6266,
696
+ "step": 980
697
+ },
698
+ {
699
+ "epoch": 0.29916144141421774,
700
+ "grad_norm": 19.403636932373047,
701
+ "learning_rate": 8.21914308367584e-06,
702
+ "loss": 4.561,
703
+ "step": 990
704
+ },
705
+ {
706
+ "epoch": 0.3021832741557755,
707
+ "grad_norm": 20.385461807250977,
708
+ "learning_rate": 8.181534577625088e-06,
709
+ "loss": 3.7729,
710
+ "step": 1000
711
+ },
712
+ {
713
+ "epoch": 0.3052051068973332,
714
+ "grad_norm": 16.03277587890625,
715
+ "learning_rate": 8.143621146253022e-06,
716
+ "loss": 4.5904,
717
+ "step": 1010
718
+ },
719
+ {
720
+ "epoch": 0.308226939638891,
721
+ "grad_norm": 17.92051887512207,
722
+ "learning_rate": 8.105406423266884e-06,
723
+ "loss": 4.6473,
724
+ "step": 1020
725
+ },
726
+ {
727
+ "epoch": 0.31124877238044873,
728
+ "grad_norm": 19.62211036682129,
729
+ "learning_rate": 8.066894071250374e-06,
730
+ "loss": 4.4546,
731
+ "step": 1030
732
+ },
733
+ {
734
+ "epoch": 0.3142706051220065,
735
+ "grad_norm": 18.912364959716797,
736
+ "learning_rate": 8.02808778131262e-06,
737
+ "loss": 3.8032,
738
+ "step": 1040
739
+ },
740
+ {
741
+ "epoch": 0.31729243786356426,
742
+ "grad_norm": 17.066823959350586,
743
+ "learning_rate": 7.988991272734407e-06,
744
+ "loss": 4.4699,
745
+ "step": 1050
746
+ },
747
+ {
748
+ "epoch": 0.320314270605122,
749
+ "grad_norm": 19.543676376342773,
750
+ "learning_rate": 7.94960829261172e-06,
751
+ "loss": 4.4354,
752
+ "step": 1060
753
+ },
754
+ {
755
+ "epoch": 0.3233361033466798,
756
+ "grad_norm": 21.18368911743164,
757
+ "learning_rate": 7.909942615496613e-06,
758
+ "loss": 4.7008,
759
+ "step": 1070
760
+ },
761
+ {
762
+ "epoch": 0.32635793608823754,
763
+ "grad_norm": 29.533164978027344,
764
+ "learning_rate": 7.869998043035442e-06,
765
+ "loss": 5.3891,
766
+ "step": 1080
767
+ },
768
+ {
769
+ "epoch": 0.32937976882979525,
770
+ "grad_norm": 14.957313537597656,
771
+ "learning_rate": 7.829778403604512e-06,
772
+ "loss": 5.0378,
773
+ "step": 1090
774
+ },
775
+ {
776
+ "epoch": 0.332401601571353,
777
+ "grad_norm": 33.31967544555664,
778
+ "learning_rate": 7.789287551943158e-06,
779
+ "loss": 6.0914,
780
+ "step": 1100
781
+ },
782
+ {
783
+ "epoch": 0.3354234343129108,
784
+ "grad_norm": 17.046133041381836,
785
+ "learning_rate": 7.748529368784293e-06,
786
+ "loss": 4.5389,
787
+ "step": 1110
788
+ },
789
+ {
790
+ "epoch": 0.33844526705446853,
791
+ "grad_norm": 16.102283477783203,
792
+ "learning_rate": 7.707507760482473e-06,
793
+ "loss": 6.1424,
794
+ "step": 1120
795
+ },
796
+ {
797
+ "epoch": 0.3414670997960263,
798
+ "grad_norm": 16.310462951660156,
799
+ "learning_rate": 7.666226658639507e-06,
800
+ "loss": 3.7652,
801
+ "step": 1130
802
+ },
803
+ {
804
+ "epoch": 0.34448893253758406,
805
+ "grad_norm": 22.625951766967773,
806
+ "learning_rate": 7.624690019727636e-06,
807
+ "loss": 3.6742,
808
+ "step": 1140
809
+ },
810
+ {
811
+ "epoch": 0.3475107652791418,
812
+ "grad_norm": 21.400938034057617,
813
+ "learning_rate": 7.58290182471034e-06,
814
+ "loss": 4.5513,
815
+ "step": 1150
816
+ },
817
+ {
818
+ "epoch": 0.3505325980206996,
819
+ "grad_norm": 14.196311950683594,
820
+ "learning_rate": 7.5408660786607976e-06,
821
+ "loss": 3.6687,
822
+ "step": 1160
823
+ },
824
+ {
825
+ "epoch": 0.3535544307622573,
826
+ "grad_norm": 19.97701644897461,
827
+ "learning_rate": 7.498586810378019e-06,
828
+ "loss": 2.9966,
829
+ "step": 1170
830
+ },
831
+ {
832
+ "epoch": 0.35657626350381505,
833
+ "grad_norm": 18.132966995239258,
834
+ "learning_rate": 7.456068072000731e-06,
835
+ "loss": 2.809,
836
+ "step": 1180
837
+ },
838
+ {
839
+ "epoch": 0.3595980962453728,
840
+ "grad_norm": 22.550369262695312,
841
+ "learning_rate": 7.4133139386190026e-06,
842
+ "loss": 4.5377,
843
+ "step": 1190
844
+ },
845
+ {
846
+ "epoch": 0.3626199289869306,
847
+ "grad_norm": 15.473170280456543,
848
+ "learning_rate": 7.3703285078836796e-06,
849
+ "loss": 5.1951,
850
+ "step": 1200
851
+ },
852
+ {
853
+ "epoch": 0.36564176172848833,
854
+ "grad_norm": 17.210092544555664,
855
+ "learning_rate": 7.3271158996136625e-06,
856
+ "loss": 3.7087,
857
+ "step": 1210
858
+ },
859
+ {
860
+ "epoch": 0.3686635944700461,
861
+ "grad_norm": 15.88957691192627,
862
+ "learning_rate": 7.283680255401049e-06,
863
+ "loss": 4.4085,
864
+ "step": 1220
865
+ },
866
+ {
867
+ "epoch": 0.37168542721160386,
868
+ "grad_norm": 20.273908615112305,
869
+ "learning_rate": 7.240025738214193e-06,
870
+ "loss": 6.2167,
871
+ "step": 1230
872
+ },
873
+ {
874
+ "epoch": 0.3747072599531616,
875
+ "grad_norm": 31.755516052246094,
876
+ "learning_rate": 7.196156531998718e-06,
877
+ "loss": 4.532,
878
+ "step": 1240
879
+ },
880
+ {
881
+ "epoch": 0.3777290926947193,
882
+ "grad_norm": 20.531906127929688,
883
+ "learning_rate": 7.152076841276527e-06,
884
+ "loss": 3.6233,
885
+ "step": 1250
886
+ },
887
+ {
888
+ "epoch": 0.3807509254362771,
889
+ "grad_norm": 18.760116577148438,
890
+ "learning_rate": 7.1077908907428154e-06,
891
+ "loss": 3.7953,
892
+ "step": 1260
893
+ },
894
+ {
895
+ "epoch": 0.38377275817783485,
896
+ "grad_norm": 31.519561767578125,
897
+ "learning_rate": 7.063302924861182e-06,
898
+ "loss": 3.8545,
899
+ "step": 1270
900
+ },
901
+ {
902
+ "epoch": 0.3867945909193926,
903
+ "grad_norm": 23.91765022277832,
904
+ "learning_rate": 7.018617207456821e-06,
905
+ "loss": 3.6115,
906
+ "step": 1280
907
+ },
908
+ {
909
+ "epoch": 0.3898164236609504,
910
+ "grad_norm": 16.870439529418945,
911
+ "learning_rate": 6.973738021307872e-06,
912
+ "loss": 3.6868,
913
+ "step": 1290
914
+ },
915
+ {
916
+ "epoch": 0.39283825640250813,
917
+ "grad_norm": 18.010969161987305,
918
+ "learning_rate": 6.9286696677349455e-06,
919
+ "loss": 5.9382,
920
+ "step": 1300
921
+ },
922
+ {
923
+ "epoch": 0.3958600891440659,
924
+ "grad_norm": 16.40668296813965,
925
+ "learning_rate": 6.883416466188881e-06,
926
+ "loss": 3.7045,
927
+ "step": 1310
928
+ },
929
+ {
930
+ "epoch": 0.39888192188562366,
931
+ "grad_norm": 15.330764770507812,
932
+ "learning_rate": 6.837982753836755e-06,
933
+ "loss": 2.8419,
934
+ "step": 1320
935
+ },
936
+ {
937
+ "epoch": 0.40190375462718136,
938
+ "grad_norm": 33.37950897216797,
939
+ "learning_rate": 6.7923728851461955e-06,
940
+ "loss": 6.0184,
941
+ "step": 1330
942
+ },
943
+ {
944
+ "epoch": 0.4049255873687391,
945
+ "grad_norm": 21.508163452148438,
946
+ "learning_rate": 6.74659123146805e-06,
947
+ "loss": 3.6311,
948
+ "step": 1340
949
+ },
950
+ {
951
+ "epoch": 0.4079474201102969,
952
+ "grad_norm": 16.043455123901367,
953
+ "learning_rate": 6.70064218061742e-06,
954
+ "loss": 2.8293,
955
+ "step": 1350
956
+ },
957
+ {
958
+ "epoch": 0.41096925285185465,
959
+ "grad_norm": 16.867509841918945,
960
+ "learning_rate": 6.654530136453119e-06,
961
+ "loss": 4.3584,
962
+ "step": 1360
963
+ },
964
+ {
965
+ "epoch": 0.4139910855934124,
966
+ "grad_norm": 19.85649871826172,
967
+ "learning_rate": 6.608259518455599e-06,
968
+ "loss": 5.2523,
969
+ "step": 1370
970
+ },
971
+ {
972
+ "epoch": 0.4170129183349702,
973
+ "grad_norm": 14.44941520690918,
974
+ "learning_rate": 6.5618347613033875e-06,
975
+ "loss": 5.0827,
976
+ "step": 1380
977
+ },
978
+ {
979
+ "epoch": 0.42003475107652793,
980
+ "grad_norm": 18.058303833007812,
981
+ "learning_rate": 6.5152603144480406e-06,
982
+ "loss": 5.9903,
983
+ "step": 1390
984
+ },
985
+ {
986
+ "epoch": 0.4230565838180857,
987
+ "grad_norm": 30.503751754760742,
988
+ "learning_rate": 6.468540641687716e-06,
989
+ "loss": 4.5515,
990
+ "step": 1400
991
+ },
992
+ {
993
+ "epoch": 0.4260784165596434,
994
+ "grad_norm": 18.618654251098633,
995
+ "learning_rate": 6.421680220739337e-06,
996
+ "loss": 3.9462,
997
+ "step": 1410
998
+ },
999
+ {
1000
+ "epoch": 0.42910024930120116,
1001
+ "grad_norm": 32.41435623168945,
1002
+ "learning_rate": 6.374683542809447e-06,
1003
+ "loss": 7.8369,
1004
+ "step": 1420
1005
+ },
1006
+ {
1007
+ "epoch": 0.4321220820427589,
1008
+ "grad_norm": 19.87618637084961,
1009
+ "learning_rate": 6.327555112163761e-06,
1010
+ "loss": 4.3855,
1011
+ "step": 1430
1012
+ },
1013
+ {
1014
+ "epoch": 0.4351439147843167,
1015
+ "grad_norm": 17.212278366088867,
1016
+ "learning_rate": 6.280299445695469e-06,
1017
+ "loss": 5.1971,
1018
+ "step": 1440
1019
+ },
1020
+ {
1021
+ "epoch": 0.43816574752587445,
1022
+ "grad_norm": 21.317800521850586,
1023
+ "learning_rate": 6.232921072492319e-06,
1024
+ "loss": 4.3216,
1025
+ "step": 1450
1026
+ },
1027
+ {
1028
+ "epoch": 0.4411875802674322,
1029
+ "grad_norm": 23.228479385375977,
1030
+ "learning_rate": 6.185424533402543e-06,
1031
+ "loss": 4.3291,
1032
+ "step": 1460
1033
+ },
1034
+ {
1035
+ "epoch": 0.44420941300899,
1036
+ "grad_norm": 19.224565505981445,
1037
+ "learning_rate": 6.13781438059966e-06,
1038
+ "loss": 3.5382,
1039
+ "step": 1470
1040
+ },
1041
+ {
1042
+ "epoch": 0.44723124575054773,
1043
+ "grad_norm": 33.251380920410156,
1044
+ "learning_rate": 6.090095177146178e-06,
1045
+ "loss": 5.1775,
1046
+ "step": 1480
1047
+ },
1048
+ {
1049
+ "epoch": 0.45025307849210544,
1050
+ "grad_norm": 16.563169479370117,
1051
+ "learning_rate": 6.042271496556255e-06,
1052
+ "loss": 2.8536,
1053
+ "step": 1490
1054
+ },
1055
+ {
1056
+ "epoch": 0.4532749112336632,
1057
+ "grad_norm": 22.154621124267578,
1058
+ "learning_rate": 5.994347922357372e-06,
1059
+ "loss": 3.8333,
1060
+ "step": 1500
1061
+ },
1062
+ {
1063
+ "epoch": 0.45629674397522096,
1064
+ "grad_norm": 20.189830780029297,
1065
+ "learning_rate": 5.946329047651037e-06,
1066
+ "loss": 3.5955,
1067
+ "step": 1510
1068
+ },
1069
+ {
1070
+ "epoch": 0.4593185767167787,
1071
+ "grad_norm": 30.116336822509766,
1072
+ "learning_rate": 5.8982194746725686e-06,
1073
+ "loss": 2.7101,
1074
+ "step": 1520
1075
+ },
1076
+ {
1077
+ "epoch": 0.4623404094583365,
1078
+ "grad_norm": 21.328214645385742,
1079
+ "learning_rate": 5.850023814350007e-06,
1080
+ "loss": 4.2863,
1081
+ "step": 1530
1082
+ },
1083
+ {
1084
+ "epoch": 0.46536224219989425,
1085
+ "grad_norm": 15.175004005432129,
1086
+ "learning_rate": 5.801746685862197e-06,
1087
+ "loss": 6.1059,
1088
+ "step": 1540
1089
+ },
1090
+ {
1091
+ "epoch": 0.468384074941452,
1092
+ "grad_norm": 15.263406753540039,
1093
+ "learning_rate": 5.753392716196069e-06,
1094
+ "loss": 2.8679,
1095
+ "step": 1550
1096
+ },
1097
+ {
1098
+ "epoch": 0.4714059076830098,
1099
+ "grad_norm": 14.840780258178711,
1100
+ "learning_rate": 5.704966539703185e-06,
1101
+ "loss": 3.6484,
1102
+ "step": 1560
1103
+ },
1104
+ {
1105
+ "epoch": 0.4744277404245675,
1106
+ "grad_norm": 16.718647003173828,
1107
+ "learning_rate": 5.656472797655571e-06,
1108
+ "loss": 4.4473,
1109
+ "step": 1570
1110
+ },
1111
+ {
1112
+ "epoch": 0.47744957316612524,
1113
+ "grad_norm": 15.991732597351074,
1114
+ "learning_rate": 5.60791613780088e-06,
1115
+ "loss": 2.7819,
1116
+ "step": 1580
1117
+ },
1118
+ {
1119
+ "epoch": 0.480471405907683,
1120
+ "grad_norm": 21.31011390686035,
1121
+ "learning_rate": 5.5593012139169525e-06,
1122
+ "loss": 4.3017,
1123
+ "step": 1590
1124
+ },
1125
+ {
1126
+ "epoch": 0.48349323864924076,
1127
+ "grad_norm": 19.14992332458496,
1128
+ "learning_rate": 5.510632685365777e-06,
1129
+ "loss": 4.443,
1130
+ "step": 1600
1131
+ },
1132
+ {
1133
+ "epoch": 0.4865150713907985,
1134
+ "grad_norm": 16.440427780151367,
1135
+ "learning_rate": 5.461915216646938e-06,
1136
+ "loss": 2.8006,
1137
+ "step": 1610
1138
+ },
1139
+ {
1140
+ "epoch": 0.4895369041323563,
1141
+ "grad_norm": 22.039566040039062,
1142
+ "learning_rate": 5.41315347695055e-06,
1143
+ "loss": 4.2488,
1144
+ "step": 1620
1145
+ },
1146
+ {
1147
+ "epoch": 0.49255873687391405,
1148
+ "grad_norm": 17.224102020263672,
1149
+ "learning_rate": 5.364352139709758e-06,
1150
+ "loss": 4.9229,
1151
+ "step": 1630
1152
+ },
1153
+ {
1154
+ "epoch": 0.4955805696154718,
1155
+ "grad_norm": 15.041423797607422,
1156
+ "learning_rate": 5.315515882152822e-06,
1157
+ "loss": 3.5541,
1158
+ "step": 1640
1159
+ },
1160
+ {
1161
+ "epoch": 0.4986024023570295,
1162
+ "grad_norm": 16.443140029907227,
1163
+ "learning_rate": 5.266649384854842e-06,
1164
+ "loss": 4.2881,
1165
+ "step": 1650
1166
+ },
1167
+ {
1168
+ "epoch": 0.5016242350985873,
1169
+ "grad_norm": 20.163755416870117,
1170
+ "learning_rate": 5.217757331289165e-06,
1171
+ "loss": 3.721,
1172
+ "step": 1660
1173
+ },
1174
+ {
1175
+ "epoch": 0.5046460678401451,
1176
+ "grad_norm": 16.496013641357422,
1177
+ "learning_rate": 5.168844407378506e-06,
1178
+ "loss": 4.8698,
1179
+ "step": 1670
1180
+ },
1181
+ {
1182
+ "epoch": 0.5076679005817029,
1183
+ "grad_norm": 12.180791854858398,
1184
+ "learning_rate": 5.119915301045836e-06,
1185
+ "loss": 2.9101,
1186
+ "step": 1680
1187
+ },
1188
+ {
1189
+ "epoch": 0.5106897333232605,
1190
+ "grad_norm": 22.121103286743164,
1191
+ "learning_rate": 5.070974701765089e-06,
1192
+ "loss": 5.189,
1193
+ "step": 1690
1194
+ },
1195
+ {
1196
+ "epoch": 0.5137115660648183,
1197
+ "grad_norm": 19.323467254638672,
1198
+ "learning_rate": 5.022027300111712e-06,
1199
+ "loss": 4.3854,
1200
+ "step": 1700
1201
+ },
1202
+ {
1203
+ "epoch": 0.516733398806376,
1204
+ "grad_norm": 16.899927139282227,
1205
+ "learning_rate": 4.973077787313099e-06,
1206
+ "loss": 4.526,
1207
+ "step": 1710
1208
+ },
1209
+ {
1210
+ "epoch": 0.5197552315479338,
1211
+ "grad_norm": 15.249711036682129,
1212
+ "learning_rate": 4.924130854798983e-06,
1213
+ "loss": 5.1185,
1214
+ "step": 1720
1215
+ },
1216
+ {
1217
+ "epoch": 0.5227770642894916,
1218
+ "grad_norm": 14.765595436096191,
1219
+ "learning_rate": 4.875191193751803e-06,
1220
+ "loss": 2.7791,
1221
+ "step": 1730
1222
+ },
1223
+ {
1224
+ "epoch": 0.5257988970310493,
1225
+ "grad_norm": 20.05950164794922,
1226
+ "learning_rate": 4.826263494657077e-06,
1227
+ "loss": 3.511,
1228
+ "step": 1740
1229
+ },
1230
+ {
1231
+ "epoch": 0.5288207297726071,
1232
+ "grad_norm": 34.354034423828125,
1233
+ "learning_rate": 4.777352446853863e-06,
1234
+ "loss": 5.0201,
1235
+ "step": 1750
1236
+ },
1237
+ {
1238
+ "epoch": 0.5318425625141648,
1239
+ "grad_norm": 20.756092071533203,
1240
+ "learning_rate": 4.72846273808533e-06,
1241
+ "loss": 3.5231,
1242
+ "step": 1760
1243
+ },
1244
+ {
1245
+ "epoch": 0.5348643952557226,
1246
+ "grad_norm": 17.004915237426758,
1247
+ "learning_rate": 4.679599054049458e-06,
1248
+ "loss": 3.3843,
1249
+ "step": 1770
1250
+ },
1251
+ {
1252
+ "epoch": 0.5378862279972804,
1253
+ "grad_norm": 21.614294052124023,
1254
+ "learning_rate": 4.630766077949965e-06,
1255
+ "loss": 5.98,
1256
+ "step": 1780
1257
+ },
1258
+ {
1259
+ "epoch": 0.5409080607388381,
1260
+ "grad_norm": 32.01701354980469,
1261
+ "learning_rate": 4.5819684900474484e-06,
1262
+ "loss": 4.3486,
1263
+ "step": 1790
1264
+ },
1265
+ {
1266
+ "epoch": 0.5439298934803959,
1267
+ "grad_norm": 14.644387245178223,
1268
+ "learning_rate": 4.5332109672108245e-06,
1269
+ "loss": 4.4888,
1270
+ "step": 1800
1271
+ },
1272
+ {
1273
+ "epoch": 0.5469517262219536,
1274
+ "grad_norm": 13.374945640563965,
1275
+ "learning_rate": 4.484498182469085e-06,
1276
+ "loss": 3.6398,
1277
+ "step": 1810
1278
+ },
1279
+ {
1280
+ "epoch": 0.5499735589635114,
1281
+ "grad_norm": 17.148927688598633,
1282
+ "learning_rate": 4.435834804563422e-06,
1283
+ "loss": 5.9183,
1284
+ "step": 1820
1285
+ },
1286
+ {
1287
+ "epoch": 0.5529953917050692,
1288
+ "grad_norm": 18.936981201171875,
1289
+ "learning_rate": 4.387225497499767e-06,
1290
+ "loss": 3.6337,
1291
+ "step": 1830
1292
+ },
1293
+ {
1294
+ "epoch": 0.5560172244466269,
1295
+ "grad_norm": 17.948814392089844,
1296
+ "learning_rate": 4.3386749201017856e-06,
1297
+ "loss": 3.4775,
1298
+ "step": 1840
1299
+ },
1300
+ {
1301
+ "epoch": 0.5590390571881846,
1302
+ "grad_norm": 14.527155876159668,
1303
+ "learning_rate": 4.290187725564356e-06,
1304
+ "loss": 6.0241,
1305
+ "step": 1850
1306
+ },
1307
+ {
1308
+ "epoch": 0.5620608899297423,
1309
+ "grad_norm": 14.412932395935059,
1310
+ "learning_rate": 4.2417685610076135e-06,
1311
+ "loss": 3.4722,
1312
+ "step": 1860
1313
+ },
1314
+ {
1315
+ "epoch": 0.5650827226713001,
1316
+ "grad_norm": 14.845317840576172,
1317
+ "learning_rate": 4.193422067031535e-06,
1318
+ "loss": 4.3061,
1319
+ "step": 1870
1320
+ },
1321
+ {
1322
+ "epoch": 0.5681045554128579,
1323
+ "grad_norm": 16.743505477905273,
1324
+ "learning_rate": 4.145152877271196e-06,
1325
+ "loss": 4.1782,
1326
+ "step": 1880
1327
+ },
1328
+ {
1329
+ "epoch": 0.5711263881544156,
1330
+ "grad_norm": 17.867549896240234,
1331
+ "learning_rate": 4.096965617952667e-06,
1332
+ "loss": 4.4313,
1333
+ "step": 1890
1334
+ },
1335
+ {
1336
+ "epoch": 0.5741482208959734,
1337
+ "grad_norm": 21.779705047607422,
1338
+ "learning_rate": 4.048864907449619e-06,
1339
+ "loss": 3.5466,
1340
+ "step": 1900
1341
+ },
1342
+ {
1343
+ "epoch": 0.5771700536375312,
1344
+ "grad_norm": 18.34054183959961,
1345
+ "learning_rate": 4.000855355840695e-06,
1346
+ "loss": 3.5575,
1347
+ "step": 1910
1348
+ },
1349
+ {
1350
+ "epoch": 0.5801918863790889,
1351
+ "grad_norm": 16.225175857543945,
1352
+ "learning_rate": 3.952941564467665e-06,
1353
+ "loss": 4.307,
1354
+ "step": 1920
1355
+ },
1356
+ {
1357
+ "epoch": 0.5832137191206467,
1358
+ "grad_norm": 17.98233413696289,
1359
+ "learning_rate": 3.905128125494427e-06,
1360
+ "loss": 4.3588,
1361
+ "step": 1930
1362
+ },
1363
+ {
1364
+ "epoch": 0.5862355518622044,
1365
+ "grad_norm": 32.549110412597656,
1366
+ "learning_rate": 3.8574196214668876e-06,
1367
+ "loss": 4.5427,
1368
+ "step": 1940
1369
+ },
1370
+ {
1371
+ "epoch": 0.5892573846037622,
1372
+ "grad_norm": 29.19014549255371,
1373
+ "learning_rate": 3.8098206248737486e-06,
1374
+ "loss": 5.1964,
1375
+ "step": 1950
1376
+ },
1377
+ {
1378
+ "epoch": 0.59227921734532,
1379
+ "grad_norm": 19.058385848999023,
1380
+ "learning_rate": 3.7623356977082794e-06,
1381
+ "loss": 2.615,
1382
+ "step": 1960
1383
+ },
1384
+ {
1385
+ "epoch": 0.5953010500868777,
1386
+ "grad_norm": 17.663314819335938,
1387
+ "learning_rate": 3.714969391031084e-06,
1388
+ "loss": 4.3326,
1389
+ "step": 1970
1390
+ },
1391
+ {
1392
+ "epoch": 0.5983228828284355,
1393
+ "grad_norm": 15.665877342224121,
1394
+ "learning_rate": 3.6677262445339136e-06,
1395
+ "loss": 3.6268,
1396
+ "step": 1980
1397
+ },
1398
+ {
1399
+ "epoch": 0.6013447155699932,
1400
+ "grad_norm": 18.564617156982422,
1401
+ "learning_rate": 3.6206107861045803e-06,
1402
+ "loss": 2.6497,
1403
+ "step": 1990
1404
+ },
1405
+ {
1406
+ "epoch": 0.604366548311551,
1407
+ "grad_norm": 13.690784454345703,
1408
+ "learning_rate": 3.5736275313929826e-06,
1409
+ "loss": 4.3688,
1410
+ "step": 2000
1411
+ }
1412
+ ],
1413
+ "logging_steps": 10,
1414
+ "max_steps": 3309,
1415
+ "num_input_tokens_seen": 0,
1416
+ "num_train_epochs": 1,
1417
+ "save_steps": 1000,
1418
+ "stateful_callbacks": {
1419
+ "TrainerControl": {
1420
+ "args": {
1421
+ "should_epoch_stop": false,
1422
+ "should_evaluate": false,
1423
+ "should_log": false,
1424
+ "should_save": true,
1425
+ "should_training_stop": false
1426
+ },
1427
+ "attributes": {}
1428
+ }
1429
+ },
1430
+ "total_flos": 7.113757083291353e+18,
1431
+ "train_batch_size": 1,
1432
+ "trial_name": null,
1433
+ "trial_params": null
1434
+ }
checkpoint-2000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fdf3cfd8ae404b89444346cfcb519afd77a9396cab7149d66c5223a19ec7f70
3
+ size 7697
checkpoint-2000/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-2000/zero_to_fp32.py ADDED
@@ -0,0 +1,760 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 gc
25
+ import json
26
+ import numpy as np
27
+ from tqdm import tqdm
28
+ from collections import OrderedDict
29
+ from dataclasses import dataclass
30
+
31
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
32
+ # DeepSpeed data structures it has to be available in the current python environment.
33
+ from deepspeed.utils import logger
34
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
35
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
36
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
37
+
38
+
39
+ @dataclass
40
+ class zero_model_state:
41
+ buffers: dict()
42
+ param_shapes: dict()
43
+ shared_params: list
44
+ ds_version: int
45
+ frozen_param_shapes: dict()
46
+ frozen_param_fragments: dict()
47
+
48
+
49
+ debug = 0
50
+
51
+ # load to cpu
52
+ device = torch.device('cpu')
53
+
54
+
55
+ def atoi(text):
56
+ return int(text) if text.isdigit() else text
57
+
58
+
59
+ def natural_keys(text):
60
+ '''
61
+ alist.sort(key=natural_keys) sorts in human order
62
+ http://nedbatchelder.com/blog/200712/human_sorting.html
63
+ (See Toothy's implementation in the comments)
64
+ '''
65
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
66
+
67
+
68
+ def get_model_state_file(checkpoint_dir, zero_stage):
69
+ if not os.path.isdir(checkpoint_dir):
70
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
71
+
72
+ # there should be only one file
73
+ if zero_stage <= 2:
74
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
75
+ elif zero_stage == 3:
76
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
77
+
78
+ if not os.path.exists(file):
79
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
80
+
81
+ return file
82
+
83
+
84
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
85
+ # XXX: need to test that this simple glob rule works for multi-node setup too
86
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
87
+
88
+ if len(ckpt_files) == 0:
89
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
90
+
91
+ return ckpt_files
92
+
93
+
94
+ def get_optim_files(checkpoint_dir):
95
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
96
+
97
+
98
+ def get_model_state_files(checkpoint_dir):
99
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
100
+
101
+
102
+ def parse_model_states(files):
103
+ zero_model_states = []
104
+ for file in files:
105
+ state_dict = torch.load(file, map_location=device, weights_only=False)
106
+
107
+ if BUFFER_NAMES not in state_dict:
108
+ raise ValueError(f"{file} is not a model state checkpoint")
109
+ buffer_names = state_dict[BUFFER_NAMES]
110
+ if debug:
111
+ print("Found buffers:", buffer_names)
112
+
113
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
114
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
115
+ param_shapes = state_dict[PARAM_SHAPES]
116
+
117
+ # collect parameters that are included in param_shapes
118
+ param_names = []
119
+ for s in param_shapes:
120
+ for name in s.keys():
121
+ param_names.append(name)
122
+
123
+ # update with frozen parameters
124
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
125
+ if frozen_param_shapes is not None:
126
+ if debug:
127
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
128
+ param_names += list(frozen_param_shapes.keys())
129
+
130
+ # handle shared params
131
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
132
+
133
+ ds_version = state_dict.get(DS_VERSION, None)
134
+
135
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
136
+
137
+ z_model_state = zero_model_state(buffers=buffers,
138
+ param_shapes=param_shapes,
139
+ shared_params=shared_params,
140
+ ds_version=ds_version,
141
+ frozen_param_shapes=frozen_param_shapes,
142
+ frozen_param_fragments=frozen_param_fragments)
143
+ zero_model_states.append(z_model_state)
144
+
145
+ return zero_model_states
146
+
147
+
148
+ def parse_optim_states(files, ds_checkpoint_dir):
149
+ total_files = len(files)
150
+ state_dicts = []
151
+ for f in tqdm(files, desc='Loading checkpoint shards'):
152
+ state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
153
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
154
+ # and also handle the case where it was already removed by another helper script
155
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
156
+ state_dicts.append(state_dict)
157
+
158
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
159
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
160
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
161
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
162
+
163
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
164
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
165
+ # use the max of the partition_count to get the dp world_size.
166
+
167
+ if type(world_size) is list:
168
+ world_size = max(world_size)
169
+
170
+ if world_size != total_files:
171
+ raise ValueError(
172
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
173
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
174
+ )
175
+
176
+ # the groups are named differently in each stage
177
+ if zero_stage <= 2:
178
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
179
+ elif zero_stage == 3:
180
+ fp32_groups_key = FP32_FLAT_GROUPS
181
+ else:
182
+ raise ValueError(f"unknown zero stage {zero_stage}")
183
+
184
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
185
+ return zero_stage, world_size, fp32_flat_groups
186
+
187
+
188
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
189
+ """
190
+ Returns fp32 state_dict reconstructed from ds checkpoint
191
+
192
+ Args:
193
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
194
+
195
+ """
196
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
197
+
198
+ optim_files = get_optim_files(ds_checkpoint_dir)
199
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
200
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
201
+
202
+ model_files = get_model_state_files(ds_checkpoint_dir)
203
+
204
+ zero_model_states = parse_model_states(model_files)
205
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
206
+
207
+ if zero_stage <= 2:
208
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
209
+ exclude_frozen_parameters)
210
+ elif zero_stage == 3:
211
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
212
+ exclude_frozen_parameters)
213
+
214
+
215
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
216
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
217
+ return
218
+
219
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
220
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
221
+
222
+ if debug:
223
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
224
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
225
+
226
+ wanted_params = len(frozen_param_shapes)
227
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
228
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
229
+ print(f'Frozen params: Have {avail_numel} numels to process.')
230
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
231
+
232
+ total_params = 0
233
+ total_numel = 0
234
+ for name, shape in frozen_param_shapes.items():
235
+ total_params += 1
236
+ unpartitioned_numel = shape.numel()
237
+ total_numel += unpartitioned_numel
238
+
239
+ state_dict[name] = frozen_param_fragments[name]
240
+
241
+ if debug:
242
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
243
+
244
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
245
+
246
+
247
+ def _has_callable(obj, fn):
248
+ attr = getattr(obj, fn, None)
249
+ return callable(attr)
250
+
251
+
252
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
253
+ param_shapes = zero_model_states[0].param_shapes
254
+
255
+ # Reconstruction protocol:
256
+ #
257
+ # XXX: document this
258
+
259
+ if debug:
260
+ for i in range(world_size):
261
+ for j in range(len(fp32_flat_groups[0])):
262
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
263
+
264
+ # XXX: memory usage doubles here (zero2)
265
+ num_param_groups = len(fp32_flat_groups[0])
266
+ merged_single_partition_of_fp32_groups = []
267
+ for i in range(num_param_groups):
268
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
269
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
270
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
271
+ avail_numel = sum(
272
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
273
+
274
+ if debug:
275
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
276
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
277
+ # not asserting if there is a mismatch due to possible padding
278
+ print(f"Have {avail_numel} numels to process.")
279
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
280
+
281
+ # params
282
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
283
+ # out-of-core computing solution
284
+ total_numel = 0
285
+ total_params = 0
286
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
287
+ offset = 0
288
+ avail_numel = full_single_fp32_vector.numel()
289
+ for name, shape in shapes.items():
290
+
291
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
292
+ total_numel += unpartitioned_numel
293
+ total_params += 1
294
+
295
+ if debug:
296
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
297
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
298
+ offset += unpartitioned_numel
299
+
300
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
301
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
302
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
303
+ # live optimizer object, so we are checking that the numbers are within the right range
304
+ align_to = 2 * world_size
305
+
306
+ def zero2_align(x):
307
+ return align_to * math.ceil(x / align_to)
308
+
309
+ if debug:
310
+ print(f"original offset={offset}, avail_numel={avail_numel}")
311
+
312
+ offset = zero2_align(offset)
313
+ avail_numel = zero2_align(avail_numel)
314
+
315
+ if debug:
316
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
317
+
318
+ # Sanity check
319
+ if offset != avail_numel:
320
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
321
+
322
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
323
+
324
+
325
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
326
+ exclude_frozen_parameters):
327
+ state_dict = OrderedDict()
328
+
329
+ # buffers
330
+ buffers = zero_model_states[0].buffers
331
+ state_dict.update(buffers)
332
+ if debug:
333
+ print(f"added {len(buffers)} buffers")
334
+
335
+ if not exclude_frozen_parameters:
336
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
337
+
338
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
339
+
340
+ # recover shared parameters
341
+ for pair in zero_model_states[0].shared_params:
342
+ if pair[1] in state_dict:
343
+ state_dict[pair[0]] = state_dict[pair[1]]
344
+
345
+ return state_dict
346
+
347
+
348
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
349
+ remainder = unpartitioned_numel % world_size
350
+ padding_numel = (world_size - remainder) if remainder else 0
351
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
352
+ return partitioned_numel, padding_numel
353
+
354
+
355
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
356
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
357
+ return
358
+
359
+ if debug:
360
+ for i in range(world_size):
361
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
362
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
363
+
364
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
365
+ wanted_params = len(frozen_param_shapes)
366
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
367
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
368
+ print(f'Frozen params: Have {avail_numel} numels to process.')
369
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
370
+
371
+ total_params = 0
372
+ total_numel = 0
373
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
374
+ total_params += 1
375
+ unpartitioned_numel = shape.numel()
376
+ total_numel += unpartitioned_numel
377
+
378
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
379
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
380
+
381
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
382
+
383
+ if debug:
384
+ print(
385
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
386
+ )
387
+
388
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
389
+
390
+
391
+ class GatheredTensor:
392
+ """
393
+ A pseudo tensor that collects partitioned weights.
394
+ It is more memory efficient when there are multiple groups.
395
+ """
396
+
397
+ def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
398
+ self.flat_groups = flat_groups
399
+ self.flat_groups_offset = flat_groups_offset
400
+ self.offset = offset
401
+ self.partitioned_numel = partitioned_numel
402
+ self.shape = shape
403
+ self.dtype = self.flat_groups[0][0].dtype
404
+
405
+ def contiguous(self):
406
+ """
407
+ Merge partitioned weights from flat_groups into a single tensor.
408
+ """
409
+ end_idx = self.offset + self.partitioned_numel
410
+ world_size = len(self.flat_groups)
411
+ pad_flat_param_chunks = []
412
+
413
+ for rank_i in range(world_size):
414
+ # for each rank, we need to collect weights from related group/groups
415
+ flat_groups_at_rank_i = self.flat_groups[rank_i]
416
+ start_group_id = None
417
+ end_group_id = None
418
+ for group_id in range(len(self.flat_groups_offset)):
419
+ if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
420
+ start_group_id = group_id
421
+ if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
422
+ end_group_id = group_id
423
+ break
424
+ # collect weights from related group/groups
425
+ for group_id in range(start_group_id, end_group_id + 1):
426
+ flat_tensor = flat_groups_at_rank_i[group_id]
427
+ start_offset = self.offset - self.flat_groups_offset[group_id]
428
+ end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
429
+ pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
430
+
431
+ # collect weights from all ranks
432
+ pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
433
+ param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
434
+ return param
435
+
436
+
437
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
438
+ param_shapes = zero_model_states[0].param_shapes
439
+ avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
440
+
441
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
442
+ # param, re-consolidating each param, while dealing with padding if any
443
+
444
+ # merge list of dicts, preserving order
445
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
446
+
447
+ if debug:
448
+ for i in range(world_size):
449
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
450
+
451
+ wanted_params = len(param_shapes)
452
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
453
+ # not asserting if there is a mismatch due to possible padding
454
+ avail_numel = fp32_flat_groups[0].numel() * world_size
455
+ print(f"Trainable params: Have {avail_numel} numels to process.")
456
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
457
+
458
+ # params
459
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
460
+ # out-of-core computing solution
461
+ offset = 0
462
+ total_numel = 0
463
+ total_params = 0
464
+ flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
465
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
466
+ unpartitioned_numel = shape.numel()
467
+ total_numel += unpartitioned_numel
468
+ total_params += 1
469
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
470
+
471
+ if debug:
472
+ print(
473
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
474
+ )
475
+
476
+ # memory efficient tensor
477
+ tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
478
+ state_dict[name] = tensor
479
+ offset += partitioned_numel
480
+
481
+ offset *= world_size
482
+
483
+ # Sanity check
484
+ if offset != avail_numel:
485
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
486
+
487
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
488
+
489
+
490
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
491
+ exclude_frozen_parameters):
492
+ state_dict = OrderedDict()
493
+
494
+ # buffers
495
+ buffers = zero_model_states[0].buffers
496
+ state_dict.update(buffers)
497
+ if debug:
498
+ print(f"added {len(buffers)} buffers")
499
+
500
+ if not exclude_frozen_parameters:
501
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
502
+
503
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
504
+
505
+ # recover shared parameters
506
+ for pair in zero_model_states[0].shared_params:
507
+ if pair[1] in state_dict:
508
+ state_dict[pair[0]] = state_dict[pair[1]]
509
+
510
+ return state_dict
511
+
512
+
513
+ def to_torch_tensor(state_dict, return_empty_tensor=False):
514
+ """
515
+ Convert state_dict of GatheredTensor to torch tensor
516
+ """
517
+ torch_state_dict = {}
518
+ converted_tensors = {}
519
+ for name, tensor in state_dict.items():
520
+ tensor_id = id(tensor)
521
+ if tensor_id in converted_tensors: # shared tensors
522
+ shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
523
+ torch_state_dict[name] = shared_tensor
524
+ else:
525
+ converted_tensors[tensor_id] = name
526
+ if return_empty_tensor:
527
+ torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
528
+ else:
529
+ torch_state_dict[name] = tensor.contiguous()
530
+ return torch_state_dict
531
+
532
+
533
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
534
+ tag=None,
535
+ exclude_frozen_parameters=False,
536
+ lazy_mode=False):
537
+ """
538
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
539
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
540
+ via a model hub.
541
+
542
+ Args:
543
+ - ``checkpoint_dir``: path to the desired checkpoint folder
544
+ - ``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``
545
+ - ``exclude_frozen_parameters``: exclude frozen parameters
546
+ - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
547
+ Convert the pesduo tensor to torch tensor by ``.contiguous()``
548
+
549
+ Returns:
550
+ - pytorch ``state_dict``
551
+
552
+ A typical usage might be ::
553
+
554
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
555
+ # do the training and checkpoint saving
556
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
557
+ model = model.cpu() # move to cpu
558
+ model.load_state_dict(state_dict)
559
+ # submit to model hub or save the model to share with others
560
+
561
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
562
+ application. i.e. you will need to re-initialize the deepspeed engine, since
563
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
564
+
565
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
566
+
567
+ Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
568
+ You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
569
+ the checkpoint. Or you can load state_dict in lazy mode ::
570
+
571
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
572
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
573
+ for name, lazy_tensor in state_dict.item():
574
+ tensor = lazy_tensor.contiguous() # to cpu
575
+ print(name, tensor)
576
+ # del tensor to release memory if it no longer in use
577
+ """
578
+ if tag is None:
579
+ latest_path = os.path.join(checkpoint_dir, 'latest')
580
+ if os.path.isfile(latest_path):
581
+ with open(latest_path, 'r') as fd:
582
+ tag = fd.read().strip()
583
+ else:
584
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
585
+
586
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
587
+
588
+ if not os.path.isdir(ds_checkpoint_dir):
589
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
590
+
591
+ state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
592
+ if lazy_mode:
593
+ return state_dict
594
+ else:
595
+ return to_torch_tensor(state_dict)
596
+
597
+
598
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
599
+ output_dir,
600
+ max_shard_size="5GB",
601
+ safe_serialization=False,
602
+ tag=None,
603
+ exclude_frozen_parameters=False):
604
+ """
605
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
606
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
607
+
608
+ Args:
609
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
610
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
611
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
612
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
613
+ - ``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``
614
+ - ``exclude_frozen_parameters``: exclude frozen parameters
615
+ """
616
+
617
+ # Dependency pre-check
618
+ if safe_serialization:
619
+ try:
620
+ from safetensors.torch import save_file
621
+ except ImportError:
622
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
623
+ raise
624
+ if max_shard_size is not None:
625
+ try:
626
+ from huggingface_hub import split_torch_state_dict_into_shards
627
+ except ImportError:
628
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
629
+ raise
630
+
631
+ # Convert zero checkpoint to state_dict
632
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
633
+ tag,
634
+ exclude_frozen_parameters,
635
+ lazy_mode=True)
636
+
637
+ # Shard the model if it is too big.
638
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
639
+ if max_shard_size is not None:
640
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
641
+ # an memory-efficient approach for sharding
642
+ empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
643
+ state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
644
+ filename_pattern=filename_pattern,
645
+ max_shard_size=max_shard_size)
646
+ else:
647
+ from collections import namedtuple
648
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
649
+ state_dict_split = StateDictSplit(is_sharded=False,
650
+ filename_to_tensors={weights_name: list(state_dict.keys())})
651
+
652
+ # Save the model by shard
653
+ os.makedirs(output_dir, exist_ok=True)
654
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
655
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
656
+ shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
657
+ shard_state_dict = to_torch_tensor(shard_state_dict)
658
+ output_path = os.path.join(output_dir, shard_file)
659
+ if safe_serialization:
660
+ save_file(shard_state_dict, output_path, metadata={"format": "pt"})
661
+ else:
662
+ torch.save(shard_state_dict, output_path)
663
+ # release the memory of current shard
664
+ for tensor_name in list(shard_state_dict.keys()):
665
+ del state_dict[tensor_name]
666
+ del shard_state_dict[tensor_name]
667
+ del shard_state_dict
668
+ gc.collect()
669
+
670
+ # Save index if sharded
671
+ if state_dict_split.is_sharded:
672
+ index = {
673
+ "metadata": state_dict_split.metadata,
674
+ "weight_map": state_dict_split.tensor_to_filename,
675
+ }
676
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
677
+ save_index_file = os.path.join(output_dir, save_index_file)
678
+ with open(save_index_file, "w", encoding="utf-8") as f:
679
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
680
+ f.write(content)
681
+
682
+
683
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
684
+ """
685
+ 1. Put the provided model to cpu
686
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
687
+ 3. Load it into the provided model
688
+
689
+ Args:
690
+ - ``model``: the model object to update
691
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
692
+ - ``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``
693
+
694
+ Returns:
695
+ - ``model`: modified model
696
+
697
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
698
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
699
+ conveniently placed for you in the checkpoint folder.
700
+
701
+ A typical usage might be ::
702
+
703
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
704
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
705
+ # submit to model hub or save the model to share with others
706
+
707
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
708
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
709
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
710
+
711
+ """
712
+ logger.info(f"Extracting fp32 weights")
713
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
714
+
715
+ logger.info(f"Overwriting model with fp32 weights")
716
+ model = model.cpu()
717
+ model.load_state_dict(state_dict, strict=False)
718
+
719
+ return model
720
+
721
+
722
+ if __name__ == "__main__":
723
+ parser = argparse.ArgumentParser()
724
+ parser.add_argument("checkpoint_dir",
725
+ type=str,
726
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
727
+ parser.add_argument("output_dir",
728
+ type=str,
729
+ help="directory to the pytorch fp32 state_dict output files"
730
+ "(e.g. path/checkpoint-12-output/)")
731
+ parser.add_argument(
732
+ "--max_shard_size",
733
+ type=str,
734
+ default="5GB",
735
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
736
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
737
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
738
+ "without CPU OOM issues.")
739
+ parser.add_argument(
740
+ "--safe_serialization",
741
+ default=False,
742
+ action='store_true',
743
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
744
+ parser.add_argument("-t",
745
+ "--tag",
746
+ type=str,
747
+ default=None,
748
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
749
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
750
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
751
+ args = parser.parse_args()
752
+
753
+ debug = args.debug
754
+
755
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
756
+ args.output_dir,
757
+ max_shard_size=args.max_shard_size,
758
+ safe_serialization=args.safe_serialization,
759
+ tag=args.tag,
760
+ exclude_frozen_parameters=args.exclude_frozen_parameters)