MrezaPRZ commited on
Commit
7008955
·
verified ·
1 Parent(s): bf85a9e

Upload folder using huggingface_hub

Browse files
Files changed (37) hide show
  1. .gitattributes +1 -0
  2. config.json +30 -0
  3. generation_config.json +9 -0
  4. global_step200/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
  5. global_step200/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
  6. global_step200/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
  7. global_step200/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
  8. global_step200/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
  9. global_step200/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
  10. global_step200/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
  11. global_step200/zero_pp_rank_0_mp_rank_00_model_states.pt +3 -0
  12. global_step200/zero_pp_rank_1_mp_rank_00_model_states.pt +3 -0
  13. global_step200/zero_pp_rank_2_mp_rank_00_model_states.pt +3 -0
  14. global_step200/zero_pp_rank_3_mp_rank_00_model_states.pt +3 -0
  15. global_step200/zero_pp_rank_4_mp_rank_00_model_states.pt +3 -0
  16. global_step200/zero_pp_rank_5_mp_rank_00_model_states.pt +3 -0
  17. global_step200/zero_pp_rank_6_mp_rank_00_model_states.pt +3 -0
  18. latest +1 -0
  19. model-00001-of-00004.safetensors +3 -0
  20. model-00002-of-00004.safetensors +3 -0
  21. model-00003-of-00004.safetensors +3 -0
  22. model-00004-of-00004.safetensors +3 -0
  23. model.safetensors.index.json +346 -0
  24. rng_state_0.pth +3 -0
  25. rng_state_1.pth +3 -0
  26. rng_state_2.pth +3 -0
  27. rng_state_3.pth +3 -0
  28. rng_state_4.pth +3 -0
  29. rng_state_5.pth +3 -0
  30. rng_state_6.pth +3 -0
  31. scheduler.pt +3 -0
  32. special_tokens_map.json +17 -0
  33. tokenizer.json +3 -0
  34. tokenizer_config.json +195 -0
  35. trainer_state.json +1884 -0
  36. training_args.bin +3 -0
  37. zero_to_fp32.py +760 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151643,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 3584,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 18944,
