ziansu commited on
Commit
45d0b76
·
verified ·
1 Parent(s): c28c0f8

Training in progress, step 700, checkpoint

Browse files
checkpoint-700/README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: meta-llama/CodeLlama-7b-Instruct-hf
3
+ library_name: peft
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.14.0
checkpoint-700/adapter_config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "meta-llama/CodeLlama-7b-Instruct-hf",
5
+ "bias": "none",
6
+ "eva_config": null,
7
+ "exclude_modules": null,
8
+ "fan_in_fan_out": false,
9
+ "inference_mode": true,
10
+ "init_lora_weights": true,
11
+ "layer_replication": null,
12
+ "layers_pattern": null,
13
+ "layers_to_transform": null,
14
+ "loftq_config": {},
15
+ "lora_alpha": 16,
16
+ "lora_bias": false,
17
+ "lora_dropout": 0.0,
18
+ "megatron_config": null,
19
+ "megatron_core": "megatron.core",
20
+ "modules_to_save": null,
21
+ "peft_type": "LORA",
22
+ "r": 8,
23
+ "rank_pattern": {},
24
+ "revision": null,
25
+ "target_modules": [
26
+ "k_proj",
27
+ "gate_proj",
28
+ "o_proj",
29
+ "v_proj",
30
+ "down_proj",
31
+ "q_proj",
32
+ "up_proj"
33
+ ],
34
+ "task_type": "CAUSAL_LM",
35
+ "use_dora": false,
36
+ "use_rslora": false
37
+ }
checkpoint-700/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:607b07a7a5dbee4002f453eb4b2786c26f0a3417a28ae62925c6ae7851adc1b0
3
+ size 40036488
checkpoint-700/global_step700/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:5e7776488978e9de65a168547c205f0a33d4fcc020cb69828a47430bdcac4db0
3
+ size 29992112
checkpoint-700/global_step700/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:70faf4985b2fdd1cb00d39dc4e679309605d7607e267cc738768d7564e0b3050
3
+ size 29992112
checkpoint-700/global_step700/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:d9686bd66af2245f65615e44d65570f36cc90134ba032682b9c5eb37da7181ea
3
+ size 29992176
checkpoint-700/global_step700/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:327e37ef05a00f1965fb9242eb7eed113a416ff6a8e5fbeba389bcb340b68049
3
+ size 29992176
checkpoint-700/global_step700/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:afa1f310a464e1c3b38676f62b30710fc141a76cb0c4264d312dae7122e67baa
3
+ size 29992176
checkpoint-700/global_step700/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:98ab4a5d001d6194d271f078c180d7dbb194f42fa6f7e80137666cdaac31fa77
3
+ size 29992176
checkpoint-700/global_step700/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:067fb431fe4148e43542f716a2eaacafaa5bce0351a47a71382495d2d6976fff
3
+ size 29992176
checkpoint-700/global_step700/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e817716cf94fc732f1eed69771dc42db72e40e3d7be617103fe38198f45e6be5
3
+ size 29992176
checkpoint-700/global_step700/mp_rank_00_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad37d4aa566617a4326aaddea084f6a2ace48a110c3c51f950a146576b537b39
3
+ size 40324204
checkpoint-700/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step700
checkpoint-700/rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57d1be83d8248a4d086961979df8c8adf273c0891e791d7b637d9e752cbaf971
3
+ size 15984
checkpoint-700/rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df16bc8587b83b59d73ffcb4774bab640ed2bbf6249aba7b7112751df7280b58
3
+ size 15984
checkpoint-700/rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8ebd66766c47747d9d34f4ee4e6f1e09fb1843f9769ec17242277c256d80133
3
+ size 15984
checkpoint-700/rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e44591b56351d86ebac6b6310a6b9a58bf9ebd5af691efd9614e457180a22080
3
+ size 15984
checkpoint-700/rng_state_4.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2488c2baf1f7983e7e82c869c2ff023bdc7796ba97390c46686a4df8544a046
3
+ size 15984
checkpoint-700/rng_state_5.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a864d68e543f00211ae2c48a5b9f47a92cf862dc03f0cda64f0647177108efe6
3
+ size 15984
checkpoint-700/rng_state_6.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4ab980d3568f3d6a91c3cc4b09b1c84c8bbbd77347d21d918824619ddb9bc7f
3
+ size 15984
checkpoint-700/rng_state_7.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a7008a4087300200a04419d46f39b98daf870297f179e965bf970ef908f90f3
3
+ size 15984
checkpoint-700/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:178a633ca77249e494a838a84b1947b0f7d11ddc3db2f6e8c894966583a0a8c6
3
+ size 1064
checkpoint-700/special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "▁<PRE>",
4
+ "▁<MID>",
5
+ "▁<SUF>",
6
+ "▁<EOT>"
7
+ ],
8
+ "bos_token": {
9
+ "content": "<s>",
10
+ "lstrip": false,
11
+ "normalized": false,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ },
15
+ "eos_token": {
16
+ "content": "</s>",
17
+ "lstrip": false,
18
+ "normalized": false,
19
+ "rstrip": false,
20
+ "single_word": false
21
+ },
22
+ "pad_token": "</s>",
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
checkpoint-700/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-700/tokenizer_config.json ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "32007": {
30
+ "content": "▁<PRE>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "32008": {
38
+ "content": "▁<SUF>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "32009": {
46
+ "content": "▁<MID>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "32010": {
54
+ "content": "▁<EOT>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ }
61
+ },
62
+ "additional_special_tokens": [
63
+ "▁<PRE>",
64
+ "▁<MID>",
65
+ "▁<SUF>",
66
+ "▁<EOT>"
67
+ ],
68
+ "bos_token": "<s>",
69
+ "chat_template": "{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if loop.index0 == 0 and system_message is defined %}{% set content = '<<SYS>>\n' + system_message + '\n<</SYS>>\n\n' + message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ '<s>' + '[INST] ' + content + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content + ' ' + '</s>' }}{% endif %}{% endfor %}",
70
+ "clean_up_tokenization_spaces": false,
71
+ "eos_token": "</s>",
72
+ "eot_token": "▁<EOT>",
73
+ "extra_special_tokens": {},
74
+ "fill_token": "<FILL_ME>",
75
+ "legacy": null,
76
+ "middle_token": "▁<MID>",
77
+ "model_max_length": 1000000000000000019884624838656,
78
+ "pad_token": "</s>",
79
+ "padding_side": "right",
80
+ "prefix_token": "▁<PRE>",
81
+ "sp_model_kwargs": {},
82
+ "split_special_tokens": false,
83
+ "suffix_token": "▁<SUF>",
84
+ "tokenizer_class": "CodeLlamaTokenizer",
85
+ "unk_token": "<unk>",
86
+ "use_default_system_prompt": false
87
+ }
checkpoint-700/trainer_state.json ADDED
@@ -0,0 +1,1307 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 0.5073842529672918,
5
+ "eval_steps": 50,
6
+ "global_step": 700,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.007248346470961312,
13
+ "grad_norm": 0.07201674580574036,
14
+ "learning_rate": 4.999451708687114e-06,
15
+ "logits/chosen": -1.9793262481689453,
16
+ "logits/rejected": -2.5381760597229004,
17
+ "logps/chosen": -0.28126341104507446,
18
+ "logps/rejected": -0.3779803514480591,
19
+ "loss": 7.3904,
20
+ "rewards/accuracies": 0.550000011920929,
21
+ "rewards/chosen": -0.4218950867652893,
22
+ "rewards/margins": 0.14507544040679932,
23
+ "rewards/rejected": -0.5669704675674438,
24
+ "step": 10
25
+ },
26
+ {
27
+ "epoch": 0.014496692941922623,
28
+ "grad_norm": 0.07562297582626343,
29
+ "learning_rate": 4.997807075247147e-06,
30
+ "logits/chosen": -2.0567643642425537,
31
+ "logits/rejected": -2.4989147186279297,
32
+ "logps/chosen": -0.27690139412879944,
33
+ "logps/rejected": -0.33544114232063293,
34
+ "loss": 7.3756,
35
+ "rewards/accuracies": 0.574999988079071,
36
+ "rewards/chosen": -0.41535210609436035,
37
+ "rewards/margins": 0.08780960738658905,
38
+ "rewards/rejected": -0.5031617283821106,
39
+ "step": 20
40
+ },
41
+ {
42
+ "epoch": 0.021745039412883936,
43
+ "grad_norm": 0.09685570746660233,
44
+ "learning_rate": 4.9950668210706795e-06,
45
+ "logits/chosen": -2.10174298286438,
46
+ "logits/rejected": -2.378197431564331,
47
+ "logps/chosen": -0.26717427372932434,
48
+ "logps/rejected": -0.30565372109413147,
49
+ "loss": 7.451,
50
+ "rewards/accuracies": 0.4375,
51
+ "rewards/chosen": -0.4007614254951477,
52
+ "rewards/margins": 0.05771917849779129,
53
+ "rewards/rejected": -0.4584805369377136,
54
+ "step": 30
55
+ },
56
+ {
57
+ "epoch": 0.028993385883845247,
58
+ "grad_norm": 0.08213861286640167,
59
+ "learning_rate": 4.9912321481237616e-06,
60
+ "logits/chosen": -2.1633317470550537,
61
+ "logits/rejected": -2.387866497039795,
62
+ "logps/chosen": -0.27634260058403015,
63
+ "logps/rejected": -0.37035584449768066,
64
+ "loss": 7.3892,
65
+ "rewards/accuracies": 0.6499999761581421,
66
+ "rewards/chosen": -0.4145139157772064,
67
+ "rewards/margins": 0.14101983606815338,
68
+ "rewards/rejected": -0.555533766746521,
69
+ "step": 40
70
+ },
71
+ {
72
+ "epoch": 0.03624173235480656,
73
+ "grad_norm": 0.08846044540405273,
74
+ "learning_rate": 4.986304738420684e-06,
75
+ "logits/chosen": -2.1402599811553955,
76
+ "logits/rejected": -2.4459526538848877,
77
+ "logps/chosen": -0.2535383999347687,
78
+ "logps/rejected": -0.3090876042842865,
79
+ "loss": 7.5171,
80
+ "rewards/accuracies": 0.512499988079071,
81
+ "rewards/chosen": -0.3803076148033142,
82
+ "rewards/margins": 0.08332376182079315,
83
+ "rewards/rejected": -0.4636313319206238,
84
+ "step": 50
85
+ },
86
+ {
87
+ "epoch": 0.03624173235480656,
88
+ "eval_logits/chosen": -2.1165692806243896,
89
+ "eval_logits/rejected": -2.476428747177124,
90
+ "eval_logps/chosen": -0.2828062176704407,
91
+ "eval_logps/rejected": -0.3432886600494385,
92
+ "eval_loss": 0.9120001792907715,
93
+ "eval_rewards/accuracies": 0.5089285969734192,
94
+ "eval_rewards/chosen": -0.4242093861103058,
95
+ "eval_rewards/margins": 0.09072363376617432,
96
+ "eval_rewards/rejected": -0.5149329900741577,
97
+ "eval_runtime": 30.971,
98
+ "eval_samples_per_second": 28.801,
99
+ "eval_steps_per_second": 3.616,
100
+ "step": 50
101
+ },
102
+ {
103
+ "epoch": 0.04349007882576787,
104
+ "grad_norm": 0.11753705143928528,
105
+ "learning_rate": 4.980286753286196e-06,
106
+ "logits/chosen": -2.0575368404388428,
107
+ "logits/rejected": -2.5456700325012207,
108
+ "logps/chosen": -0.24622221291065216,
109
+ "logps/rejected": -0.32402220368385315,
110
+ "loss": 7.3926,
111
+ "rewards/accuracies": 0.5874999761581421,
112
+ "rewards/chosen": -0.36933332681655884,
113
+ "rewards/margins": 0.11669999361038208,
114
+ "rewards/rejected": -0.48603329062461853,
115
+ "step": 60
116
+ },
117
+ {
118
+ "epoch": 0.05073842529672919,
119
+ "grad_norm": 0.09996571391820908,
120
+ "learning_rate": 4.973180832407471e-06,
121
+ "logits/chosen": -1.9278606176376343,
122
+ "logits/rejected": -2.4620182514190674,
123
+ "logps/chosen": -0.2596542239189148,
124
+ "logps/rejected": -0.3665880560874939,
125
+ "loss": 7.185,
126
+ "rewards/accuracies": 0.5874999761581421,
127
+ "rewards/chosen": -0.3894812762737274,
128
+ "rewards/margins": 0.160400852560997,
129
+ "rewards/rejected": -0.5498821139335632,
130
+ "step": 70
131
+ },
132
+ {
133
+ "epoch": 0.057986771767690494,
134
+ "grad_norm": 0.07287321239709854,
135
+ "learning_rate": 4.964990092676263e-06,
136
+ "logits/chosen": -2.078031063079834,
137
+ "logits/rejected": -2.461479663848877,
138
+ "logps/chosen": -0.24513795971870422,
139
+ "logps/rejected": -0.3448730707168579,
140
+ "loss": 7.365,
141
+ "rewards/accuracies": 0.5874999761581421,
142
+ "rewards/chosen": -0.36770695447921753,
143
+ "rewards/margins": 0.14960262179374695,
144
+ "rewards/rejected": -0.5173095464706421,
145
+ "step": 80
146
+ },
147
+ {
148
+ "epoch": 0.0652351182386518,
149
+ "grad_norm": 0.09656044095754623,
150
+ "learning_rate": 4.9557181268217225e-06,
151
+ "logits/chosen": -1.9979238510131836,
152
+ "logits/rejected": -2.4381277561187744,
153
+ "logps/chosen": -0.24047240614891052,
154
+ "logps/rejected": -0.3277527987957001,
155
+ "loss": 7.2664,
156
+ "rewards/accuracies": 0.6000000238418579,
157
+ "rewards/chosen": -0.36070865392684937,
158
+ "rewards/margins": 0.13092057406902313,
159
+ "rewards/rejected": -0.4916292130947113,
160
+ "step": 90
161
+ },
162
+ {
163
+ "epoch": 0.07248346470961312,
164
+ "grad_norm": 0.08125138282775879,
165
+ "learning_rate": 4.9453690018345144e-06,
166
+ "logits/chosen": -1.8948112726211548,
167
+ "logits/rejected": -2.4755520820617676,
168
+ "logps/chosen": -0.20189261436462402,
169
+ "logps/rejected": -0.29732149839401245,
170
+ "loss": 7.2542,
171
+ "rewards/accuracies": 0.5874999761581421,
172
+ "rewards/chosen": -0.30283889174461365,
173
+ "rewards/margins": 0.14314329624176025,
174
+ "rewards/rejected": -0.44598227739334106,
175
+ "step": 100
176
+ },
177
+ {
178
+ "epoch": 0.07248346470961312,
179
+ "eval_logits/chosen": -2.12322735786438,
180
+ "eval_logits/rejected": -2.481174945831299,
181
+ "eval_logps/chosen": -0.2438412606716156,
182
+ "eval_logps/rejected": -0.3260033428668976,
183
+ "eval_loss": 0.891861081123352,
184
+ "eval_rewards/accuracies": 0.5625,
185
+ "eval_rewards/chosen": -0.3657619059085846,
186
+ "eval_rewards/margins": 0.12324309349060059,
187
+ "eval_rewards/rejected": -0.48900502920150757,
188
+ "eval_runtime": 30.3299,
189
+ "eval_samples_per_second": 29.41,
190
+ "eval_steps_per_second": 3.693,
191
+ "step": 100
192
+ },
193
+ {
194
+ "epoch": 0.07973181118057443,
195
+ "grad_norm": 0.05962231010198593,
196
+ "learning_rate": 4.933947257182901e-06,
197
+ "logits/chosen": -2.1134355068206787,
198
+ "logits/rejected": -2.516538381576538,
199
+ "logps/chosen": -0.237023264169693,
200
+ "logps/rejected": -0.31476154923439026,
201
+ "loss": 7.1749,
202
+ "rewards/accuracies": 0.550000011920929,
203
+ "rewards/chosen": -0.3555349111557007,
204
+ "rewards/margins": 0.11660744249820709,
205
+ "rewards/rejected": -0.4721423089504242,
206
+ "step": 110
207
+ },
208
+ {
209
+ "epoch": 0.08698015765153574,
210
+ "grad_norm": 0.06015922501683235,
211
+ "learning_rate": 4.921457902821578e-06,
212
+ "logits/chosen": -2.0215041637420654,
213
+ "logits/rejected": -2.4902031421661377,
214
+ "logps/chosen": -0.1890055537223816,
215
+ "logps/rejected": -0.3192065358161926,
216
+ "loss": 7.142,
217
+ "rewards/accuracies": 0.637499988079071,
218
+ "rewards/chosen": -0.2835083603858948,
219
+ "rewards/margins": 0.19530144333839417,
220
+ "rewards/rejected": -0.47880974411964417,
221
+ "step": 120
222
+ },
223
+ {
224
+ "epoch": 0.09422850412249706,
225
+ "grad_norm": 0.06430571526288986,
226
+ "learning_rate": 4.907906416994146e-06,
227
+ "logits/chosen": -2.0684752464294434,
228
+ "logits/rejected": -2.510018825531006,
229
+ "logps/chosen": -0.2073744535446167,
230
+ "logps/rejected": -0.3121300935745239,
231
+ "loss": 7.1438,
232
+ "rewards/accuracies": 0.612500011920929,
233
+ "rewards/chosen": -0.31106168031692505,
234
+ "rewards/margins": 0.15713343024253845,
235
+ "rewards/rejected": -0.4681951403617859,
236
+ "step": 130
237
+ },
238
+ {
239
+ "epoch": 0.10147685059345837,
240
+ "grad_norm": 0.08829955011606216,
241
+ "learning_rate": 4.893298743830168e-06,
242
+ "logits/chosen": -2.026458263397217,
243
+ "logits/rejected": -2.496157646179199,
244
+ "logps/chosen": -0.19946983456611633,
245
+ "logps/rejected": -0.32050156593322754,
246
+ "loss": 7.1196,
247
+ "rewards/accuracies": 0.625,
248
+ "rewards/chosen": -0.2992047667503357,
249
+ "rewards/margins": 0.18154758214950562,
250
+ "rewards/rejected": -0.4807523787021637,
251
+ "step": 140
252
+ },
253
+ {
254
+ "epoch": 0.10872519706441967,
255
+ "grad_norm": 0.09773921221494675,
256
+ "learning_rate": 4.8776412907378845e-06,
257
+ "logits/chosen": -2.101029872894287,
258
+ "logits/rejected": -2.5849032402038574,
259
+ "logps/chosen": -0.18889756500720978,
260
+ "logps/rejected": -0.36427801847457886,
261
+ "loss": 7.1227,
262
+ "rewards/accuracies": 0.6499999761581421,
263
+ "rewards/chosen": -0.28334635496139526,
264
+ "rewards/margins": 0.26307064294815063,
265
+ "rewards/rejected": -0.5464169979095459,
266
+ "step": 150
267
+ },
268
+ {
269
+ "epoch": 0.10872519706441967,
270
+ "eval_logits/chosen": -2.1945455074310303,
271
+ "eval_logits/rejected": -2.559415578842163,
272
+ "eval_logps/chosen": -0.22209034860134125,
273
+ "eval_logps/rejected": -0.32476040720939636,
274
+ "eval_loss": 0.8760393261909485,
275
+ "eval_rewards/accuracies": 0.5803571343421936,
276
+ "eval_rewards/chosen": -0.33313554525375366,
277
+ "eval_rewards/margins": 0.15400508046150208,
278
+ "eval_rewards/rejected": -0.48714062571525574,
279
+ "eval_runtime": 30.3484,
280
+ "eval_samples_per_second": 29.392,
281
+ "eval_steps_per_second": 3.69,
282
+ "step": 150
283
+ },
284
+ {
285
+ "epoch": 0.11597354353538099,
286
+ "grad_norm": 0.09142427891492844,
287
+ "learning_rate": 4.860940925593703e-06,
288
+ "logits/chosen": -2.235069751739502,
289
+ "logits/rejected": -2.5513346195220947,
290
+ "logps/chosen": -0.19598741829395294,
291
+ "logps/rejected": -0.2772120535373688,
292
+ "loss": 7.0272,
293
+ "rewards/accuracies": 0.5375000238418579,
294
+ "rewards/chosen": -0.2939811050891876,
295
+ "rewards/margins": 0.12183700501918793,
296
+ "rewards/rejected": -0.41581812500953674,
297
+ "step": 160
298
+ },
299
+ {
300
+ "epoch": 0.1232218900063423,
301
+ "grad_norm": 0.11735275387763977,
302
+ "learning_rate": 4.84320497372973e-06,
303
+ "logits/chosen": -2.154263496398926,
304
+ "logits/rejected": -2.512010335922241,
305
+ "logps/chosen": -0.1798369437456131,
306
+ "logps/rejected": -0.30910637974739075,
307
+ "loss": 7.1603,
308
+ "rewards/accuracies": 0.637499988079071,
309
+ "rewards/chosen": -0.26975542306900024,
310
+ "rewards/margins": 0.19390416145324707,
311
+ "rewards/rejected": -0.4636595845222473,
312
+ "step": 170
313
+ },
314
+ {
315
+ "epoch": 0.1304702364773036,
316
+ "grad_norm": 0.09398588538169861,
317
+ "learning_rate": 4.824441214720629e-06,
318
+ "logits/chosen": -2.292147159576416,
319
+ "logits/rejected": -2.581425189971924,
320
+ "logps/chosen": -0.18498703837394714,
321
+ "logps/rejected": -0.31237050890922546,
322
+ "loss": 6.995,
323
+ "rewards/accuracies": 0.637499988079071,
324
+ "rewards/chosen": -0.2774805426597595,
325
+ "rewards/margins": 0.19107523560523987,
326
+ "rewards/rejected": -0.4685557782649994,
327
+ "step": 180
328
+ },
329
+ {
330
+ "epoch": 0.13771858294826492,
331
+ "grad_norm": 0.13551996648311615,
332
+ "learning_rate": 4.804657878971252e-06,
333
+ "logits/chosen": -2.274120330810547,
334
+ "logits/rejected": -2.5797386169433594,
335
+ "logps/chosen": -0.21168990433216095,
336
+ "logps/rejected": -0.34927254915237427,
337
+ "loss": 6.9941,
338
+ "rewards/accuracies": 0.5874999761581421,
339
+ "rewards/chosen": -0.317534863948822,
340
+ "rewards/margins": 0.20637397468090057,
341
+ "rewards/rejected": -0.5239088535308838,
342
+ "step": 190
343
+ },
344
+ {
345
+ "epoch": 0.14496692941922623,
346
+ "grad_norm": 0.15515944361686707,
347
+ "learning_rate": 4.783863644106502e-06,
348
+ "logits/chosen": -2.2116379737854004,
349
+ "logits/rejected": -2.6693203449249268,
350
+ "logps/chosen": -0.1971816122531891,
351
+ "logps/rejected": -0.3498842120170593,
352
+ "loss": 7.0413,
353
+ "rewards/accuracies": 0.6499999761581421,
354
+ "rewards/chosen": -0.2957724332809448,
355
+ "rewards/margins": 0.22905388474464417,
356
+ "rewards/rejected": -0.5248263478279114,
357
+ "step": 200
358
+ },
359
+ {
360
+ "epoch": 0.14496692941922623,
361
+ "eval_logits/chosen": -2.3369696140289307,
362
+ "eval_logits/rejected": -2.7298672199249268,
363
+ "eval_logps/chosen": -0.22749511897563934,
364
+ "eval_logps/rejected": -0.3613782525062561,
365
+ "eval_loss": 0.8543878793716431,
366
+ "eval_rewards/accuracies": 0.5714285969734192,
367
+ "eval_rewards/chosen": -0.34124264121055603,
368
+ "eval_rewards/margins": 0.2008247673511505,
369
+ "eval_rewards/rejected": -0.5420674681663513,
370
+ "eval_runtime": 30.3397,
371
+ "eval_samples_per_second": 29.4,
372
+ "eval_steps_per_second": 3.692,
373
+ "step": 200
374
+ },
375
+ {
376
+ "epoch": 0.15221527589018755,
377
+ "grad_norm": 0.13039635121822357,
378
+ "learning_rate": 4.762067631165049e-06,
379
+ "logits/chosen": -2.2575619220733643,
380
+ "logits/rejected": -2.755174160003662,
381
+ "logps/chosen": -0.199218288064003,
382
+ "logps/rejected": -0.33260637521743774,
383
+ "loss": 6.882,
384
+ "rewards/accuracies": 0.5874999761581421,
385
+ "rewards/chosen": -0.2988274097442627,
386
+ "rewards/margins": 0.20008206367492676,
387
+ "rewards/rejected": -0.49890947341918945,
388
+ "step": 210
389
+ },
390
+ {
391
+ "epoch": 0.15946362236114886,
392
+ "grad_norm": 0.15020275115966797,
393
+ "learning_rate": 4.7392794005985324e-06,
394
+ "logits/chosen": -2.2949752807617188,
395
+ "logits/rejected": -2.7288482189178467,
396
+ "logps/chosen": -0.21987763047218323,
397
+ "logps/rejected": -0.385539174079895,
398
+ "loss": 6.9158,
399
+ "rewards/accuracies": 0.699999988079071,
400
+ "rewards/chosen": -0.3298164904117584,
401
+ "rewards/margins": 0.24849233031272888,
402
+ "rewards/rejected": -0.5783087611198425,
403
+ "step": 220
404
+ },
405
+ {
406
+ "epoch": 0.16671196883211017,
407
+ "grad_norm": 0.16104522347450256,
408
+ "learning_rate": 4.715508948078037e-06,
409
+ "logits/chosen": -2.1837964057922363,
410
+ "logits/rejected": -2.813563585281372,
411
+ "logps/chosen": -0.2069036215543747,
412
+ "logps/rejected": -0.3996518552303314,
413
+ "loss": 6.8503,
414
+ "rewards/accuracies": 0.699999988079071,
415
+ "rewards/chosen": -0.31035539507865906,
416
+ "rewards/margins": 0.28912240266799927,
417
+ "rewards/rejected": -0.5994777679443359,
418
+ "step": 230
419
+ },
420
+ {
421
+ "epoch": 0.1739603153030715,
422
+ "grad_norm": 0.16533692181110382,
423
+ "learning_rate": 4.690766700109659e-06,
424
+ "logits/chosen": -2.314570188522339,
425
+ "logits/rejected": -2.8867621421813965,
426
+ "logps/chosen": -0.18964803218841553,
427
+ "logps/rejected": -0.3997463583946228,
428
+ "loss": 6.667,
429
+ "rewards/accuracies": 0.6499999761581421,
430
+ "rewards/chosen": -0.2844720482826233,
431
+ "rewards/margins": 0.3151474893093109,
432
+ "rewards/rejected": -0.5996195077896118,
433
+ "step": 240
434
+ },
435
+ {
436
+ "epoch": 0.1812086617740328,
437
+ "grad_norm": 0.24991220235824585,
438
+ "learning_rate": 4.665063509461098e-06,
439
+ "logits/chosen": -2.46189546585083,
440
+ "logits/rejected": -2.847446918487549,
441
+ "logps/chosen": -0.24189543724060059,
442
+ "logps/rejected": -0.4183991551399231,
443
+ "loss": 6.7146,
444
+ "rewards/accuracies": 0.5625,
445
+ "rewards/chosen": -0.3628431558609009,
446
+ "rewards/margins": 0.26475557684898376,
447
+ "rewards/rejected": -0.6275987029075623,
448
+ "step": 250
449
+ },
450
+ {
451
+ "epoch": 0.1812086617740328,
452
+ "eval_logits/chosen": -2.5230772495269775,
453
+ "eval_logits/rejected": -2.9182300567626953,
454
+ "eval_logps/chosen": -0.2819940149784088,
455
+ "eval_logps/rejected": -0.48641347885131836,
456
+ "eval_loss": 0.8070082664489746,
457
+ "eval_rewards/accuracies": 0.5803571343421936,
458
+ "eval_rewards/chosen": -0.4229910671710968,
459
+ "eval_rewards/margins": 0.3066291809082031,
460
+ "eval_rewards/rejected": -0.7296201586723328,
461
+ "eval_runtime": 30.3523,
462
+ "eval_samples_per_second": 29.388,
463
+ "eval_steps_per_second": 3.69,
464
+ "step": 250
465
+ },
466
+ {
467
+ "epoch": 0.18845700824499412,
468
+ "grad_norm": 0.3010155260562897,
469
+ "learning_rate": 4.638410650401267e-06,
470
+ "logits/chosen": -2.4178171157836914,
471
+ "logits/rejected": -2.914424419403076,
472
+ "logps/chosen": -0.24933743476867676,
473
+ "logps/rejected": -0.4757954478263855,
474
+ "loss": 6.5743,
475
+ "rewards/accuracies": 0.637499988079071,
476
+ "rewards/chosen": -0.3740061819553375,
477
+ "rewards/margins": 0.33968693017959595,
478
+ "rewards/rejected": -0.7136931419372559,
479
+ "step": 260
480
+ },
481
+ {
482
+ "epoch": 0.19570535471595543,
483
+ "grad_norm": 0.3765665888786316,
484
+ "learning_rate": 4.610819813755038e-06,
485
+ "logits/chosen": -2.407275676727295,
486
+ "logits/rejected": -2.886014938354492,
487
+ "logps/chosen": -0.27837619185447693,
488
+ "logps/rejected": -0.6118712425231934,
489
+ "loss": 6.4931,
490
+ "rewards/accuracies": 0.5874999761581421,
491
+ "rewards/chosen": -0.417564332485199,
492
+ "rewards/margins": 0.5002425909042358,
493
+ "rewards/rejected": -0.9178068041801453,
494
+ "step": 270
495
+ },
496
+ {
497
+ "epoch": 0.20295370118691675,
498
+ "grad_norm": 0.29865291714668274,
499
+ "learning_rate": 4.582303101775249e-06,
500
+ "logits/chosen": -2.5404791831970215,
501
+ "logits/rejected": -2.861341953277588,
502
+ "logps/chosen": -0.3124132752418518,
503
+ "logps/rejected": -0.558597207069397,
504
+ "loss": 6.2272,
505
+ "rewards/accuracies": 0.550000011920929,
506
+ "rewards/chosen": -0.4686199128627777,
507
+ "rewards/margins": 0.3692759573459625,
508
+ "rewards/rejected": -0.8378958702087402,
509
+ "step": 280
510
+ },
511
+ {
512
+ "epoch": 0.21020204765787803,
513
+ "grad_norm": 0.4311545789241791,
514
+ "learning_rate": 4.55287302283426e-06,
515
+ "logits/chosen": -2.393683910369873,
516
+ "logits/rejected": -2.833466053009033,
517
+ "logps/chosen": -0.3574284017086029,
518
+ "logps/rejected": -0.8571383357048035,
519
+ "loss": 5.7937,
520
+ "rewards/accuracies": 0.7124999761581421,
521
+ "rewards/chosen": -0.5361425876617432,
522
+ "rewards/margins": 0.7495648264884949,
523
+ "rewards/rejected": -1.2857074737548828,
524
+ "step": 290
525
+ },
526
+ {
527
+ "epoch": 0.21745039412883935,
528
+ "grad_norm": 0.7148597836494446,
529
+ "learning_rate": 4.522542485937369e-06,
530
+ "logits/chosen": -2.369452476501465,
531
+ "logits/rejected": -2.7431299686431885,
532
+ "logps/chosen": -0.46852874755859375,
533
+ "logps/rejected": -0.9673423767089844,
534
+ "loss": 5.741,
535
+ "rewards/accuracies": 0.6875,
536
+ "rewards/chosen": -0.7027931213378906,
537
+ "rewards/margins": 0.7482204437255859,
538
+ "rewards/rejected": -1.4510136842727661,
539
+ "step": 300
540
+ },
541
+ {
542
+ "epoch": 0.21745039412883935,
543
+ "eval_logits/chosen": -2.5259616374969482,
544
+ "eval_logits/rejected": -2.8154189586639404,
545
+ "eval_logps/chosen": -0.5109023451805115,
546
+ "eval_logps/rejected": -0.9421015381813049,
547
+ "eval_loss": 0.6990054845809937,
548
+ "eval_rewards/accuracies": 0.5714285969734192,
549
+ "eval_rewards/chosen": -0.7663536071777344,
550
+ "eval_rewards/margins": 0.6467987895011902,
551
+ "eval_rewards/rejected": -1.4131524562835693,
552
+ "eval_runtime": 30.3501,
553
+ "eval_samples_per_second": 29.39,
554
+ "eval_steps_per_second": 3.69,
555
+ "step": 300
556
+ },
557
+ {
558
+ "epoch": 0.22469874059980066,
559
+ "grad_norm": 0.37795087695121765,
560
+ "learning_rate": 4.491324795060491e-06,
561
+ "logits/chosen": -2.5089354515075684,
562
+ "logits/rejected": -2.827730894088745,
563
+ "logps/chosen": -0.4125432074069977,
564
+ "logps/rejected": -1.0391974449157715,
565
+ "loss": 5.3005,
566
+ "rewards/accuracies": 0.625,
567
+ "rewards/chosen": -0.6188148260116577,
568
+ "rewards/margins": 0.9399812817573547,
569
+ "rewards/rejected": -1.5587961673736572,
570
+ "step": 310
571
+ },
572
+ {
573
+ "epoch": 0.23194708707076198,
574
+ "grad_norm": 0.38493892550468445,
575
+ "learning_rate": 4.4592336433146e-06,
576
+ "logits/chosen": -2.3596529960632324,
577
+ "logits/rejected": -2.8088250160217285,
578
+ "logps/chosen": -0.5338706970214844,
579
+ "logps/rejected": -1.2868502140045166,
580
+ "loss": 5.2832,
581
+ "rewards/accuracies": 0.6625000238418579,
582
+ "rewards/chosen": -0.8008060455322266,
583
+ "rewards/margins": 1.1294692754745483,
584
+ "rewards/rejected": -1.930275321006775,
585
+ "step": 320
586
+ },
587
+ {
588
+ "epoch": 0.2391954335417233,
589
+ "grad_norm": 0.6237270832061768,
590
+ "learning_rate": 4.426283106939474e-06,
591
+ "logits/chosen": -2.5265612602233887,
592
+ "logits/rejected": -2.7830424308776855,
593
+ "logps/chosen": -0.6278705596923828,
594
+ "logps/rejected": -1.4297993183135986,
595
+ "loss": 5.1977,
596
+ "rewards/accuracies": 0.6875,
597
+ "rewards/chosen": -0.9418058395385742,
598
+ "rewards/margins": 1.2028930187225342,
599
+ "rewards/rejected": -2.1446988582611084,
600
+ "step": 330
601
+ },
602
+ {
603
+ "epoch": 0.2464437800126846,
604
+ "grad_norm": 0.9095363020896912,
605
+ "learning_rate": 4.3924876391293915e-06,
606
+ "logits/chosen": -2.5918514728546143,
607
+ "logits/rejected": -2.8718667030334473,
608
+ "logps/chosen": -0.6412171125411987,
609
+ "logps/rejected": -1.508195161819458,
610
+ "loss": 4.7181,
611
+ "rewards/accuracies": 0.625,
612
+ "rewards/chosen": -0.9618256688117981,
613
+ "rewards/margins": 1.3004668951034546,
614
+ "rewards/rejected": -2.2622926235198975,
615
+ "step": 340
616
+ },
617
+ {
618
+ "epoch": 0.2536921264836459,
619
+ "grad_norm": 0.6144569516181946,
620
+ "learning_rate": 4.357862063693486e-06,
621
+ "logits/chosen": -2.492586612701416,
622
+ "logits/rejected": -2.9216372966766357,
623
+ "logps/chosen": -0.7246330976486206,
624
+ "logps/rejected": -2.0466060638427734,
625
+ "loss": 4.6111,
626
+ "rewards/accuracies": 0.675000011920929,
627
+ "rewards/chosen": -1.0869497060775757,
628
+ "rewards/margins": 1.9829593896865845,
629
+ "rewards/rejected": -3.06990909576416,
630
+ "step": 350
631
+ },
632
+ {
633
+ "epoch": 0.2536921264836459,
634
+ "eval_logits/chosen": -2.7258641719818115,
635
+ "eval_logits/rejected": -2.9883599281311035,
636
+ "eval_logps/chosen": -0.7502545118331909,
637
+ "eval_logps/rejected": -1.7796010971069336,
638
+ "eval_loss": 0.571855366230011,
639
+ "eval_rewards/accuracies": 0.5892857313156128,
640
+ "eval_rewards/chosen": -1.1253817081451416,
641
+ "eval_rewards/margins": 1.5440199375152588,
642
+ "eval_rewards/rejected": -2.6694016456604004,
643
+ "eval_runtime": 30.3197,
644
+ "eval_samples_per_second": 29.42,
645
+ "eval_steps_per_second": 3.694,
646
+ "step": 350
647
+ },
648
+ {
649
+ "epoch": 0.2609404729546072,
650
+ "grad_norm": 0.6816007494926453,
651
+ "learning_rate": 4.322421568553529e-06,
652
+ "logits/chosen": -2.6618990898132324,
653
+ "logits/rejected": -2.9197638034820557,
654
+ "logps/chosen": -0.7783921360969543,
655
+ "logps/rejected": -1.9845831394195557,
656
+ "loss": 4.8991,
657
+ "rewards/accuracies": 0.6625000238418579,
658
+ "rewards/chosen": -1.1675881147384644,
659
+ "rewards/margins": 1.8092864751815796,
660
+ "rewards/rejected": -2.976874589920044,
661
+ "step": 360
662
+ },
663
+ {
664
+ "epoch": 0.26818881942556855,
665
+ "grad_norm": 0.5186926126480103,
666
+ "learning_rate": 4.286181699082008e-06,
667
+ "logits/chosen": -2.690049171447754,
668
+ "logits/rejected": -2.9129927158355713,
669
+ "logps/chosen": -0.7160422205924988,
670
+ "logps/rejected": -2.097799777984619,
671
+ "loss": 4.6471,
672
+ "rewards/accuracies": 0.637499988079071,
673
+ "rewards/chosen": -1.0740633010864258,
674
+ "rewards/margins": 2.0726354122161865,
675
+ "rewards/rejected": -3.1466989517211914,
676
+ "step": 370
677
+ },
678
+ {
679
+ "epoch": 0.27543716589652983,
680
+ "grad_norm": 0.7122822403907776,
681
+ "learning_rate": 4.249158351283414e-06,
682
+ "logits/chosen": -2.6984095573425293,
683
+ "logits/rejected": -2.8411834239959717,
684
+ "logps/chosen": -0.724581778049469,
685
+ "logps/rejected": -2.1322455406188965,
686
+ "loss": 4.4326,
687
+ "rewards/accuracies": 0.637499988079071,
688
+ "rewards/chosen": -1.0868725776672363,
689
+ "rewards/margins": 2.1114957332611084,
690
+ "rewards/rejected": -3.198368549346924,
691
+ "step": 380
692
+ },
693
+ {
694
+ "epoch": 0.2826855123674912,
695
+ "grad_norm": 0.610661506652832,
696
+ "learning_rate": 4.211367764821722e-06,
697
+ "logits/chosen": -2.5932717323303223,
698
+ "logits/rejected": -2.855365514755249,
699
+ "logps/chosen": -0.6430361866950989,
700
+ "logps/rejected": -2.8457767963409424,
701
+ "loss": 4.3874,
702
+ "rewards/accuracies": 0.824999988079071,
703
+ "rewards/chosen": -0.9645543098449707,
704
+ "rewards/margins": 3.3041110038757324,
705
+ "rewards/rejected": -4.268665313720703,
706
+ "step": 390
707
+ },
708
+ {
709
+ "epoch": 0.28993385883845246,
710
+ "grad_norm": 0.627453088760376,
711
+ "learning_rate": 4.172826515897146e-06,
712
+ "logits/chosen": -2.46079683303833,
713
+ "logits/rejected": -2.839109182357788,
714
+ "logps/chosen": -0.8076715469360352,
715
+ "logps/rejected": -2.6943671703338623,
716
+ "loss": 4.2388,
717
+ "rewards/accuracies": 0.6875,
718
+ "rewards/chosen": -1.2115072011947632,
719
+ "rewards/margins": 2.8300435543060303,
720
+ "rewards/rejected": -4.041550636291504,
721
+ "step": 400
722
+ },
723
+ {
724
+ "epoch": 0.28993385883845246,
725
+ "eval_logits/chosen": -2.5736935138702393,
726
+ "eval_logits/rejected": -2.8549301624298096,
727
+ "eval_logps/chosen": -0.8027606010437012,
728
+ "eval_logps/rejected": -2.407195568084717,
729
+ "eval_loss": 0.49557629227638245,
730
+ "eval_rewards/accuracies": 0.6071428656578064,
731
+ "eval_rewards/chosen": -1.2041409015655518,
732
+ "eval_rewards/margins": 2.4066522121429443,
733
+ "eval_rewards/rejected": -3.6107935905456543,
734
+ "eval_runtime": 30.3144,
735
+ "eval_samples_per_second": 29.425,
736
+ "eval_steps_per_second": 3.695,
737
+ "step": 400
738
+ },
739
+ {
740
+ "epoch": 0.2971822053094138,
741
+ "grad_norm": 0.582290768623352,
742
+ "learning_rate": 4.133551509975264e-06,
743
+ "logits/chosen": -2.5232419967651367,
744
+ "logits/rejected": -2.8139169216156006,
745
+ "logps/chosen": -0.7921724319458008,
746
+ "logps/rejected": -2.5887393951416016,
747
+ "loss": 3.9161,
748
+ "rewards/accuracies": 0.7124999761581421,
749
+ "rewards/chosen": -1.1882586479187012,
750
+ "rewards/margins": 2.694850206375122,
751
+ "rewards/rejected": -3.883108615875244,
752
+ "step": 410
753
+ },
754
+ {
755
+ "epoch": 0.3044305517803751,
756
+ "grad_norm": 1.0708731412887573,
757
+ "learning_rate": 4.093559974371725e-06,
758
+ "logits/chosen": -2.402315616607666,
759
+ "logits/rejected": -2.6774837970733643,
760
+ "logps/chosen": -0.9347984194755554,
761
+ "logps/rejected": -3.4818978309631348,
762
+ "loss": 3.8304,
763
+ "rewards/accuracies": 0.762499988079071,
764
+ "rewards/chosen": -1.4021978378295898,
765
+ "rewards/margins": 3.8206489086151123,
766
+ "rewards/rejected": -5.222846508026123,
767
+ "step": 420
768
+ },
769
+ {
770
+ "epoch": 0.31167889825133643,
771
+ "grad_norm": 0.6126013398170471,
772
+ "learning_rate": 4.052869450695776e-06,
773
+ "logits/chosen": -2.4616169929504395,
774
+ "logits/rejected": -2.791163921356201,
775
+ "logps/chosen": -1.073099970817566,
776
+ "logps/rejected": -3.7586822509765625,
777
+ "loss": 3.7662,
778
+ "rewards/accuracies": 0.7250000238418579,
779
+ "rewards/chosen": -1.609649896621704,
780
+ "rewards/margins": 4.028374671936035,
781
+ "rewards/rejected": -5.63802433013916,
782
+ "step": 430
783
+ },
784
+ {
785
+ "epoch": 0.3189272447222977,
786
+ "grad_norm": 0.6995553374290466,
787
+ "learning_rate": 4.011497787155938e-06,
788
+ "logits/chosen": -2.350310802459717,
789
+ "logits/rejected": -2.750123977661133,
790
+ "logps/chosen": -1.2352540493011475,
791
+ "logps/rejected": -4.180838584899902,
792
+ "loss": 3.4493,
793
+ "rewards/accuracies": 0.7749999761581421,
794
+ "rewards/chosen": -1.852880835533142,
795
+ "rewards/margins": 4.418376922607422,
796
+ "rewards/rejected": -6.271258354187012,
797
+ "step": 440
798
+ },
799
+ {
800
+ "epoch": 0.32617559119325906,
801
+ "grad_norm": 0.7922266721725464,
802
+ "learning_rate": 3.969463130731183e-06,
803
+ "logits/chosen": -2.368863344192505,
804
+ "logits/rejected": -2.7451913356781006,
805
+ "logps/chosen": -1.0907175540924072,
806
+ "logps/rejected": -4.085494041442871,
807
+ "loss": 4.0187,
808
+ "rewards/accuracies": 0.8125,
809
+ "rewards/chosen": -1.6360763311386108,
810
+ "rewards/margins": 4.4921650886535645,
811
+ "rewards/rejected": -6.128241062164307,
812
+ "step": 450
813
+ },
814
+ {
815
+ "epoch": 0.32617559119325906,
816
+ "eval_logits/chosen": -2.44749116897583,
817
+ "eval_logits/rejected": -2.7382781505584717,
818
+ "eval_logps/chosen": -1.3378121852874756,
819
+ "eval_logps/rejected": -3.6518471240997314,
820
+ "eval_loss": 0.45260879397392273,
821
+ "eval_rewards/accuracies": 0.6428571343421936,
822
+ "eval_rewards/chosen": -2.006718158721924,
823
+ "eval_rewards/margins": 3.4710519313812256,
824
+ "eval_rewards/rejected": -5.4777703285217285,
825
+ "eval_runtime": 30.3269,
826
+ "eval_samples_per_second": 29.413,
827
+ "eval_steps_per_second": 3.693,
828
+ "step": 450
829
+ },
830
+ {
831
+ "epoch": 0.33342393766422035,
832
+ "grad_norm": 0.7150818109512329,
833
+ "learning_rate": 3.92678391921108e-06,
834
+ "logits/chosen": -2.4681639671325684,
835
+ "logits/rejected": -2.797795057296753,
836
+ "logps/chosen": -1.4199602603912354,
837
+ "logps/rejected": -4.342296600341797,
838
+ "loss": 3.5788,
839
+ "rewards/accuracies": 0.7124999761581421,
840
+ "rewards/chosen": -2.1299405097961426,
841
+ "rewards/margins": 4.3835039138793945,
842
+ "rewards/rejected": -6.513444423675537,
843
+ "step": 460
844
+ },
845
+ {
846
+ "epoch": 0.34067228413518164,
847
+ "grad_norm": 1.260711431503296,
848
+ "learning_rate": 3.88347887310836e-06,
849
+ "logits/chosen": -2.4320380687713623,
850
+ "logits/rejected": -2.749352216720581,
851
+ "logps/chosen": -1.318566918373108,
852
+ "logps/rejected": -3.7736339569091797,
853
+ "loss": 3.5681,
854
+ "rewards/accuracies": 0.75,
855
+ "rewards/chosen": -1.977850317955017,
856
+ "rewards/margins": 3.682600498199463,
857
+ "rewards/rejected": -5.6604509353637695,
858
+ "step": 470
859
+ },
860
+ {
861
+ "epoch": 0.347920630606143,
862
+ "grad_norm": 0.9010512828826904,
863
+ "learning_rate": 3.839566987447492e-06,
864
+ "logits/chosen": -2.3840298652648926,
865
+ "logits/rejected": -2.7868971824645996,
866
+ "logps/chosen": -1.6358540058135986,
867
+ "logps/rejected": -5.068122386932373,
868
+ "loss": 3.2884,
869
+ "rewards/accuracies": 0.862500011920929,
870
+ "rewards/chosen": -2.4537811279296875,
871
+ "rewards/margins": 5.148402690887451,
872
+ "rewards/rejected": -7.602184295654297,
873
+ "step": 480
874
+ },
875
+ {
876
+ "epoch": 0.35516897707710426,
877
+ "grad_norm": 0.4977961778640747,
878
+ "learning_rate": 3.795067523432826e-06,
879
+ "logits/chosen": -2.4045886993408203,
880
+ "logits/rejected": -2.813812494277954,
881
+ "logps/chosen": -1.5761570930480957,
882
+ "logps/rejected": -5.026966094970703,
883
+ "loss": 3.5505,
884
+ "rewards/accuracies": 0.7749999761581421,
885
+ "rewards/chosen": -2.3642354011535645,
886
+ "rewards/margins": 5.176213264465332,
887
+ "rewards/rejected": -7.5404486656188965,
888
+ "step": 490
889
+ },
890
+ {
891
+ "epoch": 0.3624173235480656,
892
+ "grad_norm": 0.9888324737548828,
893
+ "learning_rate": 3.7500000000000005e-06,
894
+ "logits/chosen": -2.4877827167510986,
895
+ "logits/rejected": -2.7923107147216797,
896
+ "logps/chosen": -2.0706987380981445,
897
+ "logps/rejected": -5.011548042297363,
898
+ "loss": 3.3992,
899
+ "rewards/accuracies": 0.800000011920929,
900
+ "rewards/chosen": -3.106048107147217,
901
+ "rewards/margins": 4.411273002624512,
902
+ "rewards/rejected": -7.517321586608887,
903
+ "step": 500
904
+ },
905
+ {
906
+ "epoch": 0.3624173235480656,
907
+ "eval_logits/chosen": -2.5850253105163574,
908
+ "eval_logits/rejected": -2.898167133331299,
909
+ "eval_logps/chosen": -2.3814480304718018,
910
+ "eval_logps/rejected": -5.132807731628418,
911
+ "eval_loss": 0.40332508087158203,
912
+ "eval_rewards/accuracies": 0.7142857313156128,
913
+ "eval_rewards/chosen": -3.572171926498413,
914
+ "eval_rewards/margins": 4.127039432525635,
915
+ "eval_rewards/rejected": -7.699211597442627,
916
+ "eval_runtime": 30.324,
917
+ "eval_samples_per_second": 29.416,
918
+ "eval_steps_per_second": 3.693,
919
+ "step": 500
920
+ },
921
+ {
922
+ "epoch": 0.3696656700190269,
923
+ "grad_norm": 0.9108109474182129,
924
+ "learning_rate": 3.7043841852542884e-06,
925
+ "logits/chosen": -2.4516501426696777,
926
+ "logits/rejected": -2.863548755645752,
927
+ "logps/chosen": -2.235166549682617,
928
+ "logps/rejected": -5.824828147888184,
929
+ "loss": 3.2045,
930
+ "rewards/accuracies": 0.824999988079071,
931
+ "rewards/chosen": -3.352750301361084,
932
+ "rewards/margins": 5.384493350982666,
933
+ "rewards/rejected": -8.737241744995117,
934
+ "step": 510
935
+ },
936
+ {
937
+ "epoch": 0.37691401648998824,
938
+ "grad_norm": 1.608782410621643,
939
+ "learning_rate": 3.658240087799655e-06,
940
+ "logits/chosen": -2.448782444000244,
941
+ "logits/rejected": -2.9055087566375732,
942
+ "logps/chosen": -2.345585584640503,
943
+ "logps/rejected": -5.665570259094238,
944
+ "loss": 3.2997,
945
+ "rewards/accuracies": 0.9125000238418579,
946
+ "rewards/chosen": -3.518378496170044,
947
+ "rewards/margins": 4.979977130889893,
948
+ "rewards/rejected": -8.498355865478516,
949
+ "step": 520
950
+ },
951
+ {
952
+ "epoch": 0.3841623629609495,
953
+ "grad_norm": 2.4802284240722656,
954
+ "learning_rate": 3.611587947962319e-06,
955
+ "logits/chosen": -2.5400586128234863,
956
+ "logits/rejected": -2.9653382301330566,
957
+ "logps/chosen": -2.9243946075439453,
958
+ "logps/rejected": -7.067171573638916,
959
+ "loss": 2.7084,
960
+ "rewards/accuracies": 0.925000011920929,
961
+ "rewards/chosen": -4.386591911315918,
962
+ "rewards/margins": 6.214165210723877,
963
+ "rewards/rejected": -10.60075569152832,
964
+ "step": 530
965
+ },
966
+ {
967
+ "epoch": 0.39141070943191086,
968
+ "grad_norm": 1.4558824300765991,
969
+ "learning_rate": 3.564448228912682e-06,
970
+ "logits/chosen": -2.538511276245117,
971
+ "logits/rejected": -3.0383963584899902,
972
+ "logps/chosen": -3.83245849609375,
973
+ "logps/rejected": -7.150879859924316,
974
+ "loss": 2.85,
975
+ "rewards/accuracies": 0.8374999761581421,
976
+ "rewards/chosen": -5.748687744140625,
977
+ "rewards/margins": 4.977631568908691,
978
+ "rewards/rejected": -10.726319313049316,
979
+ "step": 540
980
+ },
981
+ {
982
+ "epoch": 0.39865905590287215,
983
+ "grad_norm": 6.12661600112915,
984
+ "learning_rate": 3.516841607689501e-06,
985
+ "logits/chosen": -2.5623717308044434,
986
+ "logits/rejected": -2.930835485458374,
987
+ "logps/chosen": -3.9018759727478027,
988
+ "logps/rejected": -7.186791896820068,
989
+ "loss": 2.6406,
990
+ "rewards/accuracies": 0.875,
991
+ "rewards/chosen": -5.852814674377441,
992
+ "rewards/margins": 4.92737340927124,
993
+ "rewards/rejected": -10.78018856048584,
994
+ "step": 550
995
+ },
996
+ {
997
+ "epoch": 0.39865905590287215,
998
+ "eval_logits/chosen": -2.5746138095855713,
999
+ "eval_logits/rejected": -2.9623827934265137,
1000
+ "eval_logps/chosen": -4.4805707931518555,
1001
+ "eval_logps/rejected": -7.7552666664123535,
1002
+ "eval_loss": 0.30369508266448975,
1003
+ "eval_rewards/accuracies": 0.8660714030265808,
1004
+ "eval_rewards/chosen": -6.720856189727783,
1005
+ "eval_rewards/margins": 4.912044048309326,
1006
+ "eval_rewards/rejected": -11.632901191711426,
1007
+ "eval_runtime": 30.3366,
1008
+ "eval_samples_per_second": 29.403,
1009
+ "eval_steps_per_second": 3.692,
1010
+ "step": 550
1011
+ },
1012
+ {
1013
+ "epoch": 0.4059074023738335,
1014
+ "grad_norm": 2.2883663177490234,
1015
+ "learning_rate": 3.4687889661302577e-06,
1016
+ "logits/chosen": -2.523510456085205,
1017
+ "logits/rejected": -3.0058722496032715,
1018
+ "logps/chosen": -4.60703706741333,
1019
+ "logps/rejected": -8.818490982055664,
1020
+ "loss": 2.1664,
1021
+ "rewards/accuracies": 0.949999988079071,
1022
+ "rewards/chosen": -6.9105544090271,
1023
+ "rewards/margins": 6.3171820640563965,
1024
+ "rewards/rejected": -13.22773551940918,
1025
+ "step": 560
1026
+ },
1027
+ {
1028
+ "epoch": 0.4131557488447948,
1029
+ "grad_norm": 3.3689115047454834,
1030
+ "learning_rate": 3.4203113817116955e-06,
1031
+ "logits/chosen": -2.592515230178833,
1032
+ "logits/rejected": -2.9502272605895996,
1033
+ "logps/chosen": -5.648528099060059,
1034
+ "logps/rejected": -10.127589225769043,
1035
+ "loss": 2.2641,
1036
+ "rewards/accuracies": 0.949999988079071,
1037
+ "rewards/chosen": -8.472792625427246,
1038
+ "rewards/margins": 6.718589782714844,
1039
+ "rewards/rejected": -15.191381454467773,
1040
+ "step": 570
1041
+ },
1042
+ {
1043
+ "epoch": 0.42040409531575607,
1044
+ "grad_norm": 4.080602169036865,
1045
+ "learning_rate": 3.3714301183045382e-06,
1046
+ "logits/chosen": -2.418156862258911,
1047
+ "logits/rejected": -3.0541069507598877,
1048
+ "logps/chosen": -5.756854057312012,
1049
+ "logps/rejected": -11.639761924743652,
1050
+ "loss": 2.3099,
1051
+ "rewards/accuracies": 0.887499988079071,
1052
+ "rewards/chosen": -8.63528060913086,
1053
+ "rewards/margins": 8.82436466217041,
1054
+ "rewards/rejected": -17.459644317626953,
1055
+ "step": 580
1056
+ },
1057
+ {
1058
+ "epoch": 0.4276524417867174,
1059
+ "grad_norm": 1.4410984516143799,
1060
+ "learning_rate": 3.3221666168464584e-06,
1061
+ "logits/chosen": -2.506753921508789,
1062
+ "logits/rejected": -3.029228687286377,
1063
+ "logps/chosen": -6.3516435623168945,
1064
+ "logps/rejected": -11.839346885681152,
1065
+ "loss": 2.0248,
1066
+ "rewards/accuracies": 0.949999988079071,
1067
+ "rewards/chosen": -9.527464866638184,
1068
+ "rewards/margins": 8.231555938720703,
1069
+ "rewards/rejected": -17.75901985168457,
1070
+ "step": 590
1071
+ },
1072
+ {
1073
+ "epoch": 0.4349007882576787,
1074
+ "grad_norm": 3.3688838481903076,
1075
+ "learning_rate": 3.272542485937369e-06,
1076
+ "logits/chosen": -2.4242749214172363,
1077
+ "logits/rejected": -2.9992825984954834,
1078
+ "logps/chosen": -6.2571916580200195,
1079
+ "logps/rejected": -12.356736183166504,
1080
+ "loss": 2.0191,
1081
+ "rewards/accuracies": 0.949999988079071,
1082
+ "rewards/chosen": -9.385787010192871,
1083
+ "rewards/margins": 9.149316787719727,
1084
+ "rewards/rejected": -18.535104751586914,
1085
+ "step": 600
1086
+ },
1087
+ {
1088
+ "epoch": 0.4349007882576787,
1089
+ "eval_logits/chosen": -2.5597894191741943,
1090
+ "eval_logits/rejected": -2.9679033756256104,
1091
+ "eval_logps/chosen": -6.51260232925415,
1092
+ "eval_logps/rejected": -11.510099411010742,
1093
+ "eval_loss": 0.22690872848033905,
1094
+ "eval_rewards/accuracies": 0.9285714030265808,
1095
+ "eval_rewards/chosen": -9.768902778625488,
1096
+ "eval_rewards/margins": 7.496245384216309,
1097
+ "eval_rewards/rejected": -17.26515007019043,
1098
+ "eval_runtime": 30.2947,
1099
+ "eval_samples_per_second": 29.444,
1100
+ "eval_steps_per_second": 3.697,
1101
+ "step": 600
1102
+ },
1103
+ {
1104
+ "epoch": 0.44214913472864004,
1105
+ "grad_norm": 7.5001959800720215,
1106
+ "learning_rate": 3.222579492361179e-06,
1107
+ "logits/chosen": -2.594581127166748,
1108
+ "logits/rejected": -3.0206668376922607,
1109
+ "logps/chosen": -7.0802435874938965,
1110
+ "logps/rejected": -12.667734146118164,
1111
+ "loss": 1.6936,
1112
+ "rewards/accuracies": 0.9375,
1113
+ "rewards/chosen": -10.620367050170898,
1114
+ "rewards/margins": 8.381233215332031,
1115
+ "rewards/rejected": -19.001598358154297,
1116
+ "step": 610
1117
+ },
1118
+ {
1119
+ "epoch": 0.4493974811996013,
1120
+ "grad_norm": 2.639087677001953,
1121
+ "learning_rate": 3.1722995515381644e-06,
1122
+ "logits/chosen": -2.511791229248047,
1123
+ "logits/rejected": -3.0638930797576904,
1124
+ "logps/chosen": -7.493863105773926,
1125
+ "logps/rejected": -14.954449653625488,
1126
+ "loss": 1.6215,
1127
+ "rewards/accuracies": 0.9750000238418579,
1128
+ "rewards/chosen": -11.24079418182373,
1129
+ "rewards/margins": 11.19088363647461,
1130
+ "rewards/rejected": -22.431676864624023,
1131
+ "step": 620
1132
+ },
1133
+ {
1134
+ "epoch": 0.45664582767056267,
1135
+ "grad_norm": 5.2657270431518555,
1136
+ "learning_rate": 3.121724717912138e-06,
1137
+ "logits/chosen": -2.5814051628112793,
1138
+ "logits/rejected": -2.963531017303467,
1139
+ "logps/chosen": -8.267634391784668,
1140
+ "logps/rejected": -14.717096328735352,
1141
+ "loss": 1.7936,
1142
+ "rewards/accuracies": 0.9125000238418579,
1143
+ "rewards/chosen": -12.40145206451416,
1144
+ "rewards/margins": 9.6741943359375,
1145
+ "rewards/rejected": -22.075647354125977,
1146
+ "step": 630
1147
+ },
1148
+ {
1149
+ "epoch": 0.46389417414152395,
1150
+ "grad_norm": 8.628580093383789,
1151
+ "learning_rate": 3.0708771752766397e-06,
1152
+ "logits/chosen": -2.436100482940674,
1153
+ "logits/rejected": -2.9183783531188965,
1154
+ "logps/chosen": -7.733956336975098,
1155
+ "logps/rejected": -15.915423393249512,
1156
+ "loss": 1.7631,
1157
+ "rewards/accuracies": 0.9750000238418579,
1158
+ "rewards/chosen": -11.600934028625488,
1159
+ "rewards/margins": 12.272205352783203,
1160
+ "rewards/rejected": -23.873138427734375,
1161
+ "step": 640
1162
+ },
1163
+ {
1164
+ "epoch": 0.4711425206124853,
1165
+ "grad_norm": 3.072305679321289,
1166
+ "learning_rate": 3.019779227044398e-06,
1167
+ "logits/chosen": -2.4763903617858887,
1168
+ "logits/rejected": -2.9726059436798096,
1169
+ "logps/chosen": -6.810072422027588,
1170
+ "logps/rejected": -13.924298286437988,
1171
+ "loss": 1.5531,
1172
+ "rewards/accuracies": 0.987500011920929,
1173
+ "rewards/chosen": -10.215107917785645,
1174
+ "rewards/margins": 10.671339988708496,
1175
+ "rewards/rejected": -20.88644790649414,
1176
+ "step": 650
1177
+ },
1178
+ {
1179
+ "epoch": 0.4711425206124853,
1180
+ "eval_logits/chosen": -2.459520101547241,
1181
+ "eval_logits/rejected": -2.852581024169922,
1182
+ "eval_logps/chosen": -6.569087028503418,
1183
+ "eval_logps/rejected": -12.969863891601562,
1184
+ "eval_loss": 0.21141496300697327,
1185
+ "eval_rewards/accuracies": 0.9285714030265808,
1186
+ "eval_rewards/chosen": -9.853631019592285,
1187
+ "eval_rewards/margins": 9.601165771484375,
1188
+ "eval_rewards/rejected": -19.454797744750977,
1189
+ "eval_runtime": 30.32,
1190
+ "eval_samples_per_second": 29.42,
1191
+ "eval_steps_per_second": 3.694,
1192
+ "step": 650
1193
+ },
1194
+ {
1195
+ "epoch": 0.4783908670834466,
1196
+ "grad_norm": 3.4517831802368164,
1197
+ "learning_rate": 2.9684532864643123e-06,
1198
+ "logits/chosen": -2.5354456901550293,
1199
+ "logits/rejected": -2.840172290802002,
1200
+ "logps/chosen": -7.238469123840332,
1201
+ "logps/rejected": -14.787511825561523,
1202
+ "loss": 1.3669,
1203
+ "rewards/accuracies": 0.987500011920929,
1204
+ "rewards/chosen": -10.857705116271973,
1205
+ "rewards/margins": 11.323565483093262,
1206
+ "rewards/rejected": -22.181270599365234,
1207
+ "step": 660
1208
+ },
1209
+ {
1210
+ "epoch": 0.4856392135544079,
1211
+ "grad_norm": 8.935027122497559,
1212
+ "learning_rate": 2.9169218667902562e-06,
1213
+ "logits/chosen": -2.47978138923645,
1214
+ "logits/rejected": -2.9299492835998535,
1215
+ "logps/chosen": -7.6814703941345215,
1216
+ "logps/rejected": -15.477340698242188,
1217
+ "loss": 1.8781,
1218
+ "rewards/accuracies": 0.9624999761581421,
1219
+ "rewards/chosen": -11.522205352783203,
1220
+ "rewards/margins": 11.693807601928711,
1221
+ "rewards/rejected": -23.216012954711914,
1222
+ "step": 670
1223
+ },
1224
+ {
1225
+ "epoch": 0.4928875600253692,
1226
+ "grad_norm": 1.7096459865570068,
1227
+ "learning_rate": 2.8652075714060296e-06,
1228
+ "logits/chosen": -2.4414560794830322,
1229
+ "logits/rejected": -2.864112377166748,
1230
+ "logps/chosen": -8.507112503051758,
1231
+ "logps/rejected": -15.909780502319336,
1232
+ "loss": 1.2831,
1233
+ "rewards/accuracies": 0.949999988079071,
1234
+ "rewards/chosen": -12.76066780090332,
1235
+ "rewards/margins": 11.10400104522705,
1236
+ "rewards/rejected": -23.864669799804688,
1237
+ "step": 680
1238
+ },
1239
+ {
1240
+ "epoch": 0.5001359064963306,
1241
+ "grad_norm": 3.814954996109009,
1242
+ "learning_rate": 2.813333083910761e-06,
1243
+ "logits/chosen": -2.4312682151794434,
1244
+ "logits/rejected": -2.993825674057007,
1245
+ "logps/chosen": -8.516946792602539,
1246
+ "logps/rejected": -17.835708618164062,
1247
+ "loss": 1.0306,
1248
+ "rewards/accuracies": 0.9750000238418579,
1249
+ "rewards/chosen": -12.775420188903809,
1250
+ "rewards/margins": 13.978144645690918,
1251
+ "rewards/rejected": -26.75356674194336,
1252
+ "step": 690
1253
+ },
1254
+ {
1255
+ "epoch": 0.5073842529672918,
1256
+ "grad_norm": 6.554664611816406,
1257
+ "learning_rate": 2.761321158169134e-06,
1258
+ "logits/chosen": -2.458709239959717,
1259
+ "logits/rejected": -2.9223692417144775,
1260
+ "logps/chosen": -9.111552238464355,
1261
+ "logps/rejected": -19.193201065063477,
1262
+ "loss": 1.1941,
1263
+ "rewards/accuracies": 0.987500011920929,
1264
+ "rewards/chosen": -13.667327880859375,
1265
+ "rewards/margins": 15.122472763061523,
1266
+ "rewards/rejected": -28.7898006439209,
1267
+ "step": 700
1268
+ },
1269
+ {
1270
+ "epoch": 0.5073842529672918,
1271
+ "eval_logits/chosen": -2.5367431640625,
1272
+ "eval_logits/rejected": -2.9102938175201416,
1273
+ "eval_logps/chosen": -10.25200366973877,
1274
+ "eval_logps/rejected": -17.488019943237305,
1275
+ "eval_loss": 0.1846819519996643,
1276
+ "eval_rewards/accuracies": 0.9285714030265808,
1277
+ "eval_rewards/chosen": -15.378005027770996,
1278
+ "eval_rewards/margins": 10.854025840759277,
1279
+ "eval_rewards/rejected": -26.232030868530273,
1280
+ "eval_runtime": 30.3487,
1281
+ "eval_samples_per_second": 29.392,
1282
+ "eval_steps_per_second": 3.69,
1283
+ "step": 700
1284
+ }
1285
+ ],
1286
+ "logging_steps": 10,
1287
+ "max_steps": 1500,
1288
+ "num_input_tokens_seen": 0,
1289
+ "num_train_epochs": 2,
1290
+ "save_steps": 50,
1291
+ "stateful_callbacks": {
1292
+ "TrainerControl": {
1293
+ "args": {
1294
+ "should_epoch_stop": false,
1295
+ "should_evaluate": false,
1296
+ "should_log": false,
1297
+ "should_save": true,
1298
+ "should_training_stop": false
1299
+ },
1300
+ "attributes": {}
1301
+ }
1302
+ },
1303
+ "total_flos": 2.59563332178228e+18,
1304
+ "train_batch_size": 1,
1305
+ "trial_name": null,
1306
+ "trial_params": null
1307
+ }
checkpoint-700/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91b9d0e6e8c92ae4a2c435b81fedf969ba2fc02907285b004770a8256166d71d
3
+ size 7224
checkpoint-700/zero_to_fp32.py ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example:
14
+ # python zero_to_fp32.py . output_dir/
15
+ # or
16
+ # python zero_to_fp32.py . output_dir/ --safe_serialization
17
+
18
+ import argparse
19
+ import torch
20
+ import glob
21
+ import math
22
+ import os
23
+ import re
24
+ import json
25
+ from tqdm import tqdm
26
+ from collections import OrderedDict
27
+ from dataclasses import dataclass
28
+
29
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
30
+ # DeepSpeed data structures it has to be available in the current python environment.
31
+ from deepspeed.utils import logger
32
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
33
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
34
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
35
+
36
+
37
+ @dataclass
38
+ class zero_model_state:
39
+ buffers: dict()
40
+ param_shapes: dict()
41
+ shared_params: list
42
+ ds_version: int
43
+ frozen_param_shapes: dict()
44
+ frozen_param_fragments: dict()
45
+
46
+
47
+ debug = 0
48
+
49
+ # load to cpu
50
+ device = torch.device('cpu')
51
+
52
+
53
+ def atoi(text):
54
+ return int(text) if text.isdigit() else text
55
+
56
+
57
+ def natural_keys(text):
58
+ '''
59
+ alist.sort(key=natural_keys) sorts in human order
60
+ http://nedbatchelder.com/blog/200712/human_sorting.html
61
+ (See Toothy's implementation in the comments)
62
+ '''
63
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
64
+
65
+
66
+ def get_model_state_file(checkpoint_dir, zero_stage):
67
+ if not os.path.isdir(checkpoint_dir):
68
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
69
+
70
+ # there should be only one file
71
+ if zero_stage <= 2:
72
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
73
+ elif zero_stage == 3:
74
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
75
+
76
+ if not os.path.exists(file):
77
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
78
+
79
+ return file
80
+
81
+
82
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
83
+ # XXX: need to test that this simple glob rule works for multi-node setup too
84
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
85
+
86
+ if len(ckpt_files) == 0:
87
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
88
+
89
+ return ckpt_files
90
+
91
+
92
+ def get_optim_files(checkpoint_dir):
93
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
94
+
95
+
96
+ def get_model_state_files(checkpoint_dir):
97
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
98
+
99
+
100
+ def parse_model_states(files):
101
+ zero_model_states = []
102
+ for file in files:
103
+ state_dict = torch.load(file, map_location=device)
104
+
105
+ if BUFFER_NAMES not in state_dict:
106
+ raise ValueError(f"{file} is not a model state checkpoint")
107
+ buffer_names = state_dict[BUFFER_NAMES]
108
+ if debug:
109
+ print("Found buffers:", buffer_names)
110
+
111
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
112
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
113
+ param_shapes = state_dict[PARAM_SHAPES]
114
+
115
+ # collect parameters that are included in param_shapes
116
+ param_names = []
117
+ for s in param_shapes:
118
+ for name in s.keys():
119
+ param_names.append(name)
120
+
121
+ # update with frozen parameters
122
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
123
+ if frozen_param_shapes is not None:
124
+ if debug:
125
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
126
+ param_names += list(frozen_param_shapes.keys())
127
+
128
+ # handle shared params
129
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
130
+
131
+ ds_version = state_dict.get(DS_VERSION, None)
132
+
133
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
134
+
135
+ z_model_state = zero_model_state(buffers=buffers,
136
+ param_shapes=param_shapes,
137
+ shared_params=shared_params,
138
+ ds_version=ds_version,
139
+ frozen_param_shapes=frozen_param_shapes,
140
+ frozen_param_fragments=frozen_param_fragments)
141
+ zero_model_states.append(z_model_state)
142
+
143
+ return zero_model_states
144
+
145
+
146
+ def parse_optim_states(files, ds_checkpoint_dir):
147
+ total_files = len(files)
148
+ state_dicts = []
149
+ for f in files:
150
+ state_dict = torch.load(f, map_location=device)
151
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
152
+ # and also handle the case where it was already removed by another helper script
153
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
154
+ state_dicts.append(state_dict)
155
+
156
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
157
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
158
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
159
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
160
+
161
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
162
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
163
+ # use the max of the partition_count to get the dp world_size.
164
+
165
+ if type(world_size) is list:
166
+ world_size = max(world_size)
167
+
168
+ if world_size != total_files:
169
+ raise ValueError(
170
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
171
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
172
+ )
173
+
174
+ # the groups are named differently in each stage
175
+ if zero_stage <= 2:
176
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
177
+ elif zero_stage == 3:
178
+ fp32_groups_key = FP32_FLAT_GROUPS
179
+ else:
180
+ raise ValueError(f"unknown zero stage {zero_stage}")
181
+
182
+ if zero_stage <= 2:
183
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
184
+ elif zero_stage == 3:
185
+ # if there is more than one param group, there will be multiple flattened tensors - one
186
+ # flattened tensor per group - for simplicity merge them into a single tensor
187
+ #
188
+ # XXX: could make the script more memory efficient for when there are multiple groups - it
189
+ # will require matching the sub-lists of param_shapes for each param group flattened tensor
190
+
191
+ fp32_flat_groups = [
192
+ torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) for i in range(len(state_dicts))
193
+ ]
194
+
195
+ return zero_stage, world_size, fp32_flat_groups
196
+
197
+
198
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
199
+ """
200
+ Returns fp32 state_dict reconstructed from ds checkpoint
201
+
202
+ Args:
203
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
204
+
205
+ """
206
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
207
+
208
+ optim_files = get_optim_files(ds_checkpoint_dir)
209
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
210
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
211
+
212
+ model_files = get_model_state_files(ds_checkpoint_dir)
213
+
214
+ zero_model_states = parse_model_states(model_files)
215
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
216
+
217
+ if zero_stage <= 2:
218
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
219
+ exclude_frozen_parameters)
220
+ elif zero_stage == 3:
221
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
222
+ exclude_frozen_parameters)
223
+
224
+
225
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
226
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
227
+ return
228
+
229
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
230
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
231
+
232
+ if debug:
233
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
234
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
235
+
236
+ wanted_params = len(frozen_param_shapes)
237
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
238
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
239
+ print(f'Frozen params: Have {avail_numel} numels to process.')
240
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
241
+
242
+ total_params = 0
243
+ total_numel = 0
244
+ for name, shape in frozen_param_shapes.items():
245
+ total_params += 1
246
+ unpartitioned_numel = shape.numel()
247
+ total_numel += unpartitioned_numel
248
+
249
+ state_dict[name] = frozen_param_fragments[name]
250
+
251
+ if debug:
252
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
253
+
254
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
255
+
256
+
257
+ def _has_callable(obj, fn):
258
+ attr = getattr(obj, fn, None)
259
+ return callable(attr)
260
+
261
+
262
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
263
+ param_shapes = zero_model_states[0].param_shapes
264
+
265
+ # Reconstruction protocol:
266
+ #
267
+ # XXX: document this
268
+
269
+ if debug:
270
+ for i in range(world_size):
271
+ for j in range(len(fp32_flat_groups[0])):
272
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
273
+
274
+ # XXX: memory usage doubles here (zero2)
275
+ num_param_groups = len(fp32_flat_groups[0])
276
+ merged_single_partition_of_fp32_groups = []
277
+ for i in range(num_param_groups):
278
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
279
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
280
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
281
+ avail_numel = sum(
282
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
283
+
284
+ if debug:
285
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
286
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
287
+ # not asserting if there is a mismatch due to possible padding
288
+ print(f"Have {avail_numel} numels to process.")
289
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
290
+
291
+ # params
292
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
293
+ # out-of-core computing solution
294
+ total_numel = 0
295
+ total_params = 0
296
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
297
+ offset = 0
298
+ avail_numel = full_single_fp32_vector.numel()
299
+ for name, shape in shapes.items():
300
+
301
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
302
+ total_numel += unpartitioned_numel
303
+ total_params += 1
304
+
305
+ if debug:
306
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
307
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
308
+ offset += unpartitioned_numel
309
+
310
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
311
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
312
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
313
+ # live optimizer object, so we are checking that the numbers are within the right range
314
+ align_to = 2 * world_size
315
+
316
+ def zero2_align(x):
317
+ return align_to * math.ceil(x / align_to)
318
+
319
+ if debug:
320
+ print(f"original offset={offset}, avail_numel={avail_numel}")
321
+
322
+ offset = zero2_align(offset)
323
+ avail_numel = zero2_align(avail_numel)
324
+
325
+ if debug:
326
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
327
+
328
+ # Sanity check
329
+ if offset != avail_numel:
330
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
331
+
332
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
333
+
334
+
335
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
336
+ exclude_frozen_parameters):
337
+ state_dict = OrderedDict()
338
+
339
+ # buffers
340
+ buffers = zero_model_states[0].buffers
341
+ state_dict.update(buffers)
342
+ if debug:
343
+ print(f"added {len(buffers)} buffers")
344
+
345
+ if not exclude_frozen_parameters:
346
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
347
+
348
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
349
+
350
+ # recover shared parameters
351
+ for pair in zero_model_states[0].shared_params:
352
+ if pair[1] in state_dict:
353
+ state_dict[pair[0]] = state_dict[pair[1]]
354
+
355
+ return state_dict
356
+
357
+
358
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
359
+ remainder = unpartitioned_numel % world_size
360
+ padding_numel = (world_size - remainder) if remainder else 0
361
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
362
+ return partitioned_numel, padding_numel
363
+
364
+
365
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
366
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
367
+ return
368
+
369
+ if debug:
370
+ for i in range(world_size):
371
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
372
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
373
+
374
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
375
+ wanted_params = len(frozen_param_shapes)
376
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
377
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
378
+ print(f'Frozen params: Have {avail_numel} numels to process.')
379
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
380
+
381
+ total_params = 0
382
+ total_numel = 0
383
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
384
+ total_params += 1
385
+ unpartitioned_numel = shape.numel()
386
+ total_numel += unpartitioned_numel
387
+
388
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
389
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
390
+
391
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
392
+
393
+ if debug:
394
+ print(
395
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
396
+ )
397
+
398
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
399
+
400
+
401
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
402
+ param_shapes = zero_model_states[0].param_shapes
403
+ avail_numel = fp32_flat_groups[0].numel() * world_size
404
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
405
+ # param, re-consolidating each param, while dealing with padding if any
406
+
407
+ # merge list of dicts, preserving order
408
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
409
+
410
+ if debug:
411
+ for i in range(world_size):
412
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
413
+
414
+ wanted_params = len(param_shapes)
415
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
416
+ # not asserting if there is a mismatch due to possible padding
417
+ avail_numel = fp32_flat_groups[0].numel() * world_size
418
+ print(f"Trainable params: Have {avail_numel} numels to process.")
419
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
420
+
421
+ # params
422
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
423
+ # out-of-core computing solution
424
+ offset = 0
425
+ total_numel = 0
426
+ total_params = 0
427
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering Sharded Weights'):
428
+ unpartitioned_numel = shape.numel()
429
+ total_numel += unpartitioned_numel
430
+ total_params += 1
431
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
432
+
433
+ if debug:
434
+ print(
435
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
436
+ )
437
+
438
+ # XXX: memory usage doubles here
439
+ state_dict[name] = torch.cat(
440
+ tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
441
+ 0).narrow(0, 0, unpartitioned_numel).view(shape)
442
+ offset += partitioned_numel
443
+
444
+ offset *= world_size
445
+
446
+ # Sanity check
447
+ if offset != avail_numel:
448
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
449
+
450
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
451
+
452
+
453
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
454
+ exclude_frozen_parameters):
455
+ state_dict = OrderedDict()
456
+
457
+ # buffers
458
+ buffers = zero_model_states[0].buffers
459
+ state_dict.update(buffers)
460
+ if debug:
461
+ print(f"added {len(buffers)} buffers")
462
+
463
+ if not exclude_frozen_parameters:
464
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
465
+
466
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
467
+
468
+ # recover shared parameters
469
+ for pair in zero_model_states[0].shared_params:
470
+ if pair[1] in state_dict:
471
+ state_dict[pair[0]] = state_dict[pair[1]]
472
+
473
+ return state_dict
474
+
475
+
476
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=False):
477
+ """
478
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
479
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
480
+ via a model hub.
481
+
482
+ Args:
483
+ - ``checkpoint_dir``: path to the desired checkpoint folder
484
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
485
+ - ``exclude_frozen_parameters``: exclude frozen parameters
486
+
487
+ Returns:
488
+ - pytorch ``state_dict``
489
+
490
+ Note: this approach may not work if your application doesn't have sufficient free CPU memory and
491
+ you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
492
+ the checkpoint.
493
+
494
+ A typical usage might be ::
495
+
496
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
497
+ # do the training and checkpoint saving
498
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
499
+ model = model.cpu() # move to cpu
500
+ model.load_state_dict(state_dict)
501
+ # submit to model hub or save the model to share with others
502
+
503
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
504
+ application. i.e. you will need to re-initialize the deepspeed engine, since
505
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
506
+
507
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
508
+
509
+ """
510
+ if tag is None:
511
+ latest_path = os.path.join(checkpoint_dir, 'latest')
512
+ if os.path.isfile(latest_path):
513
+ with open(latest_path, 'r') as fd:
514
+ tag = fd.read().strip()
515
+ else:
516
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
517
+
518
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
519
+
520
+ if not os.path.isdir(ds_checkpoint_dir):
521
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
522
+
523
+ return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
524
+
525
+
526
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
527
+ output_dir,
528
+ max_shard_size="5GB",
529
+ safe_serialization=False,
530
+ tag=None,
531
+ exclude_frozen_parameters=False):
532
+ """
533
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
534
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
535
+
536
+ Args:
537
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
538
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
539
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
540
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
541
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
542
+ - ``exclude_frozen_parameters``: exclude frozen parameters
543
+ """
544
+ # Dependency pre-check
545
+ if safe_serialization:
546
+ try:
547
+ from safetensors.torch import save_file
548
+ except ImportError:
549
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
550
+ raise
551
+ if max_shard_size is not None:
552
+ try:
553
+ from huggingface_hub import split_torch_state_dict_into_shards
554
+ except ImportError:
555
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
556
+ raise
557
+
558
+ # Convert zero checkpoint to state_dict
559
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
560
+
561
+ # Shard the model if it is too big.
562
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
563
+ if max_shard_size is not None:
564
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
565
+ state_dict_split = split_torch_state_dict_into_shards(state_dict,
566
+ filename_pattern=filename_pattern,
567
+ max_shard_size=max_shard_size)
568
+ else:
569
+ from collections import namedtuple
570
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
571
+ state_dict_split = StateDictSplit(is_sharded=False,
572
+ filename_to_tensors={weights_name: list(state_dict.keys())})
573
+
574
+ # Save the model
575
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
576
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
577
+ shard = {tensor: state_dict[tensor].contiguous() for tensor in tensors}
578
+ output_path = os.path.join(output_dir, shard_file)
579
+ if safe_serialization:
580
+ save_file(shard, output_path, metadata={"format": "pt"})
581
+ else:
582
+ torch.save(shard, output_path)
583
+
584
+ # Save index if sharded
585
+ if state_dict_split.is_sharded:
586
+ index = {
587
+ "metadata": state_dict_split.metadata,
588
+ "weight_map": state_dict_split.tensor_to_filename,
589
+ }
590
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
591
+ save_index_file = os.path.join(output_dir, save_index_file)
592
+ with open(save_index_file, "w", encoding="utf-8") as f:
593
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
594
+ f.write(content)
595
+
596
+
597
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
598
+ """
599
+ 1. Put the provided model to cpu
600
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
601
+ 3. Load it into the provided model
602
+
603
+ Args:
604
+ - ``model``: the model object to update
605
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
606
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
607
+
608
+ Returns:
609
+ - ``model`: modified model
610
+
611
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
612
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
613
+ conveniently placed for you in the checkpoint folder.
614
+
615
+ A typical usage might be ::
616
+
617
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
618
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
619
+ # submit to model hub or save the model to share with others
620
+
621
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
622
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
623
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
624
+
625
+ """
626
+ logger.info(f"Extracting fp32 weights")
627
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
628
+
629
+ logger.info(f"Overwriting model with fp32 weights")
630
+ model = model.cpu()
631
+ model.load_state_dict(state_dict, strict=False)
632
+
633
+ return model
634
+
635
+
636
+ if __name__ == "__main__":
637
+ parser = argparse.ArgumentParser()
638
+ parser.add_argument("checkpoint_dir",
639
+ type=str,
640
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
641
+ parser.add_argument("output_dir",
642
+ type=str,
643
+ help="directory to the pytorch fp32 state_dict output files"
644
+ "(e.g. path/checkpoint-12-output/)")
645
+ parser.add_argument(
646
+ "--max_shard_size",
647
+ type=str,
648
+ default="5GB",
649
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
650
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
651
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
652
+ "without CPU OOM issues.")
653
+ parser.add_argument(
654
+ "--safe_serialization",
655
+ default=False,
656
+ action='store_true',
657
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
658
+ parser.add_argument("-t",
659
+ "--tag",
660
+ type=str,
661
+ default=None,
662
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
663
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
664
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
665
+ args = parser.parse_args()
666
+
667
+ debug = args.debug
668
+
669
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
670
+ args.output_dir,
671
+ max_shard_size=args.max_shard_size,
672
+ safe_serialization=args.safe_serialization,
673
+ tag=args.tag,
674
+ exclude_frozen_parameters=args.exclude_frozen_parameters)