Journey9ni commited on
Commit
dee6cdf
·
verified ·
1 Parent(s): 925e7ee

Upload checkpoint-3000 from E118

Browse files
Files changed (33) hide show
  1. checkpoints/E118/checkpoint-3000/added_tokens.json +24 -0
  2. checkpoints/E118/checkpoint-3000/config.json +84 -0
  3. checkpoints/E118/checkpoint-3000/generation_config.json +12 -0
  4. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  5. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  6. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
  7. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
  8. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
  9. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
  10. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
  11. checkpoints/E118/checkpoint-3000/global_step3000/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt +3 -0
  12. checkpoints/E118/checkpoint-3000/global_step3000/mp_rank_00_model_states.pt +3 -0
  13. checkpoints/E118/checkpoint-3000/latest +1 -0
  14. checkpoints/E118/checkpoint-3000/merges.txt +0 -0
  15. checkpoints/E118/checkpoint-3000/model-00001-of-00003.safetensors +3 -0
  16. checkpoints/E118/checkpoint-3000/model-00002-of-00003.safetensors +3 -0
  17. checkpoints/E118/checkpoint-3000/model-00003-of-00003.safetensors +3 -0
  18. checkpoints/E118/checkpoint-3000/model.safetensors.index.json +0 -0
  19. checkpoints/E118/checkpoint-3000/rng_state_0.pth +3 -0
  20. checkpoints/E118/checkpoint-3000/rng_state_1.pth +3 -0
  21. checkpoints/E118/checkpoint-3000/rng_state_2.pth +3 -0
  22. checkpoints/E118/checkpoint-3000/rng_state_3.pth +3 -0
  23. checkpoints/E118/checkpoint-3000/rng_state_4.pth +3 -0
  24. checkpoints/E118/checkpoint-3000/rng_state_5.pth +3 -0
  25. checkpoints/E118/checkpoint-3000/rng_state_6.pth +3 -0
  26. checkpoints/E118/checkpoint-3000/rng_state_7.pth +3 -0
  27. checkpoints/E118/checkpoint-3000/scheduler.pt +3 -0
  28. checkpoints/E118/checkpoint-3000/special_tokens_map.json +31 -0
  29. checkpoints/E118/checkpoint-3000/tokenizer_config.json +209 -0
  30. checkpoints/E118/checkpoint-3000/trainer_state.json +2134 -0
  31. checkpoints/E118/checkpoint-3000/training_args.bin +3 -0
  32. checkpoints/E118/checkpoint-3000/vocab.json +0 -0
  33. checkpoints/E118/checkpoint-3000/zero_to_fp32.py +760 -0