12
+ "max_position_embeddings": 131072,
13
+ "max_window_layers": 28,
14
+ "model_type": "qwen2",
15
+ "num_attention_heads": 28,
16
+ "num_hidden_layers": 28,
17
+ "num_key_value_heads": 4,
18
+ "pad_token_id": 151643,
19
+ "rms_norm_eps": 1e-06,
20
+ "rope_scaling": null,
21
+ "rope_theta": 10000,
22
+ "sliding_window": 4096,
23
+ "tie_word_embeddings": false,
24
+ "torch_dtype": "bfloat16",
25
+ "transformers_version": "4.51.3",
26
+ "use_cache": false,
27
+ "use_mrope": false,
28
+ "use_sliding_window": false,
29
+ "vocab_size": 152064
30
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 151646,
4
+ "do_sample": true,
5
+ "eos_token_id": 151643,
6
+ "temperature": 0.6,
7
+ "top_p": 0.95,
8
+ "transformers_version": "4.51.3"
9
+ }
global_step200/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:e705a77361515e23585f27d3ae112ce14bf193e9ed264332589a0b57eec5f60b
3
+ size 6561679919
global_step200/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:5f159204f7183d741665310c19259bd0186d8416b988da84a365b9eec6262d97
3
+ size 6561679919
global_step200/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:162dbf7d1c1ed4cd63bd158925c47fddc5b0e69b14bd2bf9f80e9a442125ec95
3
+ size 6561679919
global_step200/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:3ecf623b0c50c7640c8b553f2a687d35f6b3c6be2ee09bfe2c6227fdfd801f74
3
+ size 6561679919
global_step200/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:aa0638238ea11aa1532350c59ad1db8802a88f917ad56aa179f123bcc34720ed
3
+ size 6561679919
global_step200/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:8084ca83139587c43a8a9735de5757a0aa02ea447e59de639d5db35e2eb246dd
3
+ size 6561679919
global_step200/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:d0f9daef728bb5eca9a8b159c3e703e91bd9009c66be2709d141428d9e758e94
3
+ size 6561679919
global_step200/zero_pp_rank_0_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21599b6b7ed65ff941b3e2391454e03bcd88dd73b4c48523cd62255c26665676
3
+ size 166293
global_step200/zero_pp_rank_1_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1904cf3f33a94ffc80817d06eb82f3eb686fcd88ea6a5d78ea4378586c37ae2b
3
+ size 166293
global_step200/zero_pp_rank_2_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e777c8c2b2209c43817fa8cd00225401d93b7703fef775192d59185dcc71ca1
3
+ size 166293
global_step200/zero_pp_rank_3_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:537ff0dc21448190d234efd20f78d500c1fbbbad486777ddab2fa213ae0b6d14
3
+ size 166293
global_step200/zero_pp_rank_4_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71407f9659a431ead44af98e66c8f3d13cdecf0e4cc993f9086bda1fbef75704
3
+ size 166293
global_step200/zero_pp_rank_5_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3b903b0b3c0bd8142d221e865e92ea8ffe3b69c91482a7dd320945e37e1f562
3
+ size 166293
global_step200/zero_pp_rank_6_mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05c66ea18391f34b8fd123afe7d2a2efe3f52c3f49e3478836a45af55b9b293d
3
+ size 166293
latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step200
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ce16bb05e9a5490d233a4e9cdbcba8ca48fec5041a298b28dfc3f77247798b5
3
+ size 4877660776
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85e3e5f1070d21dd7b8216077428f3c512447b943802aaba032c18a08be59d3c
3
+ size 4932751008
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4442a44489038681fbd631dea775a1d8ff0a2e2acf3b2c73755ced78e2334a5
3
+ size 4330865200
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3997e3d28a83055b61867f765b53321f3cf641c37c0ca2b0a58f540edb270bbf
3
+ size 1089994880
model.safetensors.index.json ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 15231233024
4
+ },
5
+ "weight_map": {
6
+ "lm_head.weight": "model-00004-of-00004.safetensors",
7
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
8
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
9
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
10
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
11
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
12
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
13
+ "model.layers.0.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
14
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
15
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
16
+ "model.layers.0.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
17
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
18
+ "model.layers.0.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
19
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
20
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
21
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
22
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
23
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
24
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
25
+ "model.layers.1.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
26
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
27
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
28
+ "model.layers.1.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
29
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
30
+ "model.layers.1.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
31
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
32
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
33
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
34
+ "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
35
+ "model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
36
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
37
+ "model.layers.10.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
38
+ "model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
39
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
40
+ "model.layers.10.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
41
+ "model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
42
+ "model.layers.10.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
43
+ "model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
44
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
45
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
46
+ "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
47
+ "model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
48
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
49
+ "model.layers.11.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
50
+ "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
51
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
52
+ "model.layers.11.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
53
+ "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
54
+ "model.layers.11.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
55
+ "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
56
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
57
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
58
+ "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
59
+ "model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
60
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
61
+ "model.layers.12.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
62
+ "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
63
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
64
+ "model.layers.12.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
65
+ "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
66
+ "model.layers.12.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
67
+ "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
68
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
69
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
70
+ "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
71
+ "model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
72
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
73
+ "model.layers.13.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
74
+ "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
75
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
76
+ "model.layers.13.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
77
+ "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
78
+ "model.layers.13.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
79
+ "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
80
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
81
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.14.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
86
+ "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
87
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
88
+ "model.layers.14.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
89
+ "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
90
+ "model.layers.14.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
91
+ "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.15.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
98
+ "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.15.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
101
+ "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.15.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
103
+ "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
104
+ "model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
105
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
106
+ "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
107
+ "model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
108
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
109
+ "model.layers.16.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
110
+ "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
111
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
112
+ "model.layers.16.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
113
+ "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
114
+ "model.layers.16.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
115
+ "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
117
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
118
+ "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
119
+ "model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
120
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
121
+ "model.layers.17.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
122
+ "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
123
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
124
+ "model.layers.17.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
125
+ "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
126
+ "model.layers.17.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
127
+ "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
128
+ "model.layers.18.input_layernorm.weight": "model-00003-of-00004.safetensors",
129
+ "model.layers.18.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
130
+ "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
131
+ "model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
132
+ "model.layers.18.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
133
+ "model.layers.18.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
134
+ "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
135
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
136
+ "model.layers.18.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
137
+ "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
138
+ "model.layers.18.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
139
+ "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
140
+ "model.layers.19.input_layernorm.weight": "model-00003-of-00004.safetensors",
141
+ "model.layers.19.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
142
+ "model.layers.19.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
143
+ "model.layers.19.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
144
+ "model.layers.19.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
145
+ "model.layers.19.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
146
+ "model.layers.19.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
147
+ "model.layers.19.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
148
+ "model.layers.19.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
149
+ "model.layers.19.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
150
+ "model.layers.19.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
151
+ "model.layers.19.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
152
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
153
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
154
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
155
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
156
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
157
+ "model.layers.2.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
158
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
159
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
160
+ "model.layers.2.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
161
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
162
+ "model.layers.2.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
163
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
164
+ "model.layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
165
+ "model.layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
166
+ "model.layers.20.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
167
+ "model.layers.20.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
168
+ "model.layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
169
+ "model.layers.20.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
170
+ "model.layers.20.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
171
+ "model.layers.20.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
172
+ "model.layers.20.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
173
+ "model.layers.20.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
174
+ "model.layers.20.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
175
+ "model.layers.20.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
176
+ "model.layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
177
+ "model.layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
178
+ "model.layers.21.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
179
+ "model.layers.21.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
180
+ "model.layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
181
+ "model.layers.21.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
182
+ "model.layers.21.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
183
+ "model.layers.21.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
184
+ "model.layers.21.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
185
+ "model.layers.21.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
186
+ "model.layers.21.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
187
+ "model.layers.21.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
188
+ "model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
189
+ "model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
190
+ "model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
191
+ "model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
192
+ "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
193
+ "model.layers.22.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
194
+ "model.layers.22.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
195
+ "model.layers.22.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
196
+ "model.layers.22.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
197
+ "model.layers.22.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
198
+ "model.layers.22.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
199
+ "model.layers.22.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
200
+ "model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
201
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
202
+ "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
203
+ "model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
204
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
205
+ "model.layers.23.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
206
+ "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
207
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
208
+ "model.layers.23.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
209
+ "model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
210
+ "model.layers.23.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
211
+ "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
212
+ "model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
213
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
214
+ "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
215
+ "model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
216
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
217
+ "model.layers.24.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
218
+ "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
219
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
220
+ "model.layers.24.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
221
+ "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
222
+ "model.layers.24.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
223
+ "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
224
+ "model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
225
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
226
+ "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
227
+ "model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
228
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
229
+ "model.layers.25.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
230
+ "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
231
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
232
+ "model.layers.25.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
233
+ "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
234
+ "model.layers.25.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
235
+ "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
236
+ "model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
237
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
238
+ "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
239
+ "model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
240
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
241
+ "model.layers.26.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
242
+ "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
243
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
244
+ "model.layers.26.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
245
+ "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
246
+ "model.layers.26.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
247
+ "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
248
+ "model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
249
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
250
+ "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
251
+ "model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
252
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
253
+ "model.layers.27.self_attn.k_proj.bias": "model-00003-of-00004.safetensors",
254
+ "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
255
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
256
+ "model.layers.27.self_attn.q_proj.bias": "model-00003-of-00004.safetensors",
257
+ "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
258
+ "model.layers.27.self_attn.v_proj.bias": "model-00003-of-00004.safetensors",
259
+ "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
260
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
261
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
262
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
263
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
264
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
265
+ "model.layers.3.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
266
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
267
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
268
+ "model.layers.3.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
269
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
270
+ "model.layers.3.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
271
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
272
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
273
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
274
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
275
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
276
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
277
+ "model.layers.4.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
278
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
279
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
280
+ "model.layers.4.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
281
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
282
+ "model.layers.4.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
283
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
284
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
285
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
286
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
287
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
288
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
289
+ "model.layers.5.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
290
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
291
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
292
+ "model.layers.5.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
293
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
294
+ "model.layers.5.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
295
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
296
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
297
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
298
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
299
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
300
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
301
+ "model.layers.6.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
302
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
303
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
304
+ "model.layers.6.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
305
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
306
+ "model.layers.6.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
307
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
308
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
309
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
310
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
311
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
312
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
313
+ "model.layers.7.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
314
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
315
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
316
+ "model.layers.7.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
317
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
318
+ "model.layers.7.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
319
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
320
+ "model.layers.8.input_layernorm.weight": "model-00002-of-00004.safetensors",
321
+ "model.layers.8.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
322
+ "model.layers.8.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
323
+ "model.layers.8.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
324
+ "model.layers.8.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
325
+ "model.layers.8.self_attn.k_proj.bias": "model-00001-of-00004.safetensors",
326
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
327
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
328
+ "model.layers.8.self_attn.q_proj.bias": "model-00001-of-00004.safetensors",
329
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
330
+ "model.layers.8.self_attn.v_proj.bias": "model-00001-of-00004.safetensors",
331
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
332
+ "model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
333
+ "model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
334
+ "model.layers.9.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
335
+ "model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
336
+ "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
337
+ "model.layers.9.self_attn.k_proj.bias": "model-00002-of-00004.safetensors",
338
+ "model.layers.9.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
339
+ "model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
340
+ "model.layers.9.self_attn.q_proj.bias": "model-00002-of-00004.safetensors",
341
+ "model.layers.9.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
342
+ "model.layers.9.self_attn.v_proj.bias": "model-00002-of-00004.safetensors",
343
+ "model.layers.9.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
344
+ "model.norm.weight": "model-00003-of-00004.safetensors"
345
+ }
346
+ }
rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ead6257460ba994fe3058845cebf2eee5a1b6be0c8e1337779e45b8667b3570
3
+ size 15728
rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e183b6c3a2800c6c92152050d78c6927e7ed1c675e7c695da31f2e8aa88a733
3
+ size 15728
rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cfdbacbc5baba9cae3bdbc96f18d9293fa06c6ba390799a39013879b3dab405
3
+ size 15728
rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c7d5480afac6576c73ec23a28f05d0257d237e892aab1f7077c2b4423862877
3
+ size 15792
rng_state_4.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a99e2fa8fb168406ff5154bf7c90817688aa7d7ce9b02b20616ec31cd2fd9152
3
+ size 15728
rng_state_5.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b64d639dab12249b8b5c68abcd36e63a544581a4c043410833b24b5de13480c
3
+ size 15728
rng_state_6.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:979e0af18b5cf6a03110d4579474364fa41ffe2746b372ad4f0d3130ff919685
3
+ size 15728
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca9c387002ad973acde429f214002dbdd1b969d41a7575de301ee649510de4ee
3
+ size 1064
special_tokens_map.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin▁of▁sentence|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|end▁of▁sentence|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "<|end▁of▁sentence|>"
17
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4256422650d141f228fe954acee98679da412984c29a569877eefd3af69315a
3
+ size 11422959
tokenizer_config.json ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "151643": {
7
+ "content": "<|end▁of▁sentence|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "151644": {
15
+ "content": "<|User|>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": false
21
+ },
22
+ "151645": {
23
+ "content": "<|Assistant|>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": false
29
+ },
30
+ "151646": {
31
+ "content": "<|begin▁of▁sentence|>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "151647": {
39
+ "content": "<|EOT|>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": false
45
+ },
46
+ "151648": {
47
+ "content": "<think>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": false
53
+ },
54
+ "151649": {
55
+ "content": "</think>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": false
61
+ },
62
+ "151650": {
63
+ "content": "<|quad_start|>",
64
+ "lstrip": false,
65
+ "normalized": false,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": true
69
+ },
70
+ "151651": {
71
+ "content": "<|quad_end|>",
72
+ "lstrip": false,
73
+ "normalized": false,
74
+ "rstrip": false,
75
+ "single_word": false,
76
+ "special": true
77
+ },
78
+ "151652": {
79
+ "content": "<|vision_start|>",
80
+ "lstrip": false,
81
+ "normalized": false,
82
+ "rstrip": false,
83
+ "single_word": false,
84
+ "special": true
85
+ },
86
+ "151653": {
87
+ "content": "<|vision_end|>",
88
+ "lstrip": false,
89
+ "normalized": false,
90
+ "rstrip": false,
91
+ "single_word": false,
92
+ "special": true
93
+ },
94
+ "151654": {
95
+ "content": "<|vision_pad|>",
96
+ "lstrip": false,
97
+ "normalized": false,
98
+ "rstrip": false,
99
+ "single_word": false,
100
+ "special": true
101
+ },
102
+ "151655": {
103
+ "content": "<|image_pad|>",
104
+ "lstrip": false,
105
+ "normalized": false,
106
+ "rstrip": false,
107
+ "single_word": false,
108
+ "special": true
109
+ },
110
+ "151656": {
111
+ "content": "<|video_pad|>",
112
+ "lstrip": false,
113
+ "normalized": false,
114
+ "rstrip": false,
115
+ "single_word": false,
116
+ "special": true
117
+ },
118
+ "151657": {
119
+ "content": "<tool_call>",
120
+ "lstrip": false,
121
+ "normalized": false,
122
+ "rstrip": false,
123
+ "single_word": false,
124
+ "special": false
125
+ },
126
+ "151658": {
127
+ "content": "</tool_call>",
128
+ "lstrip": false,
129
+ "normalized": false,
130
+ "rstrip": false,
131
+ "single_word": false,
132
+ "special": false
133
+ },
134
+ "151659": {
135
+ "content": "<|fim_prefix|>",
136
+ "lstrip": false,
137
+ "normalized": false,
138
+ "rstrip": false,
139
+ "single_word": false,
140
+ "special": false
141
+ },
142
+ "151660": {
143
+ "content": "<|fim_middle|>",
144
+ "lstrip": false,
145
+ "normalized": false,
146
+ "rstrip": false,
147
+ "single_word": false,
148
+ "special": false
149
+ },
150
+ "151661": {
151
+ "content": "<|fim_suffix|>",
152
+ "lstrip": false,
153
+ "normalized": false,
154
+ "rstrip": false,
155
+ "single_word": false,
156
+ "special": false
157
+ },
158
+ "151662": {
159
+ "content": "<|fim_pad|>",
160
+ "lstrip": false,
161
+ "normalized": false,
162
+ "rstrip": false,
163
+ "single_word": false,
164
+ "special": false
165
+ },
166
+ "151663": {
167
+ "content": "<|repo_name|>",
168
+ "lstrip": false,
169
+ "normalized": false,
170
+ "rstrip": false,
171
+ "single_word": false,
172
+ "special": false
173
+ },
174
+ "151664": {
175
+ "content": "<|file_sep|>",
176
+ "lstrip": false,
177
+ "normalized": false,
178
+ "rstrip": false,
179
+ "single_word": false,
180
+ "special": false
181
+ }
182
+ },
183
+ "bos_token": "<|begin▁of▁sentence|>",
184
+ "chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin��>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}",
185
+ "clean_up_tokenization_spaces": false,
186
+ "eos_token": "<|end▁of▁sentence|>",
187
+ "extra_special_tokens": {},
188
+ "legacy": true,
189
+ "model_max_length": 16384,
190
+ "pad_token": "<|end▁of▁sentence|>",
191
+ "sp_model_kwargs": {},
192
+ "tokenizer_class": "LlamaTokenizerFast",
193
+ "unk_token": null,
194
+ "use_default_system_prompt": false
195
+ }
trainer_state.json ADDED
@@ -0,0 +1,1884 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.27938535222510474,
6
+ "eval_steps": 500,
7
+ "global_step": 200,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "clip_ratio": 0.0,
14
+ "completion_length": 6335.173723493303,
15
+ "epoch": 0.0013969267611255239,
16
+ "grad_norm": 0.1530565852782136,
17
+ "learning_rate": 0.0,
18
+ "loss": 0.0119,
19
+ "num_tokens": 1330201.0,
20
+ "reward": 0.3924093656241894,
21
+ "reward_std": 0.32559600685323986,
22
+ "rewards/reward_func": 0.3924093528517655,
23
+ "step": 1
24
+ },
25
+ {
26
+ "clip_ratio": 0.0,
27
+ "epoch": 0.0027938535222510478,
28
+ "grad_norm": 0.15303408357738274,
29
+ "learning_rate": 1.3888888888888887e-08,
30
+ "loss": 0.0119,
31
+ "step": 2
32
+ },
33
+ {
34
+ "clip_ratio": 0.010408175710056509,
35
+ "epoch": 0.004190780283376571,
36
+ "grad_norm": 0.1764633199425111,
37
+ "learning_rate": 2.7777777777777774e-08,
38
+ "loss": 0.0125,
39
+ "step": 3
40
+ },
41
+ {
42
+ "clip_ratio": 0.010680466823812042,
43
+ "epoch": 0.0055877070445020955,
44
+ "grad_norm": 0.2275277428050235,
45
+ "learning_rate": 4.166666666666666e-08,
46
+ "loss": 0.0126,
47
+ "step": 4
48
+ },
49
+ {
50
+ "clip_ratio": 0.0,
51
+ "completion_length": 5737.668526785715,
52
+ "epoch": 0.006984633805627619,
53
+ "grad_norm": 0.19107039038527468,
54
+ "learning_rate": 5.555555555555555e-08,
55
+ "loss": 0.0293,
56
+ "num_tokens": 2545372.0,
57
+ "reward": 0.4294457712343761,
58
+ "reward_std": 0.37008823986564365,
59
+ "rewards/reward_func": 0.4294457531401089,
60
+ "step": 5
61
+ },
62
+ {
63
+ "clip_ratio": 0.010828850524766105,
64
+ "epoch": 0.008381560566753142,
65
+ "grad_norm": 0.2240354781456917,
66
+ "learning_rate": 6.944444444444444e-08,
67
+ "loss": 0.0301,
68
+ "step": 6
69
+ },
70
+ {
71
+ "clip_ratio": 0.010841753533376115,
72
+ "epoch": 0.009778487327878668,
73
+ "grad_norm": 0.2767916742737982,
74
+ "learning_rate": 8.333333333333333e-08,
75
+ "loss": 0.0301,
76
+ "step": 7
77
+ },
78
+ {
79
+ "clip_ratio": 0.010758176312914916,
80
+ "epoch": 0.011175414089004191,
81
+ "grad_norm": 0.2668705057271519,
82
+ "learning_rate": 9.722222222222222e-08,
83
+ "loss": 0.0301,
84
+ "step": 8
85
+ },
86
+ {
87
+ "clip_ratio": 0.0,
88
+ "completion_length": 6511.857439313616,
89
+ "epoch": 0.012572340850129714,
90
+ "grad_norm": 0.19266419886931196,
91
+ "learning_rate": 1.111111111111111e-07,
92
+ "loss": 0.0051,
93
+ "num_tokens": 3911895.0,
94
+ "reward": 0.32038674876093864,
95
+ "reward_std": 0.3298808889729636,
96
+ "rewards/reward_func": 0.32038673226322445,
97
+ "step": 9
98
+ },
99
+ {
100
+ "clip_ratio": 0.012134518141725234,
101
+ "epoch": 0.013969267611255238,
102
+ "grad_norm": 0.21591989333017872,
103
+ "learning_rate": 1.25e-07,
104
+ "loss": 0.0058,
105
+ "step": 10
106
+ },
107
+ {
108
+ "clip_ratio": 0.012228245115173715,
109
+ "epoch": 0.015366194372380763,
110
+ "grad_norm": 0.20676433229073893,
111
+ "learning_rate": 1.3888888888888888e-07,
112
+ "loss": 0.0058,
113
+ "step": 11
114
+ },
115
+ {
116
+ "clip_ratio": 0.012062976469418831,
117
+ "epoch": 0.016763121133506285,
118
+ "grad_norm": 0.2100849809088676,
119
+ "learning_rate": 1.527777777777778e-07,
120
+ "loss": 0.0058,
121
+ "step": 12
122
+ },
123
+ {
124
+ "clip_ratio": 0.0,
125
+ "completion_length": 5776.398141043527,
126
+ "epoch": 0.01816004789463181,
127
+ "grad_norm": 0.21639349074679098,
128
+ "learning_rate": 1.6666666666666665e-07,
129
+ "loss": 0.0233,
130
+ "num_tokens": 5132268.0,
131
+ "reward": 0.4814984883580889,
132
+ "reward_std": 0.3754643425345421,
133
+ "rewards/reward_func": 0.48149845749139786,
134
+ "step": 13
135
+ },
136
+ {
137
+ "clip_ratio": 0.010207080947501319,
138
+ "epoch": 0.019556974655757335,
139
+ "grad_norm": 0.22611722201173162,
140
+ "learning_rate": 1.8055555555555554e-07,
141
+ "loss": 0.0241,
142
+ "step": 14
143
+ },
144
+ {
145
+ "clip_ratio": 0.010003214618856353,
146
+ "epoch": 0.02095390141688286,
147
+ "grad_norm": 0.21387408972131952,
148
+ "learning_rate": 1.9444444444444445e-07,
149
+ "loss": 0.024,
150
+ "step": 15
151
+ },
152
+ {
153
+ "clip_ratio": 0.010145484004169703,
154
+ "epoch": 0.022350828178008382,
155
+ "grad_norm": 0.2965931721160837,
156
+ "learning_rate": 2.0833333333333333e-07,
157
+ "loss": 0.024,
158
+ "step": 16
159
+ },
160
+ {
161
+ "clip_ratio": 0.0,
162
+ "completion_length": 6396.923740931919,
163
+ "epoch": 0.023747754939133905,
164
+ "grad_norm": 0.17812701051388663,
165
+ "learning_rate": 2.222222222222222e-07,
166
+ "loss": 0.0143,
167
+ "num_tokens": 6474962.0,
168
+ "reward": 0.4179248466555561,
169
+ "reward_std": 0.3605238295027188,
170
+ "rewards/reward_func": 0.41792482949261156,
171
+ "step": 17
172
+ },
173
+ {
174
+ "clip_ratio": 0.010267588176897593,
175
+ "epoch": 0.02514468170025943,
176
+ "grad_norm": 0.18587492539762027,
177
+ "learning_rate": 2.361111111111111e-07,
178
+ "loss": 0.015,
179
+ "step": 18
180
+ },
181
+ {
182
+ "clip_ratio": 0.010148471055020179,
183
+ "epoch": 0.026541608461384952,
184
+ "grad_norm": 0.1810944495339226,
185
+ "learning_rate": 2.5e-07,
186
+ "loss": 0.0149,
187
+ "step": 19
188
+ },
189
+ {
190
+ "clip_ratio": 0.01020466532957341,
191
+ "epoch": 0.027938535222510476,
192
+ "grad_norm": 0.1924193708866086,
193
+ "learning_rate": 2.638888888888889e-07,
194
+ "loss": 0.015,
195
+ "step": 20
196
+ },
197
+ {
198
+ "clip_ratio": 0.0,
199
+ "completion_length": 5085.755362374442,
200
+ "epoch": 0.029335461983636,
201
+ "grad_norm": 0.3165497451368565,
202
+ "learning_rate": 2.7777777777777776e-07,
203
+ "loss": 0.0104,
204
+ "num_tokens": 7560523.0,
205
+ "reward": 0.464439152606896,
206
+ "reward_std": 0.3689843277846064,
207
+ "rewards/reward_func": 0.46443913131952286,
208
+ "step": 21
209
+ },
210
+ {
211
+ "clip_ratio": 0.010546388570219278,
212
+ "epoch": 0.030732388744761526,
213
+ "grad_norm": 0.3395774959095009,
214
+ "learning_rate": 2.916666666666667e-07,
215
+ "loss": 0.0113,
216
+ "step": 22
217
+ },
218
+ {
219
+ "clip_ratio": 0.010336563357019,
220
+ "epoch": 0.032129315505887046,
221
+ "grad_norm": 0.31582946500885495,
222
+ "learning_rate": 3.055555555555556e-07,
223
+ "loss": 0.0112,
224
+ "step": 23
225
+ },
226
+ {
227
+ "clip_ratio": 0.010099471979109305,
228
+ "epoch": 0.03352624226701257,
229
+ "grad_norm": 0.36247326697578075,
230
+ "learning_rate": 3.194444444444444e-07,
231
+ "loss": 0.0112,
232
+ "step": 24
233
+ },
234
+ {
235
+ "clip_ratio": 0.0,
236
+ "completion_length": 6461.342215401785,
237
+ "epoch": 0.03492316902813809,
238
+ "grad_norm": 0.15567466235487185,
239
+ "learning_rate": 3.333333333333333e-07,
240
+ "loss": 0.0193,
241
+ "num_tokens": 8914764.0,
242
+ "reward": 0.38339252876383917,
243
+ "reward_std": 0.3311073939715113,
244
+ "rewards/reward_func": 0.3833925181201526,
245
+ "step": 25
246
+ },
247
+ {
248
+ "clip_ratio": 0.009515652732391442,
249
+ "epoch": 0.03632009578926362,
250
+ "grad_norm": 0.25805173133838866,
251
+ "learning_rate": 3.472222222222222e-07,
252
+ "loss": 0.0199,
253
+ "step": 26
254
+ },
255
+ {
256
+ "clip_ratio": 0.009263422406677688,
257
+ "epoch": 0.03771702255038915,
258
+ "grad_norm": 0.4090162080972072,
259
+ "learning_rate": 3.6111111111111107e-07,
260
+ "loss": 0.0199,
261
+ "step": 27
262
+ },
263
+ {
264
+ "clip_ratio": 0.009094293162758862,
265
+ "epoch": 0.03911394931151467,
266
+ "grad_norm": 0.14691760483745145,
267
+ "learning_rate": 3.75e-07,
268
+ "loss": 0.0198,
269
+ "step": 28
270
+ },
271
+ {
272
+ "clip_ratio": 0.0,
273
+ "completion_length": 5968.250279017857,
274
+ "epoch": 0.040510876072640194,
275
+ "grad_norm": 0.16406943154337036,
276
+ "learning_rate": 3.888888888888889e-07,
277
+ "loss": 0.0115,
278
+ "num_tokens": 10173741.0,
279
+ "reward": 0.3594382884246962,
280
+ "reward_std": 0.32283720054796766,
281
+ "rewards/reward_func": 0.35943826926606043,
282
+ "step": 29
283
+ },
284
+ {
285
+ "clip_ratio": 0.01090411888435483,
286
+ "epoch": 0.04190780283376572,
287
+ "grad_norm": 0.21927196182565817,
288
+ "learning_rate": 4.027777777777778e-07,
289
+ "loss": 0.0124,
290
+ "step": 30
291
+ },
292
+ {
293
+ "clip_ratio": 0.010733458446338773,
294
+ "epoch": 0.04330472959489124,
295
+ "grad_norm": 0.3447213393816689,
296
+ "learning_rate": 4.1666666666666667e-07,
297
+ "loss": 0.0121,
298
+ "step": 31
299
+ },
300
+ {
301
+ "clip_ratio": 0.010630057725523199,
302
+ "epoch": 0.044701656356016764,
303
+ "grad_norm": 0.3620568701207513,
304
+ "learning_rate": 4.3055555555555555e-07,
305
+ "loss": 0.0121,
306
+ "step": 32
307
+ },
308
+ {
309
+ "clip_ratio": 0.0,
310
+ "completion_length": 5812.648210797991,
311
+ "epoch": 0.04609858311714229,
312
+ "grad_norm": 0.16987419224516487,
313
+ "learning_rate": 4.444444444444444e-07,
314
+ "loss": 0.0179,
315
+ "num_tokens": 11403427.0,
316
+ "reward": 0.3713971259338515,
317
+ "reward_std": 0.3195132836699486,
318
+ "rewards/reward_func": 0.3713971110326903,
319
+ "step": 33
320
+ },
321
+ {
322
+ "clip_ratio": 0.010423385953929807,
323
+ "epoch": 0.04749550987826781,
324
+ "grad_norm": 0.16329217057193554,
325
+ "learning_rate": 4.5833333333333327e-07,
326
+ "loss": 0.0185,
327
+ "step": 34
328
+ },
329
+ {
330
+ "clip_ratio": 0.010347368278806763,
331
+ "epoch": 0.048892436639393334,
332
+ "grad_norm": 0.15422959333602954,
333
+ "learning_rate": 4.722222222222222e-07,
334
+ "loss": 0.0185,
335
+ "step": 35
336
+ },
337
+ {
338
+ "clip_ratio": 0.010140369646251202,
339
+ "epoch": 0.05028936340051886,
340
+ "grad_norm": 0.14689712083262277,
341
+ "learning_rate": 4.861111111111111e-07,
342
+ "loss": 0.0184,
343
+ "step": 36
344
+ },
345
+ {
346
+ "clip_ratio": 0.0,
347
+ "completion_length": 5546.617606026785,
348
+ "epoch": 0.05168629016164438,
349
+ "grad_norm": 0.23439115342799705,
350
+ "learning_rate": 5e-07,
351
+ "loss": 0.0161,
352
+ "num_tokens": 12578819.0,
353
+ "reward": 0.4297656629766737,
354
+ "reward_std": 0.357943703021322,
355
+ "rewards/reward_func": 0.42976564009274754,
356
+ "step": 37
357
+ },
358
+ {
359
+ "clip_ratio": 0.010506943932601384,
360
+ "epoch": 0.053083216922769905,
361
+ "grad_norm": 0.28362735010406454,
362
+ "learning_rate": 5.138888888888889e-07,
363
+ "loss": 0.0168,
364
+ "step": 38
365
+ },
366
+ {
367
+ "clip_ratio": 0.010338681018246072,
368
+ "epoch": 0.05448014368389543,
369
+ "grad_norm": 0.22707404637725537,
370
+ "learning_rate": 5.277777777777777e-07,
371
+ "loss": 0.0167,
372
+ "step": 39
373
+ },
374
+ {
375
+ "clip_ratio": 0.010024449788033962,
376
+ "epoch": 0.05587707044502095,
377
+ "grad_norm": 0.17811231341381648,
378
+ "learning_rate": 5.416666666666666e-07,
379
+ "loss": 0.0165,
380
+ "step": 40
381
+ },
382
+ {
383
+ "clip_ratio": 0.0,
384
+ "completion_length": 6501.444231305803,
385
+ "epoch": 0.057273997206146475,
386
+ "grad_norm": 0.19673275542337104,
387
+ "learning_rate": 5.555555555555555e-07,
388
+ "loss": 0.0203,
389
+ "num_tokens": 13942392.0,
390
+ "reward": 0.39034509126629147,
391
+ "reward_std": 0.3664030634931156,
392
+ "rewards/reward_func": 0.3903450625283377,
393
+ "step": 41
394
+ },
395
+ {
396
+ "clip_ratio": 0.010402361529746227,
397
+ "epoch": 0.058670923967272,
398
+ "grad_norm": 0.46687244963414065,
399
+ "learning_rate": 5.694444444444444e-07,
400
+ "loss": 0.0211,
401
+ "step": 42
402
+ },
403
+ {
404
+ "clip_ratio": 0.010496154893189669,
405
+ "epoch": 0.06006785072839753,
406
+ "grad_norm": 0.19428194405187207,
407
+ "learning_rate": 5.833333333333334e-07,
408
+ "loss": 0.0209,
409
+ "step": 43
410
+ },
411
+ {
412
+ "clip_ratio": 0.010158670766811286,
413
+ "epoch": 0.06146477748952305,
414
+ "grad_norm": 0.15306555166745645,
415
+ "learning_rate": 5.972222222222222e-07,
416
+ "loss": 0.0208,
417
+ "step": 44
418
+ },
419
+ {
420
+ "clip_ratio": 0.0,
421
+ "completion_length": 6369.643048967634,
422
+ "epoch": 0.06286170425064858,
423
+ "grad_norm": 0.1871015916141642,
424
+ "learning_rate": 6.111111111111112e-07,
425
+ "loss": 0.0161,
426
+ "num_tokens": 15279078.0,
427
+ "reward": 0.36025070399045944,
428
+ "reward_std": 0.35143060450042996,
429
+ "rewards/reward_func": 0.360250677381243,
430
+ "step": 45
431
+ },
432
+ {
433
+ "clip_ratio": 0.01079715442444597,
434
+ "epoch": 0.06425863101177409,
435
+ "grad_norm": 0.6294866160536174,
436
+ "learning_rate": 6.249999999999999e-07,
437
+ "loss": 0.0169,
438
+ "step": 46
439
+ },
440
+ {
441
+ "clip_ratio": 0.010736021545848675,
442
+ "epoch": 0.06565555777289962,
443
+ "grad_norm": 2.137657977104326,
444
+ "learning_rate": 6.388888888888888e-07,
445
+ "loss": 0.0171,
446
+ "step": 47
447
+ },
448
+ {
449
+ "clip_ratio": 0.010864090407267213,
450
+ "epoch": 0.06705248453402514,
451
+ "grad_norm": 0.18428434234054034,
452
+ "learning_rate": 6.527777777777777e-07,
453
+ "loss": 0.0166,
454
+ "step": 48
455
+ },
456
+ {
457
+ "clip_ratio": 0.0,
458
+ "completion_length": 6655.908412388393,
459
+ "epoch": 0.06844941129515067,
460
+ "grad_norm": 0.16953542603782387,
461
+ "learning_rate": 6.666666666666666e-07,
462
+ "loss": 0.0148,
463
+ "num_tokens": 16672949.0,
464
+ "reward": 0.35046685327376637,
465
+ "reward_std": 0.30536604832325664,
466
+ "rewards/reward_func": 0.3504668373082365,
467
+ "step": 49
468
+ },
469
+ {
470
+ "clip_ratio": 0.010905002310339893,
471
+ "epoch": 0.06984633805627619,
472
+ "grad_norm": 1.9607105946099048,
473
+ "learning_rate": 6.805555555555556e-07,
474
+ "loss": 0.0153,
475
+ "step": 50
476
+ },
477
+ {
478
+ "clip_ratio": 0.011137549964977162,
479
+ "epoch": 0.07124326481740172,
480
+ "grad_norm": 0.16619610980435887,
481
+ "learning_rate": 6.944444444444444e-07,
482
+ "loss": 0.0153,
483
+ "step": 51
484
+ },
485
+ {
486
+ "clip_ratio": 0.011474365035870246,
487
+ "epoch": 0.07264019157852725,
488
+ "grad_norm": 0.13731779782413311,
489
+ "learning_rate": 7.083333333333334e-07,
490
+ "loss": 0.0151,
491
+ "step": 52
492
+ },
493
+ {
494
+ "clip_ratio": 0.0,
495
+ "completion_length": 6259.326799665178,
496
+ "epoch": 0.07403711833965276,
497
+ "grad_norm": 0.18005417578145988,
498
+ "learning_rate": 7.222222222222221e-07,
499
+ "loss": 0.0124,
500
+ "num_tokens": 17987081.0,
501
+ "reward": 0.3450017161667347,
502
+ "reward_std": 0.3385175902928625,
503
+ "rewards/reward_func": 0.34500169487936155,
504
+ "step": 53
505
+ },
506
+ {
507
+ "clip_ratio": 0.012061000069869416,
508
+ "epoch": 0.0754340451007783,
509
+ "grad_norm": 0.3653574862365132,
510
+ "learning_rate": 7.361111111111111e-07,
511
+ "loss": 0.0132,
512
+ "step": 54
513
+ },
514
+ {
515
+ "clip_ratio": 0.01210923127031752,
516
+ "epoch": 0.07683097186190381,
517
+ "grad_norm": 0.1572526876806962,
518
+ "learning_rate": 7.5e-07,
519
+ "loss": 0.013,
520
+ "step": 55
521
+ },
522
+ {
523
+ "clip_ratio": 0.012545851857534476,
524
+ "epoch": 0.07822789862302934,
525
+ "grad_norm": 0.1348151811096135,
526
+ "learning_rate": 7.638888888888888e-07,
527
+ "loss": 0.0128,
528
+ "step": 56
529
+ },
530
+ {
531
+ "clip_ratio": 0.0,
532
+ "completion_length": 6945.081944056919,
533
+ "epoch": 0.07962482538415486,
534
+ "grad_norm": 0.1355243529384343,
535
+ "learning_rate": 7.777777777777778e-07,
536
+ "loss": 0.0203,
537
+ "num_tokens": 19437527.0,
538
+ "reward": 0.2853341962077788,
539
+ "reward_std": 0.28026825402464184,
540
+ "rewards/reward_func": 0.28533417971006464,
541
+ "step": 57
542
+ },
543
+ {
544
+ "clip_ratio": 0.010294904433456915,
545
+ "epoch": 0.08102175214528039,
546
+ "grad_norm": 1.4215854683138216,
547
+ "learning_rate": 7.916666666666666e-07,
548
+ "loss": 0.0211,
549
+ "step": 58
550
+ },
551
+ {
552
+ "clip_ratio": 0.010296880932790893,
553
+ "epoch": 0.0824186789064059,
554
+ "grad_norm": 0.1328390444888187,
555
+ "learning_rate": 8.055555555555556e-07,
556
+ "loss": 0.0208,
557
+ "step": 59
558
+ },
559
+ {
560
+ "clip_ratio": 0.010402131692639418,
561
+ "epoch": 0.08381560566753143,
562
+ "grad_norm": 0.10630427559017747,
563
+ "learning_rate": 8.194444444444443e-07,
564
+ "loss": 0.0207,
565
+ "step": 60
566
+ },
567
+ {
568
+ "clip_ratio": 0.0,
569
+ "completion_length": 5832.984967912947,
570
+ "epoch": 0.08521253242865695,
571
+ "grad_norm": 0.2568979639198368,
572
+ "learning_rate": 8.333333333333333e-07,
573
+ "loss": 0.0135,
574
+ "num_tokens": 20669861.0,
575
+ "reward": 0.37696379157049315,
576
+ "reward_std": 0.3524509519338608,
577
+ "rewards/reward_func": 0.37696376868656706,
578
+ "step": 61
579
+ },
580
+ {
581
+ "clip_ratio": 0.011475847900978156,
582
+ "epoch": 0.08660945918978248,
583
+ "grad_norm": 0.26568198717380825,
584
+ "learning_rate": 8.472222222222222e-07,
585
+ "loss": 0.0142,
586
+ "step": 62
587
+ },
588
+ {
589
+ "clip_ratio": 0.011013164584125792,
590
+ "epoch": 0.088006385950908,
591
+ "grad_norm": 0.5160311893436309,
592
+ "learning_rate": 8.611111111111111e-07,
593
+ "loss": 0.014,
594
+ "step": 63
595
+ },
596
+ {
597
+ "clip_ratio": 0.010899153238694583,
598
+ "epoch": 0.08940331271203353,
599
+ "grad_norm": 0.16319985648001487,
600
+ "learning_rate": 8.75e-07,
601
+ "loss": 0.0138,
602
+ "step": 64
603
+ },
604
+ {
605
+ "clip_ratio": 0.0,
606
+ "completion_length": 5130.444091796875,
607
+ "epoch": 0.09080023947315904,
608
+ "grad_norm": 0.28767641683692746,
609
+ "learning_rate": 8.888888888888888e-07,
610
+ "loss": 0.0025,
611
+ "num_tokens": 21764127.0,
612
+ "reward": 0.46981193338121685,
613
+ "reward_std": 0.3410501836666039,
614
+ "rewards/reward_func": 0.4698119152869497,
615
+ "step": 65
616
+ },
617
+ {
618
+ "clip_ratio": 0.011167634411581926,
619
+ "epoch": 0.09219716623428457,
620
+ "grad_norm": 1786685.0973493713,
621
+ "learning_rate": 9.027777777777778e-07,
622
+ "loss": 31.3025,
623
+ "step": 66
624
+ },
625
+ {
626
+ "clip_ratio": 0.011178254083331143,
627
+ "epoch": 0.09359409299541009,
628
+ "grad_norm": 0.2699319084211939,
629
+ "learning_rate": 9.166666666666665e-07,
630
+ "loss": 0.0029,
631
+ "step": 67
632
+ },
633
+ {
634
+ "clip_ratio": 0.010996093108717884,
635
+ "epoch": 0.09499101975653562,
636
+ "grad_norm": 0.1796173018225043,
637
+ "learning_rate": 9.305555555555555e-07,
638
+ "loss": 0.0026,
639
+ "step": 68
640
+ },
641
+ {
642
+ "clip_ratio": 0.0,
643
+ "completion_length": 5374.097150530134,
644
+ "epoch": 0.09638794651766115,
645
+ "grad_norm": 0.29248413368918635,
646
+ "learning_rate": 9.444444444444444e-07,
647
+ "loss": 0.0204,
648
+ "num_tokens": 22905462.0,
649
+ "reward": 0.42480308030332836,
650
+ "reward_std": 0.3633535067949976,
651
+ "rewards/reward_func": 0.4248030515653746,
652
+ "step": 69
653
+ },
654
+ {
655
+ "clip_ratio": 0.010870669968426228,
656
+ "epoch": 0.09778487327878667,
657
+ "grad_norm": 0.2916766016433164,
658
+ "learning_rate": 9.583333333333334e-07,
659
+ "loss": 0.0211,
660
+ "step": 70
661
+ },
662
+ {
663
+ "clip_ratio": 0.010642989072948694,
664
+ "epoch": 0.0991818000399122,
665
+ "grad_norm": 0.2574669164587784,
666
+ "learning_rate": 9.722222222222222e-07,
667
+ "loss": 0.0209,
668
+ "step": 71
669
+ },
670
+ {
671
+ "clip_ratio": 0.010603911941871047,
672
+ "epoch": 0.10057872680103772,
673
+ "grad_norm": 0.3923293286285201,
674
+ "learning_rate": 9.861111111111112e-07,
675
+ "loss": 0.0206,
676
+ "step": 72
677
+ },
678
+ {
679
+ "clip_ratio": 0.0,
680
+ "completion_length": 4780.178763253348,
681
+ "epoch": 0.10197565356216325,
682
+ "grad_norm": 0.3357433852104651,
683
+ "learning_rate": 1e-06,
684
+ "loss": 0.0111,
685
+ "num_tokens": 23928872.0,
686
+ "reward": 0.49998574065310614,
687
+ "reward_std": 0.3773101898176329,
688
+ "rewards/reward_func": 0.4999857119151524,
689
+ "step": 73
690
+ },
691
+ {
692
+ "clip_ratio": 0.012297127628698945,
693
+ "epoch": 0.10337258032328876,
694
+ "grad_norm": 0.24331462448033314,
695
+ "learning_rate": 1e-06,
696
+ "loss": 0.0117,
697
+ "step": 74
698
+ },
699
+ {
700
+ "clip_ratio": 0.012708199177203434,
701
+ "epoch": 0.10476950708441429,
702
+ "grad_norm": 0.6107245136629853,
703
+ "learning_rate": 1e-06,
704
+ "loss": 0.0114,
705
+ "step": 75
706
+ },
707
+ {
708
+ "clip_ratio": 0.013628917180800013,
709
+ "epoch": 0.10616643384553981,
710
+ "grad_norm": 0.1571665107730879,
711
+ "learning_rate": 1e-06,
712
+ "loss": 0.0112,
713
+ "step": 76
714
+ },
715
+ {
716
+ "clip_ratio": 0.0,
717
+ "completion_length": 5568.459463936942,
718
+ "epoch": 0.10756336060666534,
719
+ "grad_norm": 0.3303048447870775,
720
+ "learning_rate": 1e-06,
721
+ "loss": 0.0085,
722
+ "num_tokens": 25108534.0,
723
+ "reward": 0.3940093676958765,
724
+ "reward_std": 0.32062976009079386,
725
+ "rewards/reward_func": 0.39400935066597803,
726
+ "step": 77
727
+ },
728
+ {
729
+ "clip_ratio": 0.012926211846726281,
730
+ "epoch": 0.10896028736779086,
731
+ "grad_norm": 0.4586726422820888,
732
+ "learning_rate": 1e-06,
733
+ "loss": 0.0092,
734
+ "step": 78
735
+ },
736
+ {
737
+ "clip_ratio": 0.013429554013003196,
738
+ "epoch": 0.11035721412891639,
739
+ "grad_norm": 0.46850871504202196,
740
+ "learning_rate": 1e-06,
741
+ "loss": 0.0089,
742
+ "step": 79
743
+ },
744
+ {
745
+ "clip_ratio": 0.01421830172850085,
746
+ "epoch": 0.1117541408900419,
747
+ "grad_norm": 0.2694884119514331,
748
+ "learning_rate": 1e-06,
749
+ "loss": 0.0087,
750
+ "step": 80
751
+ },
752
+ {
753
+ "clip_ratio": 0.0,
754
+ "completion_length": 5048.066615513393,
755
+ "epoch": 0.11315106765116743,
756
+ "grad_norm": 0.4818094588291497,
757
+ "learning_rate": 1e-06,
758
+ "loss": 0.0003,
759
+ "num_tokens": 26188824.0,
760
+ "reward": 0.4587076764021601,
761
+ "reward_std": 0.3670096014227186,
762
+ "rewards/reward_func": 0.45870765511478695,
763
+ "step": 81
764
+ },
765
+ {
766
+ "clip_ratio": 0.014440144545265607,
767
+ "epoch": 0.11454799441229295,
768
+ "grad_norm": 39.00637105645605,
769
+ "learning_rate": 1e-06,
770
+ "loss": 0.0041,
771
+ "step": 82
772
+ },
773
+ {
774
+ "clip_ratio": 0.014427063853612967,
775
+ "epoch": 0.11594492117341848,
776
+ "grad_norm": 0.9150065270465777,
777
+ "learning_rate": 1e-06,
778
+ "loss": 0.0009,
779
+ "step": 83
780
+ },
781
+ {
782
+ "clip_ratio": 0.015046841731028897,
783
+ "epoch": 0.117341847934544,
784
+ "grad_norm": 0.24009263771304865,
785
+ "learning_rate": 1e-06,
786
+ "loss": 0.0007,
787
+ "step": 84
788
+ },
789
+ {
790
+ "clip_ratio": 0.0,
791
+ "completion_length": 4776.74507359096,
792
+ "epoch": 0.11873877469566953,
793
+ "grad_norm": 0.4772391378994009,
794
+ "learning_rate": 1e-06,
795
+ "loss": 0.0175,
796
+ "num_tokens": 27213245.0,
797
+ "reward": 0.46243097526686533,
798
+ "reward_std": 0.3514525145292282,
799
+ "rewards/reward_func": 0.4624309518507549,
800
+ "step": 85
801
+ },
802
+ {
803
+ "clip_ratio": 0.013508185378408857,
804
+ "epoch": 0.12013570145679506,
805
+ "grad_norm": 166639.4843736821,
806
+ "learning_rate": 1e-06,
807
+ "loss": 7.3176,
808
+ "step": 86
809
+ },
810
+ {
811
+ "clip_ratio": 0.013775874627754092,
812
+ "epoch": 0.12153262821792057,
813
+ "grad_norm": 27.738301939542676,
814
+ "learning_rate": 1e-06,
815
+ "loss": 0.019,
816
+ "step": 87
817
+ },
818
+ {
819
+ "clip_ratio": 0.014050438667514495,
820
+ "epoch": 0.1229295549790461,
821
+ "grad_norm": 2.3910898137109857,
822
+ "learning_rate": 1e-06,
823
+ "loss": 0.0182,
824
+ "step": 88
825
+ },
826
+ {
827
+ "clip_ratio": 0.0,
828
+ "completion_length": 4914.035984584263,
829
+ "epoch": 0.12432648174017162,
830
+ "grad_norm": 0.5313282819608155,
831
+ "learning_rate": 1e-06,
832
+ "loss": 0.0136,
833
+ "num_tokens": 28265422.0,
834
+ "reward": 0.493380460355963,
835
+ "reward_std": 0.39978101530245375,
836
+ "rewards/reward_func": 0.4933804316180093,
837
+ "step": 89
838
+ },
839
+ {
840
+ "clip_ratio": 0.017403810085462674,
841
+ "epoch": 0.12572340850129715,
842
+ "grad_norm": 2.5053609302596263,
843
+ "learning_rate": 1e-06,
844
+ "loss": 0.0153,
845
+ "step": 90
846
+ },
847
+ {
848
+ "clip_ratio": 0.018204916534679278,
849
+ "epoch": 0.12712033526242267,
850
+ "grad_norm": 1.3673142623484746,
851
+ "learning_rate": 1e-06,
852
+ "loss": 0.0147,
853
+ "step": 91
854
+ },
855
+ {
856
+ "clip_ratio": 0.019155576026865413,
857
+ "epoch": 0.12851726202354818,
858
+ "grad_norm": 0.285245341653243,
859
+ "learning_rate": 1e-06,
860
+ "loss": 0.0145,
861
+ "step": 92
862
+ },
863
+ {
864
+ "clip_ratio": 0.0,
865
+ "completion_length": 4607.285940987723,
866
+ "epoch": 0.12991418878467373,
867
+ "grad_norm": 0.5382478014891808,
868
+ "learning_rate": 1e-06,
869
+ "loss": 0.0251,
870
+ "num_tokens": 29256889.0,
871
+ "reward": 0.4975069910287857,
872
+ "reward_std": 0.39376414673668997,
873
+ "rewards/reward_func": 0.4975069612264633,
874
+ "step": 93
875
+ },
876
+ {
877
+ "clip_ratio": 0.017131159414670298,
878
+ "epoch": 0.13131111554579925,
879
+ "grad_norm": 277.06893594236533,
880
+ "learning_rate": 1e-06,
881
+ "loss": 0.041,
882
+ "step": 94
883
+ },
884
+ {
885
+ "clip_ratio": 0.017470890456544503,
886
+ "epoch": 0.13270804230692476,
887
+ "grad_norm": 0.595127984757126,
888
+ "learning_rate": 1e-06,
889
+ "loss": 0.0264,
890
+ "step": 95
891
+ },
892
+ {
893
+ "clip_ratio": 0.017918821956430162,
894
+ "epoch": 0.13410496906805028,
895
+ "grad_norm": 0.3727932311400719,
896
+ "learning_rate": 1e-06,
897
+ "loss": 0.026,
898
+ "step": 96
899
+ },
900
+ {
901
+ "clip_ratio": 0.0,
902
+ "completion_length": 5105.030866350447,
903
+ "epoch": 0.13550189582917582,
904
+ "grad_norm": 0.5204808748332284,
905
+ "learning_rate": 1e-06,
906
+ "loss": 0.0166,
907
+ "num_tokens": 30346587.0,
908
+ "reward": 0.40901294563497814,
909
+ "reward_std": 0.3415069899388722,
910
+ "rewards/reward_func": 0.4090129222188677,
911
+ "step": 97
912
+ },
913
+ {
914
+ "clip_ratio": 0.0174449899766062,
915
+ "epoch": 0.13689882259030134,
916
+ "grad_norm": 1.1528181627310667,
917
+ "learning_rate": 1e-06,
918
+ "loss": 0.0183,
919
+ "step": 98
920
+ },
921
+ {
922
+ "clip_ratio": 0.01785454393497535,
923
+ "epoch": 0.13829574935142686,
924
+ "grad_norm": 0.6193098655808096,
925
+ "learning_rate": 1e-06,
926
+ "loss": 0.0177,
927
+ "step": 99
928
+ },
929
+ {
930
+ "clip_ratio": 0.018185677073363746,
931
+ "epoch": 0.13969267611255237,
932
+ "grad_norm": 0.29035255969562146,
933
+ "learning_rate": 1e-06,
934
+ "loss": 0.0174,
935
+ "step": 100
936
+ },
937
+ {
938
+ "clip_ratio": 0.0,
939
+ "completion_length": 3904.9848981584823,
940
+ "epoch": 0.14108960287367792,
941
+ "grad_norm": 0.709202941284989,
942
+ "learning_rate": 1e-06,
943
+ "loss": 0.0147,
944
+ "num_tokens": 31202372.0,
945
+ "reward": 0.529426036136491,
946
+ "reward_std": 0.35220117547682356,
947
+ "rewards/reward_func": 0.5294260127203805,
948
+ "step": 101
949
+ },
950
+ {
951
+ "clip_ratio": 0.01801375742070377,
952
+ "epoch": 0.14248652963480343,
953
+ "grad_norm": 1.0665575599442703,
954
+ "learning_rate": 1e-06,
955
+ "loss": 0.0166,
956
+ "step": 102
957
+ },
958
+ {
959
+ "clip_ratio": 0.017245101110477532,
960
+ "epoch": 0.14388345639592895,
961
+ "grad_norm": 0.5821159923874696,
962
+ "learning_rate": 1e-06,
963
+ "loss": 0.0158,
964
+ "step": 103
965
+ },
966
+ {
967
+ "clip_ratio": 0.01721734370637153,
968
+ "epoch": 0.1452803831570545,
969
+ "grad_norm": 0.4938223790926132,
970
+ "learning_rate": 1e-06,
971
+ "loss": 0.0153,
972
+ "step": 104
973
+ },
974
+ {
975
+ "clip_ratio": 0.0,
976
+ "completion_length": 4391.734933035715,
977
+ "epoch": 0.14667730991818,
978
+ "grad_norm": 0.6621058895011234,
979
+ "learning_rate": 1e-06,
980
+ "loss": 0.0067,
981
+ "num_tokens": 32151129.0,
982
+ "reward": 0.5155340305396489,
983
+ "reward_std": 0.36261362050260815,
984
+ "rewards/reward_func": 0.5155340198959623,
985
+ "step": 105
986
+ },
987
+ {
988
+ "clip_ratio": 0.021650432209883417,
989
+ "epoch": 0.14807423667930553,
990
+ "grad_norm": 7.221717083371915,
991
+ "learning_rate": 1e-06,
992
+ "loss": 0.0095,
993
+ "step": 106
994
+ },
995
+ {
996
+ "clip_ratio": 0.022131933498063257,
997
+ "epoch": 0.14947116344043104,
998
+ "grad_norm": 3.9217845571015726,
999
+ "learning_rate": 1e-06,
1000
+ "loss": 0.0087,
1001
+ "step": 107
1002
+ },
1003
+ {
1004
+ "clip_ratio": 0.023090457543730736,
1005
+ "epoch": 0.1508680902015566,
1006
+ "grad_norm": 1.0915253624674428,
1007
+ "learning_rate": 1e-06,
1008
+ "loss": 0.0083,
1009
+ "step": 108
1010
+ },
1011
+ {
1012
+ "clip_ratio": 0.0,
1013
+ "completion_length": 4265.617579868862,
1014
+ "epoch": 0.1522650169626821,
1015
+ "grad_norm": 0.7674370802581663,
1016
+ "learning_rate": 1e-06,
1017
+ "loss": 0.0076,
1018
+ "num_tokens": 33074935.0,
1019
+ "reward": 0.49383693294865744,
1020
+ "reward_std": 0.3673490881919861,
1021
+ "rewards/reward_func": 0.49383691059691565,
1022
+ "step": 109
1023
+ },
1024
+ {
1025
+ "clip_ratio": 0.01965414373470204,
1026
+ "epoch": 0.15366194372380762,
1027
+ "grad_norm": 3.114603095736279,
1028
+ "learning_rate": 1e-06,
1029
+ "loss": 0.0099,
1030
+ "step": 110
1031
+ },
1032
+ {
1033
+ "clip_ratio": 0.020012260481183018,
1034
+ "epoch": 0.15505887048493314,
1035
+ "grad_norm": 4.049634875724923,
1036
+ "learning_rate": 1e-06,
1037
+ "loss": 0.0094,
1038
+ "step": 111
1039
+ },
1040
+ {
1041
+ "clip_ratio": 0.02028396732306906,
1042
+ "epoch": 0.15645579724605868,
1043
+ "grad_norm": 0.5429450253769021,
1044
+ "learning_rate": 1e-06,
1045
+ "loss": 0.0089,
1046
+ "step": 112
1047
+ },
1048
+ {
1049
+ "clip_ratio": 0.0,
1050
+ "completion_length": 3556.7655116489955,
1051
+ "epoch": 0.1578527240071842,
1052
+ "grad_norm": 0.8213126340122913,
1053
+ "learning_rate": 1e-06,
1054
+ "loss": 0.0142,
1055
+ "num_tokens": 33860148.0,
1056
+ "reward": 0.520222473357405,
1057
+ "reward_std": 0.3601721642272813,
1058
+ "rewards/reward_func": 0.5202224499412945,
1059
+ "step": 113
1060
+ },
1061
+ {
1062
+ "clip_ratio": 0.021029458713850806,
1063
+ "epoch": 0.15924965076830971,
1064
+ "grad_norm": 511.99698568152866,
1065
+ "learning_rate": 1e-06,
1066
+ "loss": 0.0391,
1067
+ "step": 114
1068
+ },
1069
+ {
1070
+ "clip_ratio": 0.020824986709547893,
1071
+ "epoch": 0.16064657752943523,
1072
+ "grad_norm": 1.6554233851238163,
1073
+ "learning_rate": 1e-06,
1074
+ "loss": 0.0163,
1075
+ "step": 115
1076
+ },
1077
+ {
1078
+ "clip_ratio": 0.021296620901141847,
1079
+ "epoch": 0.16204350429056077,
1080
+ "grad_norm": 5.389449179546646,
1081
+ "learning_rate": 1e-06,
1082
+ "loss": 0.016,
1083
+ "step": 116
1084
+ },
1085
+ {
1086
+ "clip_ratio": 0.0,
1087
+ "completion_length": 4172.214425223215,
1088
+ "epoch": 0.1634404310516863,
1089
+ "grad_norm": 0.7951777611207881,
1090
+ "learning_rate": 1e-06,
1091
+ "loss": 0.0188,
1092
+ "num_tokens": 34766754.0,
1093
+ "reward": 0.43932128697633743,
1094
+ "reward_std": 0.36100248460258755,
1095
+ "rewards/reward_func": 0.4393212656889643,
1096
+ "step": 117
1097
+ },
1098
+ {
1099
+ "clip_ratio": 0.024627858506781713,
1100
+ "epoch": 0.1648373578128118,
1101
+ "grad_norm": 5.497957714291199,
1102
+ "learning_rate": 1e-06,
1103
+ "loss": 0.0267,
1104
+ "step": 118
1105
+ },
1106
+ {
1107
+ "clip_ratio": 0.024561051279306412,
1108
+ "epoch": 0.16623428457393732,
1109
+ "grad_norm": 4.006479624309579,
1110
+ "learning_rate": 1e-06,
1111
+ "loss": 0.0259,
1112
+ "step": 119
1113
+ },
1114
+ {
1115
+ "clip_ratio": 0.02518816019541451,
1116
+ "epoch": 0.16763121133506287,
1117
+ "grad_norm": 5.696382550533168,
1118
+ "learning_rate": 1e-06,
1119
+ "loss": 0.0217,
1120
+ "step": 120
1121
+ },
1122
+ {
1123
+ "clip_ratio": 0.0,
1124
+ "completion_length": 3450.438938685826,
1125
+ "epoch": 0.16902813809618839,
1126
+ "grad_norm": 0.8756816112591876,
1127
+ "learning_rate": 1e-06,
1128
+ "loss": 0.0128,
1129
+ "num_tokens": 35530451.0,
1130
+ "reward": 0.4647199107067926,
1131
+ "reward_std": 0.35261689871549606,
1132
+ "rewards/reward_func": 0.46471990112747463,
1133
+ "step": 121
1134
+ },
1135
+ {
1136
+ "clip_ratio": 0.023490584788045714,
1137
+ "epoch": 0.1704250648573139,
1138
+ "grad_norm": 8.184182062225446,
1139
+ "learning_rate": 1e-06,
1140
+ "loss": 0.0176,
1141
+ "step": 122
1142
+ },
1143
+ {
1144
+ "clip_ratio": 0.022877583213682686,
1145
+ "epoch": 0.17182199161843945,
1146
+ "grad_norm": 2.337796998952532,
1147
+ "learning_rate": 1e-06,
1148
+ "loss": 0.0158,
1149
+ "step": 123
1150
+ },
1151
+ {
1152
+ "clip_ratio": 0.022725746002314345,
1153
+ "epoch": 0.17321891837956496,
1154
+ "grad_norm": 1.204853002031202,
1155
+ "learning_rate": 1e-06,
1156
+ "loss": 0.0149,
1157
+ "step": 124
1158
+ },
1159
+ {
1160
+ "clip_ratio": 0.0,
1161
+ "completion_length": 3755.143040248326,
1162
+ "epoch": 0.17461584514069048,
1163
+ "grad_norm": 1.1667266762961181,
1164
+ "learning_rate": 1e-06,
1165
+ "loss": 0.0009,
1166
+ "num_tokens": 36355620.0,
1167
+ "reward": 0.48860155258859905,
1168
+ "reward_std": 0.3995990295495306,
1169
+ "rewards/reward_func": 0.4886015323655946,
1170
+ "step": 125
1171
+ },
1172
+ {
1173
+ "clip_ratio": 0.024759572331926653,
1174
+ "epoch": 0.176012771901816,
1175
+ "grad_norm": 11.549731072093149,
1176
+ "learning_rate": 1e-06,
1177
+ "loss": 0.0075,
1178
+ "step": 126
1179
+ },
1180
+ {
1181
+ "clip_ratio": 0.023941728619060347,
1182
+ "epoch": 0.17740969866294154,
1183
+ "grad_norm": 1.5478778519158778,
1184
+ "learning_rate": 1e-06,
1185
+ "loss": 0.0043,
1186
+ "step": 127
1187
+ },
1188
+ {
1189
+ "clip_ratio": 0.023272603883274963,
1190
+ "epoch": 0.17880662542406706,
1191
+ "grad_norm": 1.0384027782585576,
1192
+ "learning_rate": 1e-06,
1193
+ "loss": 0.0034,
1194
+ "step": 128
1195
+ },
1196
+ {
1197
+ "clip_ratio": 0.0,
1198
+ "completion_length": 3561.3930053710938,
1199
+ "epoch": 0.18020355218519257,
1200
+ "grad_norm": 1.203850582780552,
1201
+ "learning_rate": 1e-06,
1202
+ "loss": 0.0059,
1203
+ "num_tokens": 37143444.0,
1204
+ "reward": 0.4855222978762218,
1205
+ "reward_std": 0.38453598746231626,
1206
+ "rewards/reward_func": 0.4855222872325352,
1207
+ "step": 129
1208
+ },
1209
+ {
1210
+ "clip_ratio": 0.024004271253943443,
1211
+ "epoch": 0.1816004789463181,
1212
+ "grad_norm": 11.686104385649747,
1213
+ "learning_rate": 1e-06,
1214
+ "loss": 0.012,
1215
+ "step": 130
1216
+ },
1217
+ {
1218
+ "clip_ratio": 0.02320788980328611,
1219
+ "epoch": 0.18299740570744363,
1220
+ "grad_norm": 51.97949282308589,
1221
+ "learning_rate": 1e-06,
1222
+ "loss": 0.0129,
1223
+ "step": 131
1224
+ },
1225
+ {
1226
+ "clip_ratio": 0.023830042220652103,
1227
+ "epoch": 0.18439433246856915,
1228
+ "grad_norm": 77704.4679582965,
1229
+ "learning_rate": 1e-06,
1230
+ "loss": 0.929,
1231
+ "step": 132
1232
+ },
1233
+ {
1234
+ "clip_ratio": 0.0,
1235
+ "completion_length": 3375.382795061384,
1236
+ "epoch": 0.18579125922969467,
1237
+ "grad_norm": 1.1905136253909123,
1238
+ "learning_rate": 1e-06,
1239
+ "loss": 0.0195,
1240
+ "num_tokens": 37893570.0,
1241
+ "reward": 0.4746183859450476,
1242
+ "reward_std": 0.41642780708415167,
1243
+ "rewards/reward_func": 0.47461836465767454,
1244
+ "step": 133
1245
+ },
1246
+ {
1247
+ "clip_ratio": 0.03054676218224423,
1248
+ "epoch": 0.18718818599082018,
1249
+ "grad_norm": 47.607522363933455,
1250
+ "learning_rate": 1e-06,
1251
+ "loss": 0.0306,
1252
+ "step": 134
1253
+ },
1254
+ {
1255
+ "clip_ratio": 0.03216503720198359,
1256
+ "epoch": 0.18858511275194573,
1257
+ "grad_norm": 6.197384439543361,
1258
+ "learning_rate": 1e-06,
1259
+ "loss": 0.0265,
1260
+ "step": 135
1261
+ },
1262
+ {
1263
+ "clip_ratio": 0.03178960005087512,
1264
+ "epoch": 0.18998203951307124,
1265
+ "grad_norm": 2.236284664240462,
1266
+ "learning_rate": 1e-06,
1267
+ "loss": 0.0236,
1268
+ "step": 136
1269
+ },
1270
+ {
1271
+ "clip_ratio": 0.0,
1272
+ "completion_length": 3824.760410853795,
1273
+ "epoch": 0.19137896627419676,
1274
+ "grad_norm": 1.0181749371365818,
1275
+ "learning_rate": 1e-06,
1276
+ "loss": 0.0301,
1277
+ "num_tokens": 38731414.0,
1278
+ "reward": 0.4555432179144451,
1279
+ "reward_std": 0.371168036546026,
1280
+ "rewards/reward_func": 0.45554319130522863,
1281
+ "step": 137
1282
+ },
1283
+ {
1284
+ "clip_ratio": 0.02426370605826378,
1285
+ "epoch": 0.1927758930353223,
1286
+ "grad_norm": 15.973977289606324,
1287
+ "learning_rate": 1e-06,
1288
+ "loss": 2.1765,
1289
+ "step": 138
1290
+ },
1291
+ {
1292
+ "clip_ratio": 0.023818871338984797,
1293
+ "epoch": 0.19417281979644782,
1294
+ "grad_norm": 125.42621828076582,
1295
+ "learning_rate": 1e-06,
1296
+ "loss": 0.0544,
1297
+ "step": 139
1298
+ },
1299
+ {
1300
+ "clip_ratio": 0.0235800734455032,
1301
+ "epoch": 0.19556974655757334,
1302
+ "grad_norm": 5.708397430999111,
1303
+ "learning_rate": 1e-06,
1304
+ "loss": 0.0358,
1305
+ "step": 140
1306
+ },
1307
+ {
1308
+ "clip_ratio": 0.0,
1309
+ "completion_length": 3121.5970720563614,
1310
+ "epoch": 0.19696667331869885,
1311
+ "grad_norm": 0.9463162061122932,
1312
+ "learning_rate": 1e-06,
1313
+ "loss": 0.0074,
1314
+ "num_tokens": 39432472.0,
1315
+ "reward": 0.3878828393561499,
1316
+ "reward_std": 0.32353205340249197,
1317
+ "rewards/reward_func": 0.3878828233906201,
1318
+ "step": 141
1319
+ },
1320
+ {
1321
+ "clip_ratio": 0.031209798529744148,
1322
+ "epoch": 0.1983636000798244,
1323
+ "grad_norm": 19.178703569706425,
1324
+ "learning_rate": 1e-06,
1325
+ "loss": 0.0158,
1326
+ "step": 142
1327
+ },
1328
+ {
1329
+ "clip_ratio": 0.031645855334188254,
1330
+ "epoch": 0.19976052684094991,
1331
+ "grad_norm": 73.92547009994209,
1332
+ "learning_rate": 1e-06,
1333
+ "loss": 0.0183,
1334
+ "step": 143
1335
+ },
1336
+ {
1337
+ "clip_ratio": 0.032449710848076005,
1338
+ "epoch": 0.20115745360207543,
1339
+ "grad_norm": 5.770213423174226,
1340
+ "learning_rate": 1e-06,
1341
+ "loss": 0.0164,
1342
+ "step": 144
1343
+ },
1344
+ {
1345
+ "clip_ratio": 0.0,
1346
+ "completion_length": 3645.8165196010045,
1347
+ "epoch": 0.20255438036320095,
1348
+ "grad_norm": 1.2228735898177363,
1349
+ "learning_rate": 1e-06,
1350
+ "loss": 0.0139,
1351
+ "num_tokens": 40234738.0,
1352
+ "reward": 0.4959501911486898,
1353
+ "reward_std": 0.3776449923004423,
1354
+ "rewards/reward_func": 0.4959501826337406,
1355
+ "step": 145
1356
+ },
1357
+ {
1358
+ "clip_ratio": 0.029987079756600515,
1359
+ "epoch": 0.2039513071243265,
1360
+ "grad_norm": 45.612373429574255,
1361
+ "learning_rate": 1e-06,
1362
+ "loss": 0.0274,
1363
+ "step": 146
1364
+ },
1365
+ {
1366
+ "clip_ratio": 0.029181892717523233,
1367
+ "epoch": 0.205348233885452,
1368
+ "grad_norm": 61.829029657734615,
1369
+ "learning_rate": 1e-06,
1370
+ "loss": 0.0238,
1371
+ "step": 147
1372
+ },
1373
+ {
1374
+ "clip_ratio": 0.028760566908333982,
1375
+ "epoch": 0.20674516064657752,
1376
+ "grad_norm": 6.854234290541286,
1377
+ "learning_rate": 1e-06,
1378
+ "loss": 0.0212,
1379
+ "step": 148
1380
+ },
1381
+ {
1382
+ "clip_ratio": 0.0,
1383
+ "completion_length": 3616.0256783621653,
1384
+ "epoch": 0.20814208740770304,
1385
+ "grad_norm": 1.1080044572109065,
1386
+ "learning_rate": 1e-06,
1387
+ "loss": 0.0188,
1388
+ "num_tokens": 41031965.0,
1389
+ "reward": 0.37510563326733454,
1390
+ "reward_std": 0.35230499718870434,
1391
+ "rewards/reward_func": 0.37510561889835764,
1392
+ "step": 149
1393
+ },
1394
+ {
1395
+ "clip_ratio": 0.032221541074769836,
1396
+ "epoch": 0.20953901416882859,
1397
+ "grad_norm": 22328.844087735877,
1398
+ "learning_rate": 1e-06,
1399
+ "loss": 0.7198,
1400
+ "step": 150
1401
+ },
1402
+ {
1403
+ "clip_ratio": 0.03243154074464526,
1404
+ "epoch": 0.2109359409299541,
1405
+ "grad_norm": 11006.630246836325,
1406
+ "learning_rate": 1e-06,
1407
+ "loss": 1.3521,
1408
+ "step": 151
1409
+ },
1410
+ {
1411
+ "clip_ratio": 0.032671846981559484,
1412
+ "epoch": 0.21233286769107962,
1413
+ "grad_norm": 52.44059977916511,
1414
+ "learning_rate": 1e-06,
1415
+ "loss": 0.0309,
1416
+ "step": 152
1417
+ },
1418
+ {
1419
+ "clip_ratio": 0.0,
1420
+ "completion_length": 3217.7909197126114,
1421
+ "epoch": 0.21372979445220514,
1422
+ "grad_norm": 1.3203188901357052,
1423
+ "learning_rate": 1e-06,
1424
+ "loss": 0.0184,
1425
+ "num_tokens": 41750731.0,
1426
+ "reward": 0.4333155059388706,
1427
+ "reward_std": 0.3546490435089384,
1428
+ "rewards/reward_func": 0.43331548997334074,
1429
+ "step": 153
1430
+ },
1431
+ {
1432
+ "clip_ratio": 0.032571413687297275,
1433
+ "epoch": 0.21512672121333068,
1434
+ "grad_norm": 56932.32164959619,
1435
+ "learning_rate": 1e-06,
1436
+ "loss": 1.4737,
1437
+ "step": 154
1438
+ },
1439
+ {
1440
+ "clip_ratio": 0.03264636732637882,
1441
+ "epoch": 0.2165236479744562,
1442
+ "grad_norm": 569.4118154787187,
1443
+ "learning_rate": 1e-06,
1444
+ "loss": 0.0464,
1445
+ "step": 155
1446
+ },
1447
+ {
1448
+ "clip_ratio": 0.033495722870741575,
1449
+ "epoch": 0.2179205747355817,
1450
+ "grad_norm": 14.372919673445498,
1451
+ "learning_rate": 1e-06,
1452
+ "loss": 0.0297,
1453
+ "step": 156
1454
+ },
1455
+ {
1456
+ "clip_ratio": 0.0,
1457
+ "completion_length": 2904.224591936384,
1458
+ "epoch": 0.21931750149670726,
1459
+ "grad_norm": 1.4884091255614038,
1460
+ "learning_rate": 1e-06,
1461
+ "loss": 0.0027,
1462
+ "num_tokens": 42407374.0,
1463
+ "reward": 0.46237824857234955,
1464
+ "reward_std": 0.38831384958965437,
1465
+ "rewards/reward_func": 0.4623782304780824,
1466
+ "step": 157
1467
+ },
1468
+ {
1469
+ "clip_ratio": 0.03049316949078015,
1470
+ "epoch": 0.22071442825783277,
1471
+ "grad_norm": 753.2718719394906,
1472
+ "learning_rate": 1e-06,
1473
+ "loss": 0.0615,
1474
+ "step": 158
1475
+ },
1476
+ {
1477
+ "clip_ratio": 0.028818647909377302,
1478
+ "epoch": 0.2221113550189583,
1479
+ "grad_norm": 193.7516952886048,
1480
+ "learning_rate": 1e-06,
1481
+ "loss": 0.03,
1482
+ "step": 159
1483
+ },
1484
+ {
1485
+ "clip_ratio": 0.028797397390007973,
1486
+ "epoch": 0.2235082817800838,
1487
+ "grad_norm": 86.17864803711156,
1488
+ "learning_rate": 1e-06,
1489
+ "loss": 0.0187,
1490
+ "step": 160
1491
+ },
1492
+ {
1493
+ "clip_ratio": 0.0,
1494
+ "completion_length": 2706.137860979353,
1495
+ "epoch": 0.22490520854120935,
1496
+ "grad_norm": 1.437051783056985,
1497
+ "learning_rate": 1e-06,
1498
+ "loss": 0.004,
1499
+ "num_tokens": 43026529.0,
1500
+ "reward": 0.40501056824411663,
1501
+ "reward_std": 0.3891604415008,
1502
+ "rewards/reward_func": 0.4050105522785868,
1503
+ "step": 161
1504
+ },
1505
+ {
1506
+ "clip_ratio": 0.03492548343326364,
1507
+ "epoch": 0.22630213530233487,
1508
+ "grad_norm": 1637.6323089099733,
1509
+ "learning_rate": 1e-06,
1510
+ "loss": 0.0796,
1511
+ "step": 162
1512
+ },
1513
+ {
1514
+ "clip_ratio": 0.034652630399380414,
1515
+ "epoch": 0.22769906206346038,
1516
+ "grad_norm": 294.8538016270806,
1517
+ "learning_rate": 1e-06,
1518
+ "loss": 0.0397,
1519
+ "step": 163
1520
+ },
1521
+ {
1522
+ "clip_ratio": 0.03514658712915012,
1523
+ "epoch": 0.2290959888245859,
1524
+ "grad_norm": 1729.0881090208584,
1525
+ "learning_rate": 1e-06,
1526
+ "loss": 0.1081,
1527
+ "step": 164
1528
+ },
1529
+ {
1530
+ "clip_ratio": 0.0,
1531
+ "completion_length": 3302.3215855189733,
1532
+ "epoch": 0.23049291558571144,
1533
+ "grad_norm": 1.3478961700451182,
1534
+ "learning_rate": 1e-06,
1535
+ "loss": 0.0095,
1536
+ "num_tokens": 43761689.0,
1537
+ "reward": 0.354110734803336,
1538
+ "reward_std": 0.3442910239100456,
1539
+ "rewards/reward_func": 0.35411071511251585,
1540
+ "step": 165
1541
+ },
1542
+ {
1543
+ "clip_ratio": 0.03175032351698194,
1544
+ "epoch": 0.23188984234683696,
1545
+ "grad_norm": 34.2352104129209,
1546
+ "learning_rate": 1e-06,
1547
+ "loss": 0.0236,
1548
+ "step": 166
1549
+ },
1550
+ {
1551
+ "clip_ratio": 0.031168780555682524,
1552
+ "epoch": 0.23328676910796248,
1553
+ "grad_norm": 3479.355422028937,
1554
+ "learning_rate": 1e-06,
1555
+ "loss": 0.3311,
1556
+ "step": 167
1557
+ },
1558
+ {
1559
+ "clip_ratio": 0.031411009441529004,
1560
+ "epoch": 0.234683695869088,
1561
+ "grad_norm": 211.96486688673437,
1562
+ "learning_rate": 1e-06,
1563
+ "loss": 0.0428,
1564
+ "step": 168
1565
+ },
1566
+ {
1567
+ "clip_ratio": 0.0,
1568
+ "completion_length": 3288.581760951451,
1569
+ "epoch": 0.23608062263021354,
1570
+ "grad_norm": 1.5809513920036224,
1571
+ "learning_rate": 1e-06,
1572
+ "loss": 0.0206,
1573
+ "num_tokens": 44495433.0,
1574
+ "reward": 0.3336522286491735,
1575
+ "reward_std": 0.35370165216071264,
1576
+ "rewards/reward_func": 0.3336522126836436,
1577
+ "step": 169
1578
+ },
1579
+ {
1580
+ "clip_ratio": 0.03352949349209666,
1581
+ "epoch": 0.23747754939133905,
1582
+ "grad_norm": 131.25750741813656,
1583
+ "learning_rate": 1e-06,
1584
+ "loss": 0.0411,
1585
+ "step": 170
1586
+ },
1587
+ {
1588
+ "clip_ratio": 0.033907221497169564,
1589
+ "epoch": 0.23887447615246457,
1590
+ "grad_norm": 38.44427070292949,
1591
+ "learning_rate": 1e-06,
1592
+ "loss": 0.0333,
1593
+ "step": 171
1594
+ },
1595
+ {
1596
+ "clip_ratio": 0.034381040039339235,
1597
+ "epoch": 0.24027140291359012,
1598
+ "grad_norm": 17107451499810.188,
1599
+ "learning_rate": 1e-06,
1600
+ "loss": 549430272.0,
1601
+ "step": 172
1602
+ },
1603
+ {
1604
+ "clip_ratio": 0.0,
1605
+ "completion_length": 3361.0919799804688,
1606
+ "epoch": 0.24166832967471563,
1607
+ "grad_norm": 1.637145998911673,
1608
+ "learning_rate": 1e-06,
1609
+ "loss": 0.0187,
1610
+ "num_tokens": 45243898.0,
1611
+ "reward": 0.394156134554318,
1612
+ "reward_std": 0.40689716062375475,
1613
+ "rewards/reward_func": 0.3941561228462628,
1614
+ "step": 173
1615
+ },
1616
+ {
1617
+ "clip_ratio": 0.032513607027275224,
1618
+ "epoch": 0.24306525643584115,
1619
+ "grad_norm": 800.8287273060004,
1620
+ "learning_rate": 1e-06,
1621
+ "loss": 1.6832,
1622
+ "step": 174
1623
+ },
1624
+ {
1625
+ "clip_ratio": 0.030495245408798968,
1626
+ "epoch": 0.24446218319696666,
1627
+ "grad_norm": 729.365666028725,
1628
+ "learning_rate": 1e-06,
1629
+ "loss": 0.1281,
1630
+ "step": 175
1631
+ },
1632
+ {
1633
+ "clip_ratio": 0.03067155448453767,
1634
+ "epoch": 0.2458591099580922,
1635
+ "grad_norm": 257.8929935202217,
1636
+ "learning_rate": 1e-06,
1637
+ "loss": 0.0783,
1638
+ "step": 176
1639
+ },
1640
+ {
1641
+ "clip_ratio": 0.0,
1642
+ "completion_length": 2669.938886369978,
1643
+ "epoch": 0.24725603671921773,
1644
+ "grad_norm": 1.6984457904054797,
1645
+ "learning_rate": 1e-06,
1646
+ "loss": -0.0017,
1647
+ "num_tokens": 45856081.0,
1648
+ "reward": 0.3272132841604097,
1649
+ "reward_std": 0.36115063620465143,
1650
+ "rewards/reward_func": 0.3272132767098291,
1651
+ "step": 177
1652
+ },
1653
+ {
1654
+ "clip_ratio": 0.03918117896786758,
1655
+ "epoch": 0.24865296348034324,
1656
+ "grad_norm": 459.0007426096092,
1657
+ "learning_rate": 1e-06,
1658
+ "loss": 0.0378,
1659
+ "step": 178
1660
+ },
1661
+ {
1662
+ "clip_ratio": 0.037612543175263066,
1663
+ "epoch": 0.2500498902414688,
1664
+ "grad_norm": 198.16000110545232,
1665
+ "learning_rate": 1e-06,
1666
+ "loss": 0.0357,
1667
+ "step": 179
1668
+ },
1669
+ {
1670
+ "clip_ratio": 0.03760030067392758,
1671
+ "epoch": 0.2514468170025943,
1672
+ "grad_norm": 193.31294839005466,
1673
+ "learning_rate": 1e-06,
1674
+ "loss": 0.0318,
1675
+ "step": 180
1676
+ },
1677
+ {
1678
+ "clip_ratio": 0.0,
1679
+ "completion_length": 3767.30623953683,
1680
+ "epoch": 0.2528437437637198,
1681
+ "grad_norm": 1.4505504547674242,
1682
+ "learning_rate": 1e-06,
1683
+ "loss": 0.0004,
1684
+ "num_tokens": 46683920.0,
1685
+ "reward": 0.3422575050166675,
1686
+ "reward_std": 0.3818031592028482,
1687
+ "rewards/reward_func": 0.3422574890511377,
1688
+ "step": 181
1689
+ },
1690
+ {
1691
+ "clip_ratio": 0.03315202798694372,
1692
+ "epoch": 0.25424067052484534,
1693
+ "grad_norm": 238.64962645549264,
1694
+ "learning_rate": 1e-06,
1695
+ "loss": 0.0462,
1696
+ "step": 182
1697
+ },
1698
+ {
1699
+ "clip_ratio": 0.03287409871284451,
1700
+ "epoch": 0.25563759728597085,
1701
+ "grad_norm": 6799.648792237924,
1702
+ "learning_rate": 1e-06,
1703
+ "loss": 0.0493,
1704
+ "step": 183
1705
+ },
1706
+ {
1707
+ "clip_ratio": 0.03349324116217239,
1708
+ "epoch": 0.25703452404709637,
1709
+ "grad_norm": 1395.3440659332787,
1710
+ "learning_rate": 1e-06,
1711
+ "loss": 0.1532,
1712
+ "step": 184
1713
+ },
1714
+ {
1715
+ "clip_ratio": 0.0,
1716
+ "completion_length": 3256.025630405971,
1717
+ "epoch": 0.2584314508082219,
1718
+ "grad_norm": 1.8519382626688905,
1719
+ "learning_rate": 1e-06,
1720
+ "loss": 0.0091,
1721
+ "num_tokens": 47409833.0,
1722
+ "reward": 0.32464135118893217,
1723
+ "reward_std": 0.3450521251985005,
1724
+ "rewards/reward_func": 0.324641336287771,
1725
+ "step": 185
1726
+ },
1727
+ {
1728
+ "clip_ratio": 0.034153553524187634,
1729
+ "epoch": 0.25982837756934746,
1730
+ "grad_norm": 55.33553677644012,
1731
+ "learning_rate": 1e-06,
1732
+ "loss": 0.0322,
1733
+ "step": 186
1734
+ },
1735
+ {
1736
+ "clip_ratio": 0.03325902218265193,
1737
+ "epoch": 0.261225304330473,
1738
+ "grad_norm": 807.7840491437855,
1739
+ "learning_rate": 1e-06,
1740
+ "loss": 0.0771,
1741
+ "step": 187
1742
+ },
1743
+ {
1744
+ "clip_ratio": 0.032821542982544215,
1745
+ "epoch": 0.2626222310915985,
1746
+ "grad_norm": 1395.5436294619333,
1747
+ "learning_rate": 1e-06,
1748
+ "loss": 0.0888,
1749
+ "step": 188
1750
+ },
1751
+ {
1752
+ "clip_ratio": 0.0,
1753
+ "completion_length": 3214.1480887276784,
1754
+ "epoch": 0.264019157852724,
1755
+ "grad_norm": 1.7683494272507614,
1756
+ "learning_rate": 1e-06,
1757
+ "loss": 0.0112,
1758
+ "num_tokens": 48129036.0,
1759
+ "reward": 0.31755988619157244,
1760
+ "reward_std": 0.3383456287639482,
1761
+ "rewards/reward_func": 0.31755986117890905,
1762
+ "step": 189
1763
+ },
1764
+ {
1765
+ "clip_ratio": 0.03975264209189585,
1766
+ "epoch": 0.2654160846138495,
1767
+ "grad_norm": 45184.22194084358,
1768
+ "learning_rate": 1e-06,
1769
+ "loss": 0.4443,
1770
+ "step": 190
1771
+ },
1772
+ {
1773
+ "clip_ratio": 0.03915290268404143,
1774
+ "epoch": 0.26681301137497504,
1775
+ "grad_norm": 1242.8816256939144,
1776
+ "learning_rate": 1e-06,
1777
+ "loss": 0.1447,
1778
+ "step": 191
1779
+ },
1780
+ {
1781
+ "clip_ratio": 0.03953878129167216,
1782
+ "epoch": 0.26820993813610056,
1783
+ "grad_norm": 1479.8321627428613,
1784
+ "learning_rate": 1e-06,
1785
+ "loss": 0.1168,
1786
+ "step": 192
1787
+ },
1788
+ {
1789
+ "clip_ratio": 0.0,
1790
+ "completion_length": 3272.2399553571427,
1791
+ "epoch": 0.26960686489722613,
1792
+ "grad_norm": 2.177506823211759,
1793
+ "learning_rate": 1e-06,
1794
+ "loss": 0.0092,
1795
+ "num_tokens": 48860342.0,
1796
+ "reward": 0.34522383979388643,
1797
+ "reward_std": 0.3796129695006779,
1798
+ "rewards/reward_func": 0.34522382276398794,
1799
+ "step": 193
1800
+ },
1801
+ {
1802
+ "clip_ratio": 0.03925856229450021,
1803
+ "epoch": 0.27100379165835164,
1804
+ "grad_norm": 513.8290574797221,
1805
+ "learning_rate": 1e-06,
1806
+ "loss": 0.0613,
1807
+ "step": 194
1808
+ },
1809
+ {
1810
+ "clip_ratio": 0.03799283770578248,
1811
+ "epoch": 0.27240071841947716,
1812
+ "grad_norm": 8983.081819712857,
1813
+ "learning_rate": 1e-06,
1814
+ "loss": 0.3161,
1815
+ "step": 195
1816
+ },
1817
+ {
1818
+ "clip_ratio": 0.036926204205623696,
1819
+ "epoch": 0.2737976451806027,
1820
+ "grad_norm": 1027.0780848048523,
1821
+ "learning_rate": 1e-06,
1822
+ "loss": 0.1274,
1823
+ "step": 196
1824
+ },
1825
+ {
1826
+ "clip_ratio": 0.0,
1827
+ "completion_length": 4028.9797712053573,
1828
+ "epoch": 0.2751945719417282,
1829
+ "grad_norm": 1.3698484721094724,
1830
+ "learning_rate": 1e-06,
1831
+ "loss": 0.018,
1832
+ "num_tokens": 49737682.0,
1833
+ "reward": 0.2579219543508121,
1834
+ "reward_std": 0.32817436435392927,
1835
+ "rewards/reward_func": 0.25792194423930986,
1836
+ "step": 197
1837
+ },
1838
+ {
1839
+ "clip_ratio": 0.03714690676757267,
1840
+ "epoch": 0.2765914987028537,
1841
+ "grad_norm": 759.0060595947047,
1842
+ "learning_rate": 1e-06,
1843
+ "loss": 0.0657,
1844
+ "step": 198
1845
+ },
1846
+ {
1847
+ "clip_ratio": 0.0380573890038899,
1848
+ "epoch": 0.2779884254639792,
1849
+ "grad_norm": 7489.486866588998,
1850
+ "learning_rate": 1e-06,
1851
+ "loss": 0.9186,
1852
+ "step": 199
1853
+ },
1854
+ {
1855
+ "clip_ratio": 0.03898970350357039,
1856
+ "epoch": 0.27938535222510474,
1857
+ "grad_norm": 403.4437322167033,
1858
+ "learning_rate": 1e-06,
1859
+ "loss": 0.1357,
1860
+ "step": 200
1861
+ }
1862
+ ],
1863
+ "logging_steps": 1,
1864
+ "max_steps": 715,
1865
+ "num_input_tokens_seen": 0,
1866
+ "num_train_epochs": 1,
1867
+ "save_steps": 50,
1868
+ "stateful_callbacks": {
1869
+ "TrainerControl": {
1870
+ "args": {
1871
+ "should_epoch_stop": false,
1872
+ "should_evaluate": false,
1873
+ "should_log": false,
1874
+ "should_save": true,
1875
+ "should_training_stop": false
1876
+ },
1877
+ "attributes": {}
1878
+ }
1879
+ },
1880
+ "total_flos": 0.0,
1881
+ "train_batch_size": 2,
1882
+ "trial_name": null,
1883
+ "trial_params": null
1884
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58e8df48da12f36a1ac3817d446828cf7c21b00c73a2921ce5024b38f3185fca
3
+ size 7608
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)