checkpoints/E118/checkpoint-3000/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
+ }
checkpoints/E118/checkpoint-3000/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
+ 22
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
+ }
checkpoints/E118/checkpoint-3000/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
+ }
checkpoints/E118/checkpoint-3000/global_step3000/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:f6c22ae910e4b0b6cc438e4c01470778bbd0bdb94afb4bb4876e6c0c97c4fbb9
3
+ size 4817695729
checkpoints/E118/checkpoint-3000/global_step3000/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:8d1062eb4317c0025bc065d821f67b40e25cf0f84c0aa83fcad06c7507a4689a
3
+ size 4817698545
checkpoints/E118/checkpoint-3000/global_step3000/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:066a786debce803eee79999b2a97ae650de7103df63827858c65f477b7d5557b
3
+ size 4817699121
checkpoints/E118/checkpoint-3000/global_step3000/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:36029d966cfe7b004ccbc097a2f369a1310771acbf3ef762682881f22d8d0c89
3
+ size 4817699569
checkpoints/E118/checkpoint-3000/global_step3000/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:e43eeb848c864bb648493fc5e8fd721b3060b0c724560b42db120ea8614d9ba3
3
+ size 4817698993
checkpoints/E118/checkpoint-3000/global_step3000/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:1197119d968bc9ac8b84cea9b4b9f4602c7a76820635ab29ca52145c878265fd
3
+ size 4817699249
checkpoints/E118/checkpoint-3000/global_step3000/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:68837240ab45ed08a069d9e51766945e9b7a78259342e1f98135b3f06834c8f6
3
+ size 4817699057
checkpoints/E118/checkpoint-3000/global_step3000/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:6e5f43400dc31e88e4924145149bc3d86fd6f8b39a6d39bbb5c1e4ed48a63122
3
+ size 4817699377
checkpoints/E118/checkpoint-3000/global_step3000/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e9d220b00635d474c12dcbb6a66c7ce9aa963d6fca8855aa79a1a6d7ae2ed62
3
+ size 12736254037
checkpoints/E118/checkpoint-3000/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step3000
checkpoints/E118/checkpoint-3000/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
checkpoints/E118/checkpoint-3000/model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:325e9b29dde61fe900c9b5d7e516ca8ef768244a8a64407e2ace85f4098586b2
3
+ size 4962140952
checkpoints/E118/checkpoint-3000/model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95d50bf28221f676654121ff676f110bb76c288556c0faa7bf88c16ba30e754b
3
+ size 4869006472
checkpoints/E118/checkpoint-3000/model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f7a27b94b46303c1e36e7c16a7ad31b4ba9b63039f2bad5302b9ebd13ed7289
3
+ size 622329984
checkpoints/E118/checkpoint-3000/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/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
checkpoints/E118/checkpoint-3000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ab16fb6d9408aabd351dacf499a039b866785c0ccf0c945247fbe9725001837
3
+ size 1465
checkpoints/E118/checkpoint-3000/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
+ }
checkpoints/E118/checkpoint-3000/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
+ }
checkpoints/E118/checkpoint-3000/trainer_state.json ADDED
@@ -0,0 +1,2134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.9065498224673264,
6
+ "eval_steps": 500,
7
+ "global_step": 3000,
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": 164.14991760253906,
15
+ "learning_rate": 1.0000000000000002e-06,
16
+ "loss": 13.8259,
17
+ "step": 10
18
+ },
19
+ {
20
+ "epoch": 0.0060436654831155096,
21
+ "grad_norm": 79.00243377685547,
22
+ "learning_rate": 2.0000000000000003e-06,
23
+ "loss": 13.0608,
24
+ "step": 20
25
+ },
26
+ {
27
+ "epoch": 0.009065498224673264,
28
+ "grad_norm": 51.88568878173828,
29
+ "learning_rate": 3e-06,
30
+ "loss": 12.0917,
31
+ "step": 30
32
+ },
33
+ {
34
+ "epoch": 0.012087330966231019,
35
+ "grad_norm": 48.75140380859375,
36
+ "learning_rate": 4.000000000000001e-06,
37
+ "loss": 10.3111,
38
+ "step": 40
39
+ },
40
+ {
41
+ "epoch": 0.015109163707788774,
42
+ "grad_norm": 44.99660873413086,
43
+ "learning_rate": 5e-06,
44
+ "loss": 9.553,
45
+ "step": 50
46
+ },
47
+ {
48
+ "epoch": 0.01813099644934653,
49
+ "grad_norm": 41.01961135864258,
50
+ "learning_rate": 6e-06,
51
+ "loss": 8.3421,
52
+ "step": 60
53
+ },
54
+ {
55
+ "epoch": 0.021152829190904283,
56
+ "grad_norm": 31.11094856262207,
57
+ "learning_rate": 7e-06,
58
+ "loss": 6.9212,
59
+ "step": 70
60
+ },
61
+ {
62
+ "epoch": 0.024174661932462038,
63
+ "grad_norm": 51.63551712036133,
64
+ "learning_rate": 8.000000000000001e-06,
65
+ "loss": 6.7758,
66
+ "step": 80
67
+ },
68
+ {
69
+ "epoch": 0.027196494674019793,
70
+ "grad_norm": 30.700332641601562,
71
+ "learning_rate": 9e-06,
72
+ "loss": 7.0498,
73
+ "step": 90
74
+ },
75
+ {
76
+ "epoch": 0.030218327415577548,
77
+ "grad_norm": 37.647708892822266,
78
+ "learning_rate": 1e-05,
79
+ "loss": 6.7113,
80
+ "step": 100
81
+ },
82
+ {
83
+ "epoch": 0.0332401601571353,
84
+ "grad_norm": 37.32933807373047,
85
+ "learning_rate": 9.999760394462267e-06,
86
+ "loss": 7.3592,
87
+ "step": 110
88
+ },
89
+ {
90
+ "epoch": 0.03626199289869306,
91
+ "grad_norm": 38.281829833984375,
92
+ "learning_rate": 9.999041600813393e-06,
93
+ "loss": 7.0046,
94
+ "step": 120
95
+ },
96
+ {
97
+ "epoch": 0.03928382564025081,
98
+ "grad_norm": 31.066274642944336,
99
+ "learning_rate": 9.997843687944153e-06,
100
+ "loss": 6.2365,
101
+ "step": 130
102
+ },
103
+ {
104
+ "epoch": 0.04230565838180857,
105
+ "grad_norm": 29.11764144897461,
106
+ "learning_rate": 9.996166770665168e-06,
107
+ "loss": 5.579,
108
+ "step": 140
109
+ },
110
+ {
111
+ "epoch": 0.04532749112336632,
112
+ "grad_norm": 33.222808837890625,
113
+ "learning_rate": 9.994011009695908e-06,
114
+ "loss": 5.6607,
115
+ "step": 150
116
+ },
117
+ {
118
+ "epoch": 0.048349323864924076,
119
+ "grad_norm": 31.273977279663086,
120
+ "learning_rate": 9.991376611649278e-06,
121
+ "loss": 6.0873,
122
+ "step": 160
123
+ },
124
+ {
125
+ "epoch": 0.05137115660648183,
126
+ "grad_norm": 27.030546188354492,
127
+ "learning_rate": 9.988263829011821e-06,
128
+ "loss": 5.4012,
129
+ "step": 170
130
+ },
131
+ {
132
+ "epoch": 0.054392989348039586,
133
+ "grad_norm": 25.91176986694336,
134
+ "learning_rate": 9.984672960119523e-06,
135
+ "loss": 5.3626,
136
+ "step": 180
137
+ },
138
+ {
139
+ "epoch": 0.05741482208959734,
140
+ "grad_norm": 39.797523498535156,
141
+ "learning_rate": 9.980604349129212e-06,
142
+ "loss": 5.7565,
143
+ "step": 190
144
+ },
145
+ {
146
+ "epoch": 0.060436654831155096,
147
+ "grad_norm": 26.1552734375,
148
+ "learning_rate": 9.976058385985575e-06,
149
+ "loss": 5.1983,
150
+ "step": 200
151
+ },
152
+ {
153
+ "epoch": 0.06345848757271286,
154
+ "grad_norm": 34.96975326538086,
155
+ "learning_rate": 9.971035506383791e-06,
156
+ "loss": 5.6103,
157
+ "step": 210
158
+ },
159
+ {
160
+ "epoch": 0.0664803203142706,
161
+ "grad_norm": 30.275611877441406,
162
+ "learning_rate": 9.96553619172777e-06,
163
+ "loss": 5.082,
164
+ "step": 220
165
+ },
166
+ {
167
+ "epoch": 0.06950215305582837,
168
+ "grad_norm": 31.659500122070312,
169
+ "learning_rate": 9.959560969084004e-06,
170
+ "loss": 5.335,
171
+ "step": 230
172
+ },
173
+ {
174
+ "epoch": 0.07252398579738611,
175
+ "grad_norm": 25.909767150878906,
176
+ "learning_rate": 9.953110411131073e-06,
177
+ "loss": 4.7812,
178
+ "step": 240
179
+ },
180
+ {
181
+ "epoch": 0.07554581853894388,
182
+ "grad_norm": 29.12919044494629,
183
+ "learning_rate": 9.946185136104736e-06,
184
+ "loss": 5.437,
185
+ "step": 250
186
+ },
187
+ {
188
+ "epoch": 0.07856765128050162,
189
+ "grad_norm": 29.44923973083496,
190
+ "learning_rate": 9.938785807738692e-06,
191
+ "loss": 4.7933,
192
+ "step": 260
193
+ },
194
+ {
195
+ "epoch": 0.08158948402205939,
196
+ "grad_norm": 30.55126953125,
197
+ "learning_rate": 9.930913135200964e-06,
198
+ "loss": 5.403,
199
+ "step": 270
200
+ },
201
+ {
202
+ "epoch": 0.08461131676361713,
203
+ "grad_norm": 23.430017471313477,
204
+ "learning_rate": 9.922567873025924e-06,
205
+ "loss": 5.2349,
206
+ "step": 280
207
+ },
208
+ {
209
+ "epoch": 0.0876331495051749,
210
+ "grad_norm": 29.15253448486328,
211
+ "learning_rate": 9.913750821041988e-06,
212
+ "loss": 4.5357,
213
+ "step": 290
214
+ },
215
+ {
216
+ "epoch": 0.09065498224673264,
217
+ "grad_norm": 24.52574920654297,
218
+ "learning_rate": 9.904462824294945e-06,
219
+ "loss": 4.5873,
220
+ "step": 300
221
+ },
222
+ {
223
+ "epoch": 0.0936768149882904,
224
+ "grad_norm": 24.67723846435547,
225
+ "learning_rate": 9.894704772966978e-06,
226
+ "loss": 4.474,
227
+ "step": 310
228
+ },
229
+ {
230
+ "epoch": 0.09669864772984815,
231
+ "grad_norm": 24.382055282592773,
232
+ "learning_rate": 9.884477602291343e-06,
233
+ "loss": 4.5008,
234
+ "step": 320
235
+ },
236
+ {
237
+ "epoch": 0.09972048047140591,
238
+ "grad_norm": 30.42603302001953,
239
+ "learning_rate": 9.873782292462727e-06,
240
+ "loss": 4.3567,
241
+ "step": 330
242
+ },
243
+ {
244
+ "epoch": 0.10274231321296366,
245
+ "grad_norm": 26.170686721801758,
246
+ "learning_rate": 9.862619868543323e-06,
247
+ "loss": 8.1762,
248
+ "step": 340
249
+ },
250
+ {
251
+ "epoch": 0.10576414595452142,
252
+ "grad_norm": 38.36408996582031,
253
+ "learning_rate": 9.850991400364557e-06,
254
+ "loss": 5.1626,
255
+ "step": 350
256
+ },
257
+ {
258
+ "epoch": 0.10878597869607917,
259
+ "grad_norm": 25.83894157409668,
260
+ "learning_rate": 9.838898002424586e-06,
261
+ "loss": 6.0757,
262
+ "step": 360
263
+ },
264
+ {
265
+ "epoch": 0.11180781143763693,
266
+ "grad_norm": 29.732688903808594,
267
+ "learning_rate": 9.826340833781448e-06,
268
+ "loss": 5.8358,
269
+ "step": 370
270
+ },
271
+ {
272
+ "epoch": 0.11482964417919468,
273
+ "grad_norm": 18.970821380615234,
274
+ "learning_rate": 9.813321097942005e-06,
275
+ "loss": 5.1022,
276
+ "step": 380
277
+ },
278
+ {
279
+ "epoch": 0.11785147692075244,
280
+ "grad_norm": 27.406240463256836,
281
+ "learning_rate": 9.79984004274658e-06,
282
+ "loss": 4.8694,
283
+ "step": 390
284
+ },
285
+ {
286
+ "epoch": 0.12087330966231019,
287
+ "grad_norm": 22.173940658569336,
288
+ "learning_rate": 9.785898960249365e-06,
289
+ "loss": 4.2529,
290
+ "step": 400
291
+ },
292
+ {
293
+ "epoch": 0.12389514240386795,
294
+ "grad_norm": 19.587993621826172,
295
+ "learning_rate": 9.771499186594586e-06,
296
+ "loss": 5.0707,
297
+ "step": 410
298
+ },
299
+ {
300
+ "epoch": 0.12691697514542571,
301
+ "grad_norm": 26.870187759399414,
302
+ "learning_rate": 9.756642101888449e-06,
303
+ "loss": 5.1808,
304
+ "step": 420
305
+ },
306
+ {
307
+ "epoch": 0.12993880788698345,
308
+ "grad_norm": 24.28529167175293,
309
+ "learning_rate": 9.74132913006686e-06,
310
+ "loss": 3.4672,
311
+ "step": 430
312
+ },
313
+ {
314
+ "epoch": 0.1329606406285412,
315
+ "grad_norm": 20.661434173583984,
316
+ "learning_rate": 9.725561738758956e-06,
317
+ "loss": 3.3511,
318
+ "step": 440
319
+ },
320
+ {
321
+ "epoch": 0.13598247337009897,
322
+ "grad_norm": 22.3953914642334,
323
+ "learning_rate": 9.709341439146452e-06,
324
+ "loss": 5.1124,
325
+ "step": 450
326
+ },
327
+ {
328
+ "epoch": 0.13900430611165673,
329
+ "grad_norm": 27.169279098510742,
330
+ "learning_rate": 9.692669785818787e-06,
331
+ "loss": 6.4226,
332
+ "step": 460
333
+ },
334
+ {
335
+ "epoch": 0.14202613885321447,
336
+ "grad_norm": 34.868682861328125,
337
+ "learning_rate": 9.675548376624149e-06,
338
+ "loss": 5.7534,
339
+ "step": 470
340
+ },
341
+ {
342
+ "epoch": 0.14504797159477223,
343
+ "grad_norm": 27.703248977661133,
344
+ "learning_rate": 9.657978852516318e-06,
345
+ "loss": 5.6828,
346
+ "step": 480
347
+ },
348
+ {
349
+ "epoch": 0.14806980433633,
350
+ "grad_norm": 21.426271438598633,
351
+ "learning_rate": 9.639962897397405e-06,
352
+ "loss": 4.1847,
353
+ "step": 490
354
+ },
355
+ {
356
+ "epoch": 0.15109163707788775,
357
+ "grad_norm": 21.853469848632812,
358
+ "learning_rate": 9.621502237956452e-06,
359
+ "loss": 5.0356,
360
+ "step": 500
361
+ },
362
+ {
363
+ "epoch": 0.1541134698194455,
364
+ "grad_norm": 19.003141403198242,
365
+ "learning_rate": 9.602598643503957e-06,
366
+ "loss": 3.2694,
367
+ "step": 510
368
+ },
369
+ {
370
+ "epoch": 0.15713530256100325,
371
+ "grad_norm": 28.9671688079834,
372
+ "learning_rate": 9.583253925802283e-06,
373
+ "loss": 4.2167,
374
+ "step": 520
375
+ },
376
+ {
377
+ "epoch": 0.160157135302561,
378
+ "grad_norm": 22.439605712890625,
379
+ "learning_rate": 9.563469938892023e-06,
380
+ "loss": 4.8531,
381
+ "step": 530
382
+ },
383
+ {
384
+ "epoch": 0.16317896804411877,
385
+ "grad_norm": 23.49073028564453,
386
+ "learning_rate": 9.543248578914309e-06,
387
+ "loss": 3.222,
388
+ "step": 540
389
+ },
390
+ {
391
+ "epoch": 0.1662008007856765,
392
+ "grad_norm": 23.804365158081055,
393
+ "learning_rate": 9.522591783929069e-06,
394
+ "loss": 4.829,
395
+ "step": 550
396
+ },
397
+ {
398
+ "epoch": 0.16922263352723427,
399
+ "grad_norm": 19.732295989990234,
400
+ "learning_rate": 9.501501533729297e-06,
401
+ "loss": 4.128,
402
+ "step": 560
403
+ },
404
+ {
405
+ "epoch": 0.17224446626879203,
406
+ "grad_norm": 33.48932647705078,
407
+ "learning_rate": 9.479979849651287e-06,
408
+ "loss": 5.7656,
409
+ "step": 570
410
+ },
411
+ {
412
+ "epoch": 0.1752662990103498,
413
+ "grad_norm": 24.05331039428711,
414
+ "learning_rate": 9.45802879438091e-06,
415
+ "loss": 6.3455,
416
+ "step": 580
417
+ },
418
+ {
419
+ "epoch": 0.17828813175190752,
420
+ "grad_norm": 23.51070213317871,
421
+ "learning_rate": 9.43565047175593e-06,
422
+ "loss": 4.1453,
423
+ "step": 590
424
+ },
425
+ {
426
+ "epoch": 0.1813099644934653,
427
+ "grad_norm": 25.37734603881836,
428
+ "learning_rate": 9.412847026564359e-06,
429
+ "loss": 3.9563,
430
+ "step": 600
431
+ },
432
+ {
433
+ "epoch": 0.18433179723502305,
434
+ "grad_norm": 21.561195373535156,
435
+ "learning_rate": 9.389620644338893e-06,
436
+ "loss": 4.1523,
437
+ "step": 610
438
+ },
439
+ {
440
+ "epoch": 0.1873536299765808,
441
+ "grad_norm": 35.891597747802734,
442
+ "learning_rate": 9.365973551147453e-06,
443
+ "loss": 4.6762,
444
+ "step": 620
445
+ },
446
+ {
447
+ "epoch": 0.19037546271813854,
448
+ "grad_norm": 22.53954315185547,
449
+ "learning_rate": 9.341908013379832e-06,
450
+ "loss": 4.7275,
451
+ "step": 630
452
+ },
453
+ {
454
+ "epoch": 0.1933972954596963,
455
+ "grad_norm": 25.00588607788086,
456
+ "learning_rate": 9.317426337530477e-06,
457
+ "loss": 4.0427,
458
+ "step": 640
459
+ },
460
+ {
461
+ "epoch": 0.19641912820125407,
462
+ "grad_norm": 26.281129837036133,
463
+ "learning_rate": 9.292530869977432e-06,
464
+ "loss": 5.5388,
465
+ "step": 650
466
+ },
467
+ {
468
+ "epoch": 0.19944096094281183,
469
+ "grad_norm": 23.323177337646484,
470
+ "learning_rate": 9.26722399675745e-06,
471
+ "loss": 3.1677,
472
+ "step": 660
473
+ },
474
+ {
475
+ "epoch": 0.20246279368436956,
476
+ "grad_norm": 21.66280174255371,
477
+ "learning_rate": 9.24150814333732e-06,
478
+ "loss": 3.9482,
479
+ "step": 670
480
+ },
481
+ {
482
+ "epoch": 0.20548462642592732,
483
+ "grad_norm": 19.23092269897461,
484
+ "learning_rate": 9.215385774381395e-06,
485
+ "loss": 6.2152,
486
+ "step": 680
487
+ },
488
+ {
489
+ "epoch": 0.2085064591674851,
490
+ "grad_norm": 41.06984329223633,
491
+ "learning_rate": 9.188859393515382e-06,
492
+ "loss": 4.8277,
493
+ "step": 690
494
+ },
495
+ {
496
+ "epoch": 0.21152829190904285,
497
+ "grad_norm": 22.713626861572266,
498
+ "learning_rate": 9.16193154308638e-06,
499
+ "loss": 6.0234,
500
+ "step": 700
501
+ },
502
+ {
503
+ "epoch": 0.21455012465060058,
504
+ "grad_norm": 34.92478942871094,
505
+ "learning_rate": 9.13460480391922e-06,
506
+ "loss": 6.2043,
507
+ "step": 710
508
+ },
509
+ {
510
+ "epoch": 0.21757195739215834,
511
+ "grad_norm": 37.5953254699707,
512
+ "learning_rate": 9.106881795069116e-06,
513
+ "loss": 6.4758,
514
+ "step": 720
515
+ },
516
+ {
517
+ "epoch": 0.2205937901337161,
518
+ "grad_norm": 19.387893676757812,
519
+ "learning_rate": 9.078765173570649e-06,
520
+ "loss": 3.1607,
521
+ "step": 730
522
+ },
523
+ {
524
+ "epoch": 0.22361562287527387,
525
+ "grad_norm": 19.037372589111328,
526
+ "learning_rate": 9.0502576341831e-06,
527
+ "loss": 4.0532,
528
+ "step": 740
529
+ },
530
+ {
531
+ "epoch": 0.2266374556168316,
532
+ "grad_norm": 20.597227096557617,
533
+ "learning_rate": 9.02136190913219e-06,
534
+ "loss": 5.4351,
535
+ "step": 750
536
+ },
537
+ {
538
+ "epoch": 0.22965928835838936,
539
+ "grad_norm": 37.33137130737305,
540
+ "learning_rate": 8.99208076784822e-06,
541
+ "loss": 4.6044,
542
+ "step": 760
543
+ },
544
+ {
545
+ "epoch": 0.23268112109994712,
546
+ "grad_norm": 16.10256004333496,
547
+ "learning_rate": 8.962417016700624e-06,
548
+ "loss": 3.0566,
549
+ "step": 770
550
+ },
551
+ {
552
+ "epoch": 0.2357029538415049,
553
+ "grad_norm": 23.969058990478516,
554
+ "learning_rate": 8.932373498729026e-06,
555
+ "loss": 4.635,
556
+ "step": 780
557
+ },
558
+ {
559
+ "epoch": 0.23872478658306262,
560
+ "grad_norm": 24.59278106689453,
561
+ "learning_rate": 8.901953093370734e-06,
562
+ "loss": 3.9973,
563
+ "step": 790
564
+ },
565
+ {
566
+ "epoch": 0.24174661932462038,
567
+ "grad_norm": 25.19046401977539,
568
+ "learning_rate": 8.871158716184784e-06,
569
+ "loss": 3.9002,
570
+ "step": 800
571
+ },
572
+ {
573
+ "epoch": 0.24476845206617814,
574
+ "grad_norm": 32.421531677246094,
575
+ "learning_rate": 8.839993318572497e-06,
576
+ "loss": 4.8339,
577
+ "step": 810
578
+ },
579
+ {
580
+ "epoch": 0.2477902848077359,
581
+ "grad_norm": 18.438983917236328,
582
+ "learning_rate": 8.808459887494617e-06,
583
+ "loss": 3.0604,
584
+ "step": 820
585
+ },
586
+ {
587
+ "epoch": 0.25081211754929367,
588
+ "grad_norm": 18.770906448364258,
589
+ "learning_rate": 8.77656144518502e-06,
590
+ "loss": 3.8172,
591
+ "step": 830
592
+ },
593
+ {
594
+ "epoch": 0.25383395029085143,
595
+ "grad_norm": 17.892440795898438,
596
+ "learning_rate": 8.744301048861083e-06,
597
+ "loss": 2.9072,
598
+ "step": 840
599
+ },
600
+ {
601
+ "epoch": 0.25685578303240914,
602
+ "grad_norm": 22.90224838256836,
603
+ "learning_rate": 8.711681790430646e-06,
604
+ "loss": 3.0475,
605
+ "step": 850
606
+ },
607
+ {
608
+ "epoch": 0.2598776157739669,
609
+ "grad_norm": 25.596424102783203,
610
+ "learning_rate": 8.678706796195694e-06,
611
+ "loss": 4.7575,
612
+ "step": 860
613
+ },
614
+ {
615
+ "epoch": 0.26289944851552466,
616
+ "grad_norm": 22.27895736694336,
617
+ "learning_rate": 8.645379226552712e-06,
618
+ "loss": 3.7133,
619
+ "step": 870
620
+ },
621
+ {
622
+ "epoch": 0.2659212812570824,
623
+ "grad_norm": 20.32448387145996,
624
+ "learning_rate": 8.611702275689805e-06,
625
+ "loss": 4.6497,
626
+ "step": 880
627
+ },
628
+ {
629
+ "epoch": 0.2689431139986402,
630
+ "grad_norm": 34.19053649902344,
631
+ "learning_rate": 8.577679171280538e-06,
632
+ "loss": 4.4895,
633
+ "step": 890
634
+ },
635
+ {
636
+ "epoch": 0.27196494674019794,
637
+ "grad_norm": 18.900352478027344,
638
+ "learning_rate": 8.543313174174601e-06,
639
+ "loss": 5.2694,
640
+ "step": 900
641
+ },
642
+ {
643
+ "epoch": 0.2749867794817557,
644
+ "grad_norm": 22.090261459350586,
645
+ "learning_rate": 8.508607578085281e-06,
646
+ "loss": 3.8479,
647
+ "step": 910
648
+ },
649
+ {
650
+ "epoch": 0.27800861222331347,
651
+ "grad_norm": 20.50776481628418,
652
+ "learning_rate": 8.473565709273786e-06,
653
+ "loss": 3.837,
654
+ "step": 920
655
+ },
656
+ {
657
+ "epoch": 0.2810304449648712,
658
+ "grad_norm": 17.40482521057129,
659
+ "learning_rate": 8.438190926230439e-06,
660
+ "loss": 3.8182,
661
+ "step": 930
662
+ },
663
+ {
664
+ "epoch": 0.28405227770642894,
665
+ "grad_norm": 32.253265380859375,
666
+ "learning_rate": 8.40248661935281e-06,
667
+ "loss": 4.3698,
668
+ "step": 940
669
+ },
670
+ {
671
+ "epoch": 0.2870741104479867,
672
+ "grad_norm": 22.86214256286621,
673
+ "learning_rate": 8.366456210620756e-06,
674
+ "loss": 3.0836,
675
+ "step": 950
676
+ },
677
+ {
678
+ "epoch": 0.29009594318954446,
679
+ "grad_norm": 29.654722213745117,
680
+ "learning_rate": 8.330103153268464e-06,
681
+ "loss": 3.7893,
682
+ "step": 960
683
+ },
684
+ {
685
+ "epoch": 0.2931177759311022,
686
+ "grad_norm": 22.348018646240234,
687
+ "learning_rate": 8.29343093145347e-06,
688
+ "loss": 3.7182,
689
+ "step": 970
690
+ },
691
+ {
692
+ "epoch": 0.29613960867266,
693
+ "grad_norm": 21.902996063232422,
694
+ "learning_rate": 8.25644305992275e-06,
695
+ "loss": 3.6397,
696
+ "step": 980
697
+ },
698
+ {
699
+ "epoch": 0.29916144141421774,
700
+ "grad_norm": 18.903818130493164,
701
+ "learning_rate": 8.21914308367584e-06,
702
+ "loss": 4.5713,
703
+ "step": 990
704
+ },
705
+ {
706
+ "epoch": 0.3021832741557755,
707
+ "grad_norm": 20.676620483398438,
708
+ "learning_rate": 8.181534577625088e-06,
709
+ "loss": 3.7566,
710
+ "step": 1000
711
+ },
712
+ {
713
+ "epoch": 0.3052051068973332,
714
+ "grad_norm": 13.126559257507324,
715
+ "learning_rate": 8.143621146253022e-06,
716
+ "loss": 4.6186,
717
+ "step": 1010
718
+ },
719
+ {
720
+ "epoch": 0.308226939638891,
721
+ "grad_norm": 16.96494483947754,
722
+ "learning_rate": 8.105406423266884e-06,
723
+ "loss": 4.6396,
724
+ "step": 1020
725
+ },
726
+ {
727
+ "epoch": 0.31124877238044873,
728
+ "grad_norm": 18.15988540649414,
729
+ "learning_rate": 8.066894071250374e-06,
730
+ "loss": 4.4521,
731
+ "step": 1030
732
+ },
733
+ {
734
+ "epoch": 0.3142706051220065,
735
+ "grad_norm": 18.560087203979492,
736
+ "learning_rate": 8.02808778131262e-06,
737
+ "loss": 3.7732,
738
+ "step": 1040
739
+ },
740
+ {
741
+ "epoch": 0.31729243786356426,
742
+ "grad_norm": 16.505374908447266,
743
+ "learning_rate": 7.988991272734407e-06,
744
+ "loss": 4.4711,
745
+ "step": 1050
746
+ },
747
+ {
748
+ "epoch": 0.320314270605122,
749
+ "grad_norm": 20.265331268310547,
750
+ "learning_rate": 7.94960829261172e-06,
751
+ "loss": 4.4707,
752
+ "step": 1060
753
+ },
754
+ {
755
+ "epoch": 0.3233361033466798,
756
+ "grad_norm": 19.918270111083984,
757
+ "learning_rate": 7.909942615496613e-06,
758
+ "loss": 4.6998,
759
+ "step": 1070
760
+ },
761
+ {
762
+ "epoch": 0.32635793608823754,
763
+ "grad_norm": 29.365598678588867,
764
+ "learning_rate": 7.869998043035442e-06,
765
+ "loss": 5.3852,
766
+ "step": 1080
767
+ },
768
+ {
769
+ "epoch": 0.32937976882979525,
770
+ "grad_norm": 15.32125186920166,
771
+ "learning_rate": 7.829778403604512e-06,
772
+ "loss": 5.0378,
773
+ "step": 1090
774
+ },
775
+ {
776
+ "epoch": 0.332401601571353,
777
+ "grad_norm": 33.20755386352539,
778
+ "learning_rate": 7.789287551943158e-06,
779
+ "loss": 6.0804,
780
+ "step": 1100
781
+ },
782
+ {
783
+ "epoch": 0.3354234343129108,
784
+ "grad_norm": 17.992769241333008,
785
+ "learning_rate": 7.748529368784293e-06,
786
+ "loss": 4.541,
787
+ "step": 1110
788
+ },
789
+ {
790
+ "epoch": 0.33844526705446853,
791
+ "grad_norm": 17.076702117919922,
792
+ "learning_rate": 7.707507760482473e-06,
793
+ "loss": 6.1712,
794
+ "step": 1120
795
+ },
796
+ {
797
+ "epoch": 0.3414670997960263,
798
+ "grad_norm": 16.922510147094727,
799
+ "learning_rate": 7.666226658639507e-06,
800
+ "loss": 3.763,
801
+ "step": 1130
802
+ },
803
+ {
804
+ "epoch": 0.34448893253758406,
805
+ "grad_norm": 23.991716384887695,
806
+ "learning_rate": 7.624690019727636e-06,
807
+ "loss": 3.6615,
808
+ "step": 1140
809
+ },
810
+ {
811
+ "epoch": 0.3475107652791418,
812
+ "grad_norm": 21.76751708984375,
813
+ "learning_rate": 7.58290182471034e-06,
814
+ "loss": 4.5626,
815
+ "step": 1150
816
+ },
817
+ {
818
+ "epoch": 0.3505325980206996,
819
+ "grad_norm": 15.035407066345215,
820
+ "learning_rate": 7.5408660786607976e-06,
821
+ "loss": 3.6885,
822
+ "step": 1160
823
+ },
824
+ {
825
+ "epoch": 0.3535544307622573,
826
+ "grad_norm": 22.35795021057129,
827
+ "learning_rate": 7.498586810378019e-06,
828
+ "loss": 2.9841,
829
+ "step": 1170
830
+ },
831
+ {
832
+ "epoch": 0.35657626350381505,
833
+ "grad_norm": 19.678627014160156,
834
+ "learning_rate": 7.456068072000731e-06,
835
+ "loss": 2.7928,
836
+ "step": 1180
837
+ },
838
+ {
839
+ "epoch": 0.3595980962453728,
840
+ "grad_norm": 22.308584213256836,
841
+ "learning_rate": 7.4133139386190026e-06,
842
+ "loss": 4.5458,
843
+ "step": 1190
844
+ },
845
+ {
846
+ "epoch": 0.3626199289869306,
847
+ "grad_norm": 18.34815216064453,
848
+ "learning_rate": 7.3703285078836796e-06,
849
+ "loss": 5.2143,
850
+ "step": 1200
851
+ },
852
+ {
853
+ "epoch": 0.36564176172848833,
854
+ "grad_norm": 16.58567237854004,
855
+ "learning_rate": 7.3271158996136625e-06,
856
+ "loss": 3.7281,
857
+ "step": 1210
858
+ },
859
+ {
860
+ "epoch": 0.3686635944700461,
861
+ "grad_norm": 21.284473419189453,
862
+ "learning_rate": 7.283680255401049e-06,
863
+ "loss": 4.4133,
864
+ "step": 1220
865
+ },
866
+ {
867
+ "epoch": 0.37168542721160386,
868
+ "grad_norm": 17.73834800720215,
869
+ "learning_rate": 7.240025738214193e-06,
870
+ "loss": 6.2388,
871
+ "step": 1230
872
+ },
873
+ {
874
+ "epoch": 0.3747072599531616,
875
+ "grad_norm": 31.61699867248535,
876
+ "learning_rate": 7.196156531998718e-06,
877
+ "loss": 4.5308,
878
+ "step": 1240
879
+ },
880
+ {
881
+ "epoch": 0.3777290926947193,
882
+ "grad_norm": 19.153860092163086,
883
+ "learning_rate": 7.152076841276527e-06,
884
+ "loss": 3.6474,
885
+ "step": 1250
886
+ },
887
+ {
888
+ "epoch": 0.3807509254362771,
889
+ "grad_norm": 19.91427993774414,
890
+ "learning_rate": 7.1077908907428154e-06,
891
+ "loss": 3.7991,
892
+ "step": 1260
893
+ },
894
+ {
895
+ "epoch": 0.38377275817783485,
896
+ "grad_norm": 31.496000289916992,
897
+ "learning_rate": 7.063302924861182e-06,
898
+ "loss": 3.8615,
899
+ "step": 1270
900
+ },
901
+ {
902
+ "epoch": 0.3867945909193926,
903
+ "grad_norm": 21.705524444580078,
904
+ "learning_rate": 7.018617207456821e-06,
905
+ "loss": 3.5938,
906
+ "step": 1280
907
+ },
908
+ {
909
+ "epoch": 0.3898164236609504,
910
+ "grad_norm": 18.876136779785156,
911
+ "learning_rate": 6.973738021307872e-06,
912
+ "loss": 3.6873,
913
+ "step": 1290
914
+ },
915
+ {
916
+ "epoch": 0.39283825640250813,
917
+ "grad_norm": 18.49332046508789,
918
+ "learning_rate": 6.9286696677349455e-06,
919
+ "loss": 5.946,
920
+ "step": 1300
921
+ },
922
+ {
923
+ "epoch": 0.3958600891440659,
924
+ "grad_norm": 15.16926383972168,
925
+ "learning_rate": 6.883416466188881e-06,
926
+ "loss": 3.6912,
927
+ "step": 1310
928
+ },
929
+ {
930
+ "epoch": 0.39888192188562366,
931
+ "grad_norm": 15.419941902160645,
932
+ "learning_rate": 6.837982753836755e-06,
933
+ "loss": 2.8732,
934
+ "step": 1320
935
+ },
936
+ {
937
+ "epoch": 0.40190375462718136,
938
+ "grad_norm": 37.54107666015625,
939
+ "learning_rate": 6.7923728851461955e-06,
940
+ "loss": 6.0613,
941
+ "step": 1330
942
+ },
943
+ {
944
+ "epoch": 0.4049255873687391,
945
+ "grad_norm": 21.823205947875977,
946
+ "learning_rate": 6.74659123146805e-06,
947
+ "loss": 3.6511,
948
+ "step": 1340
949
+ },
950
+ {
951
+ "epoch": 0.4079474201102969,
952
+ "grad_norm": 15.464320182800293,
953
+ "learning_rate": 6.70064218061742e-06,
954
+ "loss": 2.8003,
955
+ "step": 1350
956
+ },
957
+ {
958
+ "epoch": 0.41096925285185465,
959
+ "grad_norm": 16.415462493896484,
960
+ "learning_rate": 6.654530136453119e-06,
961
+ "loss": 4.3309,
962
+ "step": 1360
963
+ },
964
+ {
965
+ "epoch": 0.4139910855934124,
966
+ "grad_norm": 19.546598434448242,
967
+ "learning_rate": 6.608259518455599e-06,
968
+ "loss": 5.2213,
969
+ "step": 1370
970
+ },
971
+ {
972
+ "epoch": 0.4170129183349702,
973
+ "grad_norm": 14.3574800491333,
974
+ "learning_rate": 6.5618347613033875e-06,
975
+ "loss": 5.0989,
976
+ "step": 1380
977
+ },
978
+ {
979
+ "epoch": 0.42003475107652793,
980
+ "grad_norm": 16.57396125793457,
981
+ "learning_rate": 6.5152603144480406e-06,
982
+ "loss": 5.9716,
983
+ "step": 1390
984
+ },
985
+ {
986
+ "epoch": 0.4230565838180857,
987
+ "grad_norm": 30.545312881469727,
988
+ "learning_rate": 6.468540641687716e-06,
989
+ "loss": 4.5598,
990
+ "step": 1400
991
+ },
992
+ {
993
+ "epoch": 0.4260784165596434,
994
+ "grad_norm": 18.192867279052734,
995
+ "learning_rate": 6.421680220739337e-06,
996
+ "loss": 3.9198,
997
+ "step": 1410
998
+ },
999
+ {
1000
+ "epoch": 0.42910024930120116,
1001
+ "grad_norm": 32.15526580810547,
1002
+ "learning_rate": 6.374683542809447e-06,
1003
+ "loss": 7.8433,
1004
+ "step": 1420
1005
+ },
1006
+ {
1007
+ "epoch": 0.4321220820427589,
1008
+ "grad_norm": 15.70085620880127,
1009
+ "learning_rate": 6.327555112163761e-06,
1010
+ "loss": 4.3544,
1011
+ "step": 1430
1012
+ },
1013
+ {
1014
+ "epoch": 0.4351439147843167,
1015
+ "grad_norm": 16.828855514526367,
1016
+ "learning_rate": 6.280299445695469e-06,
1017
+ "loss": 5.1953,
1018
+ "step": 1440
1019
+ },
1020
+ {
1021
+ "epoch": 0.43816574752587445,
1022
+ "grad_norm": 19.912675857543945,
1023
+ "learning_rate": 6.232921072492319e-06,
1024
+ "loss": 4.3359,
1025
+ "step": 1450
1026
+ },
1027
+ {
1028
+ "epoch": 0.4411875802674322,
1029
+ "grad_norm": 25.961816787719727,
1030
+ "learning_rate": 6.185424533402543e-06,
1031
+ "loss": 4.3063,
1032
+ "step": 1460
1033
+ },
1034
+ {
1035
+ "epoch": 0.44420941300899,
1036
+ "grad_norm": 19.82756233215332,
1037
+ "learning_rate": 6.13781438059966e-06,
1038
+ "loss": 3.5112,
1039
+ "step": 1470
1040
+ },
1041
+ {
1042
+ "epoch": 0.44723124575054773,
1043
+ "grad_norm": 33.44493865966797,
1044
+ "learning_rate": 6.090095177146178e-06,
1045
+ "loss": 5.1505,
1046
+ "step": 1480
1047
+ },
1048
+ {
1049
+ "epoch": 0.45025307849210544,
1050
+ "grad_norm": 16.924360275268555,
1051
+ "learning_rate": 6.042271496556255e-06,
1052
+ "loss": 2.8263,
1053
+ "step": 1490
1054
+ },
1055
+ {
1056
+ "epoch": 0.4532749112336632,
1057
+ "grad_norm": 22.583179473876953,
1058
+ "learning_rate": 5.994347922357372e-06,
1059
+ "loss": 3.8395,
1060
+ "step": 1500
1061
+ },
1062
+ {
1063
+ "epoch": 0.45629674397522096,
1064
+ "grad_norm": 18.91628646850586,
1065
+ "learning_rate": 5.946329047651037e-06,
1066
+ "loss": 3.6049,
1067
+ "step": 1510
1068
+ },
1069
+ {
1070
+ "epoch": 0.4593185767167787,
1071
+ "grad_norm": 18.775754928588867,
1072
+ "learning_rate": 5.8982194746725686e-06,
1073
+ "loss": 2.7111,
1074
+ "step": 1520
1075
+ },
1076
+ {
1077
+ "epoch": 0.4623404094583365,
1078
+ "grad_norm": 23.321266174316406,
1079
+ "learning_rate": 5.850023814350007e-06,
1080
+ "loss": 4.2809,
1081
+ "step": 1530
1082
+ },
1083
+ {
1084
+ "epoch": 0.46536224219989425,
1085
+ "grad_norm": 11.822239875793457,
1086
+ "learning_rate": 5.801746685862197e-06,
1087
+ "loss": 6.0749,
1088
+ "step": 1540
1089
+ },
1090
+ {
1091
+ "epoch": 0.468384074941452,
1092
+ "grad_norm": 15.131773948669434,
1093
+ "learning_rate": 5.753392716196069e-06,
1094
+ "loss": 2.8267,
1095
+ "step": 1550
1096
+ },
1097
+ {
1098
+ "epoch": 0.4714059076830098,
1099
+ "grad_norm": 14.163749694824219,
1100
+ "learning_rate": 5.704966539703185e-06,
1101
+ "loss": 3.6323,
1102
+ "step": 1560
1103
+ },
1104
+ {
1105
+ "epoch": 0.4744277404245675,
1106
+ "grad_norm": 16.469493865966797,
1107
+ "learning_rate": 5.656472797655571e-06,
1108
+ "loss": 4.4244,
1109
+ "step": 1570
1110
+ },
1111
+ {
1112
+ "epoch": 0.47744957316612524,
1113
+ "grad_norm": 16.80313491821289,
1114
+ "learning_rate": 5.60791613780088e-06,
1115
+ "loss": 2.7757,
1116
+ "step": 1580
1117
+ },
1118
+ {
1119
+ "epoch": 0.480471405907683,
1120
+ "grad_norm": 22.86004638671875,
1121
+ "learning_rate": 5.5593012139169525e-06,
1122
+ "loss": 4.3241,
1123
+ "step": 1590
1124
+ },
1125
+ {
1126
+ "epoch": 0.48349323864924076,
1127
+ "grad_norm": 21.40558624267578,
1128
+ "learning_rate": 5.510632685365777e-06,
1129
+ "loss": 4.4159,
1130
+ "step": 1600
1131
+ },
1132
+ {
1133
+ "epoch": 0.4865150713907985,
1134
+ "grad_norm": 17.967065811157227,
1135
+ "learning_rate": 5.461915216646938e-06,
1136
+ "loss": 2.8152,
1137
+ "step": 1610
1138
+ },
1139
+ {
1140
+ "epoch": 0.4895369041323563,
1141
+ "grad_norm": 21.66280174255371,
1142
+ "learning_rate": 5.41315347695055e-06,
1143
+ "loss": 4.2485,
1144
+ "step": 1620
1145
+ },
1146
+ {
1147
+ "epoch": 0.49255873687391405,
1148
+ "grad_norm": 21.95995330810547,
1149
+ "learning_rate": 5.364352139709758e-06,
1150
+ "loss": 4.9245,
1151
+ "step": 1630
1152
+ },
1153
+ {
1154
+ "epoch": 0.4955805696154718,
1155
+ "grad_norm": 16.06268310546875,
1156
+ "learning_rate": 5.315515882152822e-06,
1157
+ "loss": 3.5401,
1158
+ "step": 1640
1159
+ },
1160
+ {
1161
+ "epoch": 0.4986024023570295,
1162
+ "grad_norm": 13.898233413696289,
1163
+ "learning_rate": 5.266649384854842e-06,
1164
+ "loss": 4.2544,
1165
+ "step": 1650
1166
+ },
1167
+ {
1168
+ "epoch": 0.5016242350985873,
1169
+ "grad_norm": 21.29293441772461,
1170
+ "learning_rate": 5.217757331289165e-06,
1171
+ "loss": 3.7029,
1172
+ "step": 1660
1173
+ },
1174
+ {
1175
+ "epoch": 0.5046460678401451,
1176
+ "grad_norm": 19.487884521484375,
1177
+ "learning_rate": 5.168844407378506e-06,
1178
+ "loss": 4.8677,
1179
+ "step": 1670
1180
+ },
1181
+ {
1182
+ "epoch": 0.5076679005817029,
1183
+ "grad_norm": 13.403663635253906,
1184
+ "learning_rate": 5.119915301045836e-06,
1185
+ "loss": 2.8783,
1186
+ "step": 1680
1187
+ },
1188
+ {
1189
+ "epoch": 0.5106897333232605,
1190
+ "grad_norm": 23.766260147094727,
1191
+ "learning_rate": 5.070974701765089e-06,
1192
+ "loss": 5.2051,
1193
+ "step": 1690
1194
+ },
1195
+ {
1196
+ "epoch": 0.5137115660648183,
1197
+ "grad_norm": 20.28452491760254,
1198
+ "learning_rate": 5.022027300111712e-06,
1199
+ "loss": 4.4194,
1200
+ "step": 1700
1201
+ },
1202
+ {
1203
+ "epoch": 0.516733398806376,
1204
+ "grad_norm": 15.334933280944824,
1205
+ "learning_rate": 4.973077787313099e-06,
1206
+ "loss": 4.4744,
1207
+ "step": 1710
1208
+ },
1209
+ {
1210
+ "epoch": 0.5197552315479338,
1211
+ "grad_norm": 16.702787399291992,
1212
+ "learning_rate": 4.924130854798983e-06,
1213
+ "loss": 5.1432,
1214
+ "step": 1720
1215
+ },
1216
+ {
1217
+ "epoch": 0.5227770642894916,
1218
+ "grad_norm": 14.432331085205078,
1219
+ "learning_rate": 4.875191193751803e-06,
1220
+ "loss": 2.7788,
1221
+ "step": 1730
1222
+ },
1223
+ {
1224
+ "epoch": 0.5257988970310493,
1225
+ "grad_norm": 15.956453323364258,
1226
+ "learning_rate": 4.826263494657077e-06,
1227
+ "loss": 3.4763,
1228
+ "step": 1740
1229
+ },
1230
+ {
1231
+ "epoch": 0.5288207297726071,
1232
+ "grad_norm": 34.29404830932617,
1233
+ "learning_rate": 4.777352446853863e-06,
1234
+ "loss": 5.0345,
1235
+ "step": 1750
1236
+ },
1237
+ {
1238
+ "epoch": 0.5318425625141648,
1239
+ "grad_norm": 20.15493392944336,
1240
+ "learning_rate": 4.72846273808533e-06,
1241
+ "loss": 3.5034,
1242
+ "step": 1760
1243
+ },
1244
+ {
1245
+ "epoch": 0.5348643952557226,
1246
+ "grad_norm": 18.872026443481445,
1247
+ "learning_rate": 4.679599054049458e-06,
1248
+ "loss": 3.3785,
1249
+ "step": 1770
1250
+ },
1251
+ {
1252
+ "epoch": 0.5378862279972804,
1253
+ "grad_norm": 19.723176956176758,
1254
+ "learning_rate": 4.630766077949965e-06,
1255
+ "loss": 6.0113,
1256
+ "step": 1780
1257
+ },
1258
+ {
1259
+ "epoch": 0.5409080607388381,
1260
+ "grad_norm": 31.925785064697266,
1261
+ "learning_rate": 4.5819684900474484e-06,
1262
+ "loss": 4.3306,
1263
+ "step": 1790
1264
+ },
1265
+ {
1266
+ "epoch": 0.5439298934803959,
1267
+ "grad_norm": 14.491710662841797,
1268
+ "learning_rate": 4.5332109672108245e-06,
1269
+ "loss": 4.4546,
1270
+ "step": 1800
1271
+ },
1272
+ {
1273
+ "epoch": 0.5469517262219536,
1274
+ "grad_norm": 13.951831817626953,
1275
+ "learning_rate": 4.484498182469085e-06,
1276
+ "loss": 3.6289,
1277
+ "step": 1810
1278
+ },
1279
+ {
1280
+ "epoch": 0.5499735589635114,
1281
+ "grad_norm": 20.55958366394043,
1282
+ "learning_rate": 4.435834804563422e-06,
1283
+ "loss": 5.909,
1284
+ "step": 1820
1285
+ },
1286
+ {
1287
+ "epoch": 0.5529953917050692,
1288
+ "grad_norm": 20.23394775390625,
1289
+ "learning_rate": 4.387225497499767e-06,
1290
+ "loss": 3.5712,
1291
+ "step": 1830
1292
+ },
1293
+ {
1294
+ "epoch": 0.5560172244466269,
1295
+ "grad_norm": 16.559497833251953,
1296
+ "learning_rate": 4.3386749201017856e-06,
1297
+ "loss": 3.4663,
1298
+ "step": 1840
1299
+ },
1300
+ {
1301
+ "epoch": 0.5590390571881846,
1302
+ "grad_norm": 15.608750343322754,
1303
+ "learning_rate": 4.290187725564356e-06,
1304
+ "loss": 6.0263,
1305
+ "step": 1850
1306
+ },
1307
+ {
1308
+ "epoch": 0.5620608899297423,
1309
+ "grad_norm": 14.97095775604248,
1310
+ "learning_rate": 4.2417685610076135e-06,
1311
+ "loss": 3.4707,
1312
+ "step": 1860
1313
+ },
1314
+ {
1315
+ "epoch": 0.5650827226713001,
1316
+ "grad_norm": 14.489383697509766,
1317
+ "learning_rate": 4.193422067031535e-06,
1318
+ "loss": 4.3081,
1319
+ "step": 1870
1320
+ },
1321
+ {
1322
+ "epoch": 0.5681045554128579,
1323
+ "grad_norm": 14.916642189025879,
1324
+ "learning_rate": 4.145152877271196e-06,
1325
+ "loss": 4.1373,
1326
+ "step": 1880
1327
+ },
1328
+ {
1329
+ "epoch": 0.5711263881544156,
1330
+ "grad_norm": 16.6586856842041,
1331
+ "learning_rate": 4.096965617952667e-06,
1332
+ "loss": 4.4436,
1333
+ "step": 1890
1334
+ },
1335
+ {
1336
+ "epoch": 0.5741482208959734,
1337
+ "grad_norm": 19.84169578552246,
1338
+ "learning_rate": 4.048864907449619e-06,
1339
+ "loss": 3.4927,
1340
+ "step": 1900
1341
+ },
1342
+ {
1343
+ "epoch": 0.5771700536375312,
1344
+ "grad_norm": 19.735633850097656,
1345
+ "learning_rate": 4.000855355840695e-06,
1346
+ "loss": 3.5524,
1347
+ "step": 1910
1348
+ },
1349
+ {
1350
+ "epoch": 0.5801918863790889,
1351
+ "grad_norm": 17.886032104492188,
1352
+ "learning_rate": 3.952941564467665e-06,
1353
+ "loss": 4.2525,
1354
+ "step": 1920
1355
+ },
1356
+ {
1357
+ "epoch": 0.5832137191206467,
1358
+ "grad_norm": 19.78135871887207,
1359
+ "learning_rate": 3.905128125494427e-06,
1360
+ "loss": 4.3003,
1361
+ "step": 1930
1362
+ },
1363
+ {
1364
+ "epoch": 0.5862355518622044,
1365
+ "grad_norm": 32.764678955078125,
1366
+ "learning_rate": 3.8574196214668876e-06,
1367
+ "loss": 4.5226,
1368
+ "step": 1940
1369
+ },
1370
+ {
1371
+ "epoch": 0.5892573846037622,
1372
+ "grad_norm": 29.241281509399414,
1373
+ "learning_rate": 3.8098206248737486e-06,
1374
+ "loss": 5.1581,
1375
+ "step": 1950
1376
+ },
1377
+ {
1378
+ "epoch": 0.59227921734532,
1379
+ "grad_norm": 21.178043365478516,
1380
+ "learning_rate": 3.7623356977082794e-06,
1381
+ "loss": 2.6207,
1382
+ "step": 1960
1383
+ },
1384
+ {
1385
+ "epoch": 0.5953010500868777,
1386
+ "grad_norm": 21.119003295898438,
1387
+ "learning_rate": 3.714969391031084e-06,
1388
+ "loss": 4.2953,
1389
+ "step": 1970
1390
+ },
1391
+ {
1392
+ "epoch": 0.5983228828284355,
1393
+ "grad_norm": 14.517345428466797,
1394
+ "learning_rate": 3.6677262445339136e-06,
1395
+ "loss": 3.5911,
1396
+ "step": 1980
1397
+ },
1398
+ {
1399
+ "epoch": 0.6013447155699932,
1400
+ "grad_norm": 17.18401527404785,
1401
+ "learning_rate": 3.6206107861045803e-06,
1402
+ "loss": 2.6191,
1403
+ "step": 1990
1404
+ },
1405
+ {
1406
+ "epoch": 0.604366548311551,
1407
+ "grad_norm": 13.34080982208252,
1408
+ "learning_rate": 3.5736275313929826e-06,
1409
+ "loss": 4.3353,
1410
+ "step": 2000
1411
+ },
1412
+ {
1413
+ "epoch": 0.6073883810531087,
1414
+ "grad_norm": 16.087505340576172,
1415
+ "learning_rate": 3.5267809833783213e-06,
1416
+ "loss": 4.8641,
1417
+ "step": 2010
1418
+ },
1419
+ {
1420
+ "epoch": 0.6104102137946664,
1421
+ "grad_norm": 23.290111541748047,
1422
+ "learning_rate": 3.4800756319375326e-06,
1423
+ "loss": 3.52,
1424
+ "step": 2020
1425
+ },
1426
+ {
1427
+ "epoch": 0.6134320465362242,
1428
+ "grad_norm": 22.9693660736084,
1429
+ "learning_rate": 3.433515953414953e-06,
1430
+ "loss": 2.8082,
1431
+ "step": 2030
1432
+ },
1433
+ {
1434
+ "epoch": 0.616453879277782,
1435
+ "grad_norm": 32.13260269165039,
1436
+ "learning_rate": 3.387106410193308e-06,
1437
+ "loss": 5.8238,
1438
+ "step": 2040
1439
+ },
1440
+ {
1441
+ "epoch": 0.6194757120193397,
1442
+ "grad_norm": 20.72865867614746,
1443
+ "learning_rate": 3.3408514502660195e-06,
1444
+ "loss": 5.2489,
1445
+ "step": 2050
1446
+ },
1447
+ {
1448
+ "epoch": 0.6224975447608975,
1449
+ "grad_norm": 15.360533714294434,
1450
+ "learning_rate": 3.2947555068109057e-06,
1451
+ "loss": 3.4271,
1452
+ "step": 2060
1453
+ },
1454
+ {
1455
+ "epoch": 0.6255193775024552,
1456
+ "grad_norm": 18.229646682739258,
1457
+ "learning_rate": 3.248822997765295e-06,
1458
+ "loss": 2.8352,
1459
+ "step": 2070
1460
+ },
1461
+ {
1462
+ "epoch": 0.628541210244013,
1463
+ "grad_norm": 19.263635635375977,
1464
+ "learning_rate": 3.203058325402599e-06,
1465
+ "loss": 4.3576,
1466
+ "step": 2080
1467
+ },
1468
+ {
1469
+ "epoch": 0.6315630429855708,
1470
+ "grad_norm": 18.10948371887207,
1471
+ "learning_rate": 3.1574658759103904e-06,
1472
+ "loss": 4.323,
1473
+ "step": 2090
1474
+ },
1475
+ {
1476
+ "epoch": 0.6345848757271285,
1477
+ "grad_norm": 24.11922264099121,
1478
+ "learning_rate": 3.1120500189700204e-06,
1479
+ "loss": 3.4623,
1480
+ "step": 2100
1481
+ },
1482
+ {
1483
+ "epoch": 0.6376067084686863,
1484
+ "grad_norm": 17.615623474121094,
1485
+ "learning_rate": 3.066815107337815e-06,
1486
+ "loss": 4.239,
1487
+ "step": 2110
1488
+ },
1489
+ {
1490
+ "epoch": 0.640628541210244,
1491
+ "grad_norm": 17.02035140991211,
1492
+ "learning_rate": 3.0217654764279114e-06,
1493
+ "loss": 3.6575,
1494
+ "step": 2120
1495
+ },
1496
+ {
1497
+ "epoch": 0.6436503739518018,
1498
+ "grad_norm": 24.722911834716797,
1499
+ "learning_rate": 2.9769054438967192e-06,
1500
+ "loss": 6.0434,
1501
+ "step": 2130
1502
+ },
1503
+ {
1504
+ "epoch": 0.6466722066933596,
1505
+ "grad_norm": 30.0717830657959,
1506
+ "learning_rate": 2.9322393092291256e-06,
1507
+ "loss": 5.6673,
1508
+ "step": 2140
1509
+ },
1510
+ {
1511
+ "epoch": 0.6496940394349173,
1512
+ "grad_norm": 18.82298469543457,
1513
+ "learning_rate": 2.887771353326422e-06,
1514
+ "loss": 4.2853,
1515
+ "step": 2150
1516
+ },
1517
+ {
1518
+ "epoch": 0.6527158721764751,
1519
+ "grad_norm": 15.994894027709961,
1520
+ "learning_rate": 2.8435058380959957e-06,
1521
+ "loss": 2.6522,
1522
+ "step": 2160
1523
+ },
1524
+ {
1525
+ "epoch": 0.6557377049180327,
1526
+ "grad_norm": 17.15923500061035,
1527
+ "learning_rate": 2.7994470060428835e-06,
1528
+ "loss": 4.1311,
1529
+ "step": 2170
1530
+ },
1531
+ {
1532
+ "epoch": 0.6587595376595905,
1533
+ "grad_norm": 16.892683029174805,
1534
+ "learning_rate": 2.7555990798631436e-06,
1535
+ "loss": 4.9307,
1536
+ "step": 2180
1537
+ },
1538
+ {
1539
+ "epoch": 0.6617813704011483,
1540
+ "grad_norm": 16.922779083251953,
1541
+ "learning_rate": 2.711966262039145e-06,
1542
+ "loss": 3.3275,
1543
+ "step": 2190
1544
+ },
1545
+ {
1546
+ "epoch": 0.664803203142706,
1547
+ "grad_norm": 20.438188552856445,
1548
+ "learning_rate": 2.668552734436802e-06,
1549
+ "loss": 4.3642,
1550
+ "step": 2200
1551
+ },
1552
+ {
1553
+ "epoch": 0.6678250358842638,
1554
+ "grad_norm": 17.198863983154297,
1555
+ "learning_rate": 2.6253626579047653e-06,
1556
+ "loss": 5.8144,
1557
+ "step": 2210
1558
+ },
1559
+ {
1560
+ "epoch": 0.6708468686258215,
1561
+ "grad_norm": 32.332481384277344,
1562
+ "learning_rate": 2.582400171875638e-06,
1563
+ "loss": 3.4467,
1564
+ "step": 2220
1565
+ },
1566
+ {
1567
+ "epoch": 0.6738687013673793,
1568
+ "grad_norm": 28.988691329956055,
1569
+ "learning_rate": 2.5396693939692474e-06,
1570
+ "loss": 4.905,
1571
+ "step": 2230
1572
+ },
1573
+ {
1574
+ "epoch": 0.6768905341089371,
1575
+ "grad_norm": 13.460684776306152,
1576
+ "learning_rate": 2.4971744195979985e-06,
1577
+ "loss": 5.1182,
1578
+ "step": 2240
1579
+ },
1580
+ {
1581
+ "epoch": 0.6799123668504948,
1582
+ "grad_norm": 30.923328399658203,
1583
+ "learning_rate": 2.4549193215743706e-06,
1584
+ "loss": 5.8667,
1585
+ "step": 2250
1586
+ },
1587
+ {
1588
+ "epoch": 0.6829341995920526,
1589
+ "grad_norm": 18.018512725830078,
1590
+ "learning_rate": 2.4129081497205536e-06,
1591
+ "loss": 3.3709,
1592
+ "step": 2260
1593
+ },
1594
+ {
1595
+ "epoch": 0.6859560323336104,
1596
+ "grad_norm": 30.849058151245117,
1597
+ "learning_rate": 2.3711449304803174e-06,
1598
+ "loss": 4.1145,
1599
+ "step": 2270
1600
+ },
1601
+ {
1602
+ "epoch": 0.6889778650751681,
1603
+ "grad_norm": 25.983388900756836,
1604
+ "learning_rate": 2.329633666533103e-06,
1605
+ "loss": 4.0748,
1606
+ "step": 2280
1607
+ },
1608
+ {
1609
+ "epoch": 0.6919996978167259,
1610
+ "grad_norm": 17.239654541015625,
1611
+ "learning_rate": 2.288378336410398e-06,
1612
+ "loss": 4.238,
1613
+ "step": 2290
1614
+ },
1615
+ {
1616
+ "epoch": 0.6950215305582836,
1617
+ "grad_norm": 17.989116668701172,
1618
+ "learning_rate": 2.2473828941144277e-06,
1619
+ "loss": 4.8996,
1620
+ "step": 2300
1621
+ },
1622
+ {
1623
+ "epoch": 0.6980433632998414,
1624
+ "grad_norm": 32.616302490234375,
1625
+ "learning_rate": 2.20665126873919e-06,
1626
+ "loss": 3.3575,
1627
+ "step": 2310
1628
+ },
1629
+ {
1630
+ "epoch": 0.7010651960413992,
1631
+ "grad_norm": 15.997688293457031,
1632
+ "learning_rate": 2.1661873640938818e-06,
1633
+ "loss": 4.1233,
1634
+ "step": 2320
1635
+ },
1636
+ {
1637
+ "epoch": 0.7040870287829568,
1638
+ "grad_norm": 19.421972274780273,
1639
+ "learning_rate": 2.1259950583287633e-06,
1640
+ "loss": 4.1367,
1641
+ "step": 2330
1642
+ },
1643
+ {
1644
+ "epoch": 0.7071088615245146,
1645
+ "grad_norm": 20.1212100982666,
1646
+ "learning_rate": 2.086078203563439e-06,
1647
+ "loss": 4.7622,
1648
+ "step": 2340
1649
+ },
1650
+ {
1651
+ "epoch": 0.7101306942660723,
1652
+ "grad_norm": 14.532552719116211,
1653
+ "learning_rate": 2.0464406255176967e-06,
1654
+ "loss": 4.0196,
1655
+ "step": 2350
1656
+ },
1657
+ {
1658
+ "epoch": 0.7131525270076301,
1659
+ "grad_norm": 29.55924415588379,
1660
+ "learning_rate": 2.0070861231448142e-06,
1661
+ "loss": 4.9694,
1662
+ "step": 2360
1663
+ },
1664
+ {
1665
+ "epoch": 0.7161743597491879,
1666
+ "grad_norm": 21.097187042236328,
1667
+ "learning_rate": 1.968018468267472e-06,
1668
+ "loss": 4.2314,
1669
+ "step": 2370
1670
+ },
1671
+ {
1672
+ "epoch": 0.7191961924907456,
1673
+ "grad_norm": 13.943464279174805,
1674
+ "learning_rate": 1.929241405216254e-06,
1675
+ "loss": 4.0535,
1676
+ "step": 2380
1677
+ },
1678
+ {
1679
+ "epoch": 0.7222180252323034,
1680
+ "grad_norm": 19.29151725769043,
1681
+ "learning_rate": 1.8907586504707776e-06,
1682
+ "loss": 4.7497,
1683
+ "step": 2390
1684
+ },
1685
+ {
1686
+ "epoch": 0.7252398579738611,
1687
+ "grad_norm": 18.542991638183594,
1688
+ "learning_rate": 1.8525738923035002e-06,
1689
+ "loss": 2.5704,
1690
+ "step": 2400
1691
+ },
1692
+ {
1693
+ "epoch": 0.7282616907154189,
1694
+ "grad_norm": 18.23619842529297,
1695
+ "learning_rate": 1.8146907904262268e-06,
1696
+ "loss": 4.2542,
1697
+ "step": 2410
1698
+ },
1699
+ {
1700
+ "epoch": 0.7312835234569767,
1701
+ "grad_norm": 21.722688674926758,
1702
+ "learning_rate": 1.7771129756393545e-06,
1703
+ "loss": 3.4271,
1704
+ "step": 2420
1705
+ },
1706
+ {
1707
+ "epoch": 0.7343053561985344,
1708
+ "grad_norm": 16.661977767944336,
1709
+ "learning_rate": 1.7398440494838947e-06,
1710
+ "loss": 3.604,
1711
+ "step": 2430
1712
+ },
1713
+ {
1714
+ "epoch": 0.7373271889400922,
1715
+ "grad_norm": 16.67827606201172,
1716
+ "learning_rate": 1.7028875838962822e-06,
1717
+ "loss": 4.1239,
1718
+ "step": 2440
1719
+ },
1720
+ {
1721
+ "epoch": 0.74034902168165,
1722
+ "grad_norm": 33.99874496459961,
1723
+ "learning_rate": 1.6662471208660392e-06,
1724
+ "loss": 4.0579,
1725
+ "step": 2450
1726
+ },
1727
+ {
1728
+ "epoch": 0.7433708544232077,
1729
+ "grad_norm": 21.555774688720703,
1730
+ "learning_rate": 1.6299261720963095e-06,
1731
+ "loss": 4.1917,
1732
+ "step": 2460
1733
+ },
1734
+ {
1735
+ "epoch": 0.7463926871647655,
1736
+ "grad_norm": 14.352119445800781,
1737
+ "learning_rate": 1.5939282186672705e-06,
1738
+ "loss": 4.9304,
1739
+ "step": 2470
1740
+ },
1741
+ {
1742
+ "epoch": 0.7494145199063232,
1743
+ "grad_norm": 20.739620208740234,
1744
+ "learning_rate": 1.5582567107025237e-06,
1745
+ "loss": 4.8278,
1746
+ "step": 2480
1747
+ },
1748
+ {
1749
+ "epoch": 0.7524363526478809,
1750
+ "grad_norm": 29.204471588134766,
1751
+ "learning_rate": 1.5229150670384057e-06,
1752
+ "loss": 3.3692,
1753
+ "step": 2490
1754
+ },
1755
+ {
1756
+ "epoch": 0.7554581853894387,
1757
+ "grad_norm": 20.03524398803711,
1758
+ "learning_rate": 1.4879066748963295e-06,
1759
+ "loss": 2.5494,
1760
+ "step": 2500
1761
+ },
1762
+ {
1763
+ "epoch": 0.7584800181309964,
1764
+ "grad_norm": 27.458927154541016,
1765
+ "learning_rate": 1.4532348895581466e-06,
1766
+ "loss": 3.4744,
1767
+ "step": 2510
1768
+ },
1769
+ {
1770
+ "epoch": 0.7615018508725542,
1771
+ "grad_norm": 28.542675018310547,
1772
+ "learning_rate": 1.4189030340445648e-06,
1773
+ "loss": 6.7224,
1774
+ "step": 2520
1775
+ },
1776
+ {
1777
+ "epoch": 0.7645236836141119,
1778
+ "grad_norm": 15.871747016906738,
1779
+ "learning_rate": 1.3849143987966646e-06,
1780
+ "loss": 4.9879,
1781
+ "step": 2530
1782
+ },
1783
+ {
1784
+ "epoch": 0.7675455163556697,
1785
+ "grad_norm": 16.10350799560547,
1786
+ "learning_rate": 1.3512722413605356e-06,
1787
+ "loss": 4.0848,
1788
+ "step": 2540
1789
+ },
1790
+ {
1791
+ "epoch": 0.7705673490972275,
1792
+ "grad_norm": 15.013642311096191,
1793
+ "learning_rate": 1.3179797860750654e-06,
1794
+ "loss": 4.9059,
1795
+ "step": 2550
1796
+ },
1797
+ {
1798
+ "epoch": 0.7735891818387852,
1799
+ "grad_norm": 17.056211471557617,
1800
+ "learning_rate": 1.2850402237629184e-06,
1801
+ "loss": 4.1558,
1802
+ "step": 2560
1803
+ },
1804
+ {
1805
+ "epoch": 0.776611014580343,
1806
+ "grad_norm": 13.357272148132324,
1807
+ "learning_rate": 1.2524567114247083e-06,
1808
+ "loss": 3.3524,
1809
+ "step": 2570
1810
+ },
1811
+ {
1812
+ "epoch": 0.7796328473219007,
1813
+ "grad_norm": 15.318449974060059,
1814
+ "learning_rate": 1.2202323719364324e-06,
1815
+ "loss": 3.2666,
1816
+ "step": 2580
1817
+ },
1818
+ {
1819
+ "epoch": 0.7826546800634585,
1820
+ "grad_norm": 20.867525100708008,
1821
+ "learning_rate": 1.1883702937501708e-06,
1822
+ "loss": 4.1267,
1823
+ "step": 2590
1824
+ },
1825
+ {
1826
+ "epoch": 0.7856765128050163,
1827
+ "grad_norm": 20.91588020324707,
1828
+ "learning_rate": 1.1568735305980694e-06,
1829
+ "loss": 4.1263,
1830
+ "step": 2600
1831
+ },
1832
+ {
1833
+ "epoch": 0.788698345546574,
1834
+ "grad_norm": 23.296667098999023,
1835
+ "learning_rate": 1.1257451011996807e-06,
1836
+ "loss": 3.4198,
1837
+ "step": 2610
1838
+ },
1839
+ {
1840
+ "epoch": 0.7917201782881318,
1841
+ "grad_norm": 32.17024230957031,
1842
+ "learning_rate": 1.0949879889726295e-06,
1843
+ "loss": 3.4727,
1844
+ "step": 2620
1845
+ },
1846
+ {
1847
+ "epoch": 0.7947420110296896,
1848
+ "grad_norm": 30.94739532470703,
1849
+ "learning_rate": 1.0646051417466801e-06,
1850
+ "loss": 3.4438,
1851
+ "step": 2630
1852
+ },
1853
+ {
1854
+ "epoch": 0.7977638437712473,
1855
+ "grad_norm": 24.171409606933594,
1856
+ "learning_rate": 1.0345994714812135e-06,
1857
+ "loss": 4.1562,
1858
+ "step": 2640
1859
+ },
1860
+ {
1861
+ "epoch": 0.800785676512805,
1862
+ "grad_norm": 15.973287582397461,
1863
+ "learning_rate": 1.0049738539861332e-06,
1864
+ "loss": 3.3106,
1865
+ "step": 2650
1866
+ },
1867
+ {
1868
+ "epoch": 0.8038075092543627,
1869
+ "grad_norm": 16.17388343811035,
1870
+ "learning_rate": 9.757311286462428e-07,
1871
+ "loss": 4.1695,
1872
+ "step": 2660
1873
+ },
1874
+ {
1875
+ "epoch": 0.8068293419959205,
1876
+ "grad_norm": 19.307254791259766,
1877
+ "learning_rate": 9.468740981491143e-07,
1878
+ "loss": 4.2039,
1879
+ "step": 2670
1880
+ },
1881
+ {
1882
+ "epoch": 0.8098511747374783,
1883
+ "grad_norm": 13.707403182983398,
1884
+ "learning_rate": 9.1840552821647e-07,
1885
+ "loss": 4.0537,
1886
+ "step": 2680
1887
+ },
1888
+ {
1889
+ "epoch": 0.812873007479036,
1890
+ "grad_norm": 16.229114532470703,
1891
+ "learning_rate": 8.903281473391152e-07,
1892
+ "loss": 3.3216,
1893
+ "step": 2690
1894
+ },
1895
+ {
1896
+ "epoch": 0.8158948402205938,
1897
+ "grad_norm": 16.56165313720703,
1898
+ "learning_rate": 8.62644646515427e-07,
1899
+ "loss": 5.7495,
1900
+ "step": 2700
1901
+ },
1902
+ {
1903
+ "epoch": 0.8189166729621515,
1904
+ "grad_norm": 13.074578285217285,
1905
+ "learning_rate": 8.353576789934436e-07,
1906
+ "loss": 3.4104,
1907
+ "step": 2710
1908
+ },
1909
+ {
1910
+ "epoch": 0.8219385057037093,
1911
+ "grad_norm": 20.466753005981445,
1912
+ "learning_rate": 8.084698600165797e-07,
1913
+ "loss": 3.5412,
1914
+ "step": 2720
1915
+ },
1916
+ {
1917
+ "epoch": 0.8249603384452671,
1918
+ "grad_norm": 18.137537002563477,
1919
+ "learning_rate": 7.819837665729596e-07,
1920
+ "loss": 4.105,
1921
+ "step": 2730
1922
+ },
1923
+ {
1924
+ "epoch": 0.8279821711868248,
1925
+ "grad_norm": 28.85208511352539,
1926
+ "learning_rate": 7.559019371484521e-07,
1927
+ "loss": 3.3502,
1928
+ "step": 2740
1929
+ },
1930
+ {
1931
+ "epoch": 0.8310040039283826,
1932
+ "grad_norm": 16.86795997619629,
1933
+ "learning_rate": 7.302268714833622e-07,
1934
+ "loss": 4.1471,
1935
+ "step": 2750
1936
+ },
1937
+ {
1938
+ "epoch": 0.8340258366699403,
1939
+ "grad_norm": 16.45426368713379,
1940
+ "learning_rate": 7.049610303328541e-07,
1941
+ "loss": 3.531,
1942
+ "step": 2760
1943
+ },
1944
+ {
1945
+ "epoch": 0.8370476694114981,
1946
+ "grad_norm": 16.50694465637207,
1947
+ "learning_rate": 6.80106835231113e-07,
1948
+ "loss": 4.2983,
1949
+ "step": 2770
1950
+ },
1951
+ {
1952
+ "epoch": 0.8400695021530559,
1953
+ "grad_norm": 18.195581436157227,
1954
+ "learning_rate": 6.556666682592494e-07,
1955
+ "loss": 3.3125,
1956
+ "step": 2780
1957
+ },
1958
+ {
1959
+ "epoch": 0.8430913348946136,
1960
+ "grad_norm": 16.14658546447754,
1961
+ "learning_rate": 6.316428718170037e-07,
1962
+ "loss": 2.4715,
1963
+ "step": 2790
1964
+ },
1965
+ {
1966
+ "epoch": 0.8461131676361714,
1967
+ "grad_norm": 19.641435623168945,
1968
+ "learning_rate": 6.080377483982425e-07,
1969
+ "loss": 3.2894,
1970
+ "step": 2800
1971
+ },
1972
+ {
1973
+ "epoch": 0.849135000377729,
1974
+ "grad_norm": 18.186119079589844,
1975
+ "learning_rate": 5.848535603702798e-07,
1976
+ "loss": 3.3862,
1977
+ "step": 2810
1978
+ },
1979
+ {
1980
+ "epoch": 0.8521568331192868,
1981
+ "grad_norm": 15.75075912475586,
1982
+ "learning_rate": 5.62092529757054e-07,
1983
+ "loss": 6.3941,
1984
+ "step": 2820
1985
+ },
1986
+ {
1987
+ "epoch": 0.8551786658608446,
1988
+ "grad_norm": 20.051259994506836,
1989
+ "learning_rate": 5.397568380261559e-07,
1990
+ "loss": 2.3455,
1991
+ "step": 2830
1992
+ },
1993
+ {
1994
+ "epoch": 0.8582004986024023,
1995
+ "grad_norm": 15.361984252929688,
1996
+ "learning_rate": 5.178486258797555e-07,
1997
+ "loss": 4.1372,
1998
+ "step": 2840
1999
+ },
2000
+ {
2001
+ "epoch": 0.8612223313439601,
2002
+ "grad_norm": 15.885826110839844,
2003
+ "learning_rate": 4.963699930494365e-07,
2004
+ "loss": 3.3724,
2005
+ "step": 2850
2006
+ },
2007
+ {
2008
+ "epoch": 0.8642441640855179,
2009
+ "grad_norm": 20.120771408081055,
2010
+ "learning_rate": 4.75322998094942e-07,
2011
+ "loss": 4.2862,
2012
+ "step": 2860
2013
+ },
2014
+ {
2015
+ "epoch": 0.8672659968270756,
2016
+ "grad_norm": 19.651308059692383,
2017
+ "learning_rate": 4.5470965820689384e-07,
2018
+ "loss": 2.6081,
2019
+ "step": 2870
2020
+ },
2021
+ {
2022
+ "epoch": 0.8702878295686334,
2023
+ "grad_norm": 20.324071884155273,
2024
+ "learning_rate": 4.345319490134453e-07,
2025
+ "loss": 3.0586,
2026
+ "step": 2880
2027
+ },
2028
+ {
2029
+ "epoch": 0.8733096623101911,
2030
+ "grad_norm": 15.238956451416016,
2031
+ "learning_rate": 4.147918043909405e-07,
2032
+ "loss": 4.7833,
2033
+ "step": 2890
2034
+ },
2035
+ {
2036
+ "epoch": 0.8763314950517489,
2037
+ "grad_norm": 17.426593780517578,
2038
+ "learning_rate": 3.9549111627856794e-07,
2039
+ "loss": 4.7313,
2040
+ "step": 2900
2041
+ },
2042
+ {
2043
+ "epoch": 0.8793533277933067,
2044
+ "grad_norm": 17.20795440673828,
2045
+ "learning_rate": 3.766317344970288e-07,
2046
+ "loss": 4.1551,
2047
+ "step": 2910
2048
+ },
2049
+ {
2050
+ "epoch": 0.8823751605348644,
2051
+ "grad_norm": 18.264366149902344,
2052
+ "learning_rate": 3.582154665712473e-07,
2053
+ "loss": 2.485,
2054
+ "step": 2920
2055
+ },
2056
+ {
2057
+ "epoch": 0.8853969932764222,
2058
+ "grad_norm": 20.325515747070312,
2059
+ "learning_rate": 3.402440775571364e-07,
2060
+ "loss": 4.06,
2061
+ "step": 2930
2062
+ },
2063
+ {
2064
+ "epoch": 0.88841882601798,
2065
+ "grad_norm": 24.280147552490234,
2066
+ "learning_rate": 3.227192898724252e-07,
2067
+ "loss": 5.7449,
2068
+ "step": 2940
2069
+ },
2070
+ {
2071
+ "epoch": 0.8914406587595377,
2072
+ "grad_norm": 16.266826629638672,
2073
+ "learning_rate": 3.056427831315878e-07,
2074
+ "loss": 3.3582,
2075
+ "step": 2950
2076
+ },
2077
+ {
2078
+ "epoch": 0.8944624915010955,
2079
+ "grad_norm": 24.630563735961914,
2080
+ "learning_rate": 2.890161939848535e-07,
2081
+ "loss": 4.1681,
2082
+ "step": 2960
2083
+ },
2084
+ {
2085
+ "epoch": 0.8974843242426531,
2086
+ "grad_norm": 17.58610725402832,
2087
+ "learning_rate": 2.72841115961357e-07,
2088
+ "loss": 4.2704,
2089
+ "step": 2970
2090
+ },
2091
+ {
2092
+ "epoch": 0.9005061569842109,
2093
+ "grad_norm": 19.43164825439453,
2094
+ "learning_rate": 2.5711909931640633e-07,
2095
+ "loss": 4.0315,
2096
+ "step": 2980
2097
+ },
2098
+ {
2099
+ "epoch": 0.9035279897257686,
2100
+ "grad_norm": 20.064899444580078,
2101
+ "learning_rate": 2.418516508829e-07,
2102
+ "loss": 2.5202,
2103
+ "step": 2990
2104
+ },
2105
+ {
2106
+ "epoch": 0.9065498224673264,
2107
+ "grad_norm": 31.959165573120117,
2108
+ "learning_rate": 2.270402339269162e-07,
2109
+ "loss": 5.6536,
2110
+ "step": 3000
2111
+ }
2112
+ ],
2113
+ "logging_steps": 10,
2114
+ "max_steps": 3309,
2115
+ "num_input_tokens_seen": 0,
2116
+ "num_train_epochs": 1,
2117
+ "save_steps": 1000,
2118
+ "stateful_callbacks": {
2119
+ "TrainerControl": {
2120
+ "args": {
2121
+ "should_epoch_stop": false,
2122
+ "should_evaluate": false,
2123
+ "should_log": false,
2124
+ "should_save": true,
2125
+ "should_training_stop": false
2126
+ },
2127
+ "attributes": {}
2128
+ }
2129
+ },
2130
+ "total_flos": 1.0651141456648995e+19,
2131
+ "train_batch_size": 1,
2132
+ "trial_name": null,
2133
+ "trial_params": null
2134
+ }
checkpoints/E118/checkpoint-3000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d47c326ae209c5cfdf45f2fbefa74578242ebc5f1af8b4ec289f620cf6f14086
3
+ size 7697
checkpoints/E118/checkpoint-3000/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoints/E118/checkpoint-3000/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)