Training in progress, step 700, checkpoint
Browse files- checkpoint-700/README.md +202 -0
- checkpoint-700/adapter_config.json +34 -0
- checkpoint-700/adapter_model.safetensors +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_4_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_5_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_6_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/bf16_zero_pp_rank_7_mp_rank_00_optim_states.pt +3 -0
- checkpoint-700/global_step700/mp_rank_00_model_states.pt +3 -0
- checkpoint-700/latest +1 -0
- checkpoint-700/rng_state_0.pth +3 -0
- checkpoint-700/rng_state_1.pth +3 -0
- checkpoint-700/rng_state_2.pth +3 -0
- checkpoint-700/rng_state_3.pth +3 -0
- checkpoint-700/rng_state_4.pth +3 -0
- checkpoint-700/rng_state_5.pth +3 -0
- checkpoint-700/rng_state_6.pth +3 -0
- checkpoint-700/rng_state_7.pth +3 -0
- checkpoint-700/scheduler.pt +3 -0
- checkpoint-700/special_tokens_map.json +30 -0
- checkpoint-700/tokenizer.json +0 -0
- checkpoint-700/tokenizer_config.json +133 -0
- checkpoint-700/trainer_state.json +1307 -0
- checkpoint-700/training_args.bin +3 -0
- checkpoint-700/zero_to_fp32.py +674 -0
checkpoint-700/README.md
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: microsoft/Phi-3-mini-4k-instruct
|
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,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "microsoft/Phi-3-mini-4k-instruct",
|
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 |
+
"o_proj",
|
27 |
+
"qkv_proj",
|
28 |
+
"gate_up_proj",
|
29 |
+
"down_proj"
|
30 |
+
],
|
31 |
+
"task_type": "CAUSAL_LM",
|
32 |
+
"use_dora": false,
|
33 |
+
"use_rslora": false
|
34 |
+
}
|
checkpoint-700/adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e5befebf1017039d1a13a3c3c99e065d865220f99076a124e5bb5e00ad0954c
|
3 |
+
size 25200088
|
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:fe25ca0f085369da201665a39f5fe2908d12210343ebb100b01c420432ae1062
|
3 |
+
size 18881328
|
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:80b1a7fbc7106d1380b3b997ab24a560d9439c581ef06bf63b0cb166fe1c9a4e
|
3 |
+
size 18881328
|
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:b1b9ac3c76a7020e7a886be37641d5625f94430df0117e41c475b2f252686fae
|
3 |
+
size 18881328
|
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:297dc49f667b72b4867bfc58bacaa1b059a3a7eff8d860563f14d114155bcda8
|
3 |
+
size 18881392
|
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:4acbdccfcf7e6582aa021d530f216dfd52863c6a800a69f97824d562372445d1
|
3 |
+
size 18881392
|
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:8acde90012513a609ca1a6be91998041cec6762bfe4f70b31bc7eeeadff17c3d
|
3 |
+
size 18881392
|
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:d90ba35e8520ab10c4dcfaafb6772f7861b172f9cad345b983ce59318cdc969c
|
3 |
+
size 18881392
|
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:2135e09ba12f843660cab57322f0cb0f11a36eadc800f10fe17dbb688fc4837b
|
3 |
+
size 18881392
|
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:b206c519bc5d7f87c09bf2f645edb59ca80d56c932c9911017d5545d17b1a98c
|
3 |
+
size 25379244
|
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 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|end|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "<|endoftext|>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
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,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": true,
|
27 |
+
"single_word": false,
|
28 |
+
"special": false
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "<|endoftext|>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<|assistant|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": true,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
},
|
46 |
+
"32002": {
|
47 |
+
"content": "<|placeholder1|>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": false,
|
50 |
+
"rstrip": true,
|
51 |
+
"single_word": false,
|
52 |
+
"special": true
|
53 |
+
},
|
54 |
+
"32003": {
|
55 |
+
"content": "<|placeholder2|>",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": false,
|
58 |
+
"rstrip": true,
|
59 |
+
"single_word": false,
|
60 |
+
"special": true
|
61 |
+
},
|
62 |
+
"32004": {
|
63 |
+
"content": "<|placeholder3|>",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": false,
|
66 |
+
"rstrip": true,
|
67 |
+
"single_word": false,
|
68 |
+
"special": true
|
69 |
+
},
|
70 |
+
"32005": {
|
71 |
+
"content": "<|placeholder4|>",
|
72 |
+
"lstrip": false,
|
73 |
+
"normalized": false,
|
74 |
+
"rstrip": true,
|
75 |
+
"single_word": false,
|
76 |
+
"special": true
|
77 |
+
},
|
78 |
+
"32006": {
|
79 |
+
"content": "<|system|>",
|
80 |
+
"lstrip": false,
|
81 |
+
"normalized": false,
|
82 |
+
"rstrip": true,
|
83 |
+
"single_word": false,
|
84 |
+
"special": true
|
85 |
+
},
|
86 |
+
"32007": {
|
87 |
+
"content": "<|end|>",
|
88 |
+
"lstrip": false,
|
89 |
+
"normalized": false,
|
90 |
+
"rstrip": false,
|
91 |
+
"single_word": false,
|
92 |
+
"special": true
|
93 |
+
},
|
94 |
+
"32008": {
|
95 |
+
"content": "<|placeholder5|>",
|
96 |
+
"lstrip": false,
|
97 |
+
"normalized": false,
|
98 |
+
"rstrip": true,
|
99 |
+
"single_word": false,
|
100 |
+
"special": true
|
101 |
+
},
|
102 |
+
"32009": {
|
103 |
+
"content": "<|placeholder6|>",
|
104 |
+
"lstrip": false,
|
105 |
+
"normalized": false,
|
106 |
+
"rstrip": true,
|
107 |
+
"single_word": false,
|
108 |
+
"special": true
|
109 |
+
},
|
110 |
+
"32010": {
|
111 |
+
"content": "<|user|>",
|
112 |
+
"lstrip": false,
|
113 |
+
"normalized": false,
|
114 |
+
"rstrip": true,
|
115 |
+
"single_word": false,
|
116 |
+
"special": true
|
117 |
+
}
|
118 |
+
},
|
119 |
+
"bos_token": "<s>",
|
120 |
+
"chat_template": "{% set system_message = 'You are a helpful AI assistant.' %}{% if messages[0]['role'] == 'system' %}{% set system_message = messages[0]['content'] %}{% endif %}{% if system_message is defined %}{{ '<s>' + '<|system|>\n' + system_message + '<|end|>\n' }}{% endif %}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|user|>\n' + content + '<|end|>\n<|assistant|>\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|end|>' + '\n' }}{% endif %}{% endfor %}",
|
121 |
+
"clean_up_tokenization_spaces": false,
|
122 |
+
"eos_token": "<|end|>",
|
123 |
+
"extra_special_tokens": {},
|
124 |
+
"legacy": false,
|
125 |
+
"model_max_length": 4096,
|
126 |
+
"pad_token": "<|endoftext|>",
|
127 |
+
"padding_side": "right",
|
128 |
+
"sp_model_kwargs": {},
|
129 |
+
"split_special_tokens": false,
|
130 |
+
"tokenizer_class": "LlamaTokenizer",
|
131 |
+
"unk_token": "<unk>",
|
132 |
+
"use_default_system_prompt": false
|
133 |
+
}
|
checkpoint-700/trainer_state.json
ADDED
@@ -0,0 +1,1307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 0.8888888888888888,
|
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.012698412698412698,
|
13 |
+
"grad_norm": 0.04658036306500435,
|
14 |
+
"learning_rate": 4.999451708687114e-06,
|
15 |
+
"logits/chosen": 15.106437683105469,
|
16 |
+
"logits/rejected": 15.158523559570312,
|
17 |
+
"logps/chosen": -0.30069679021835327,
|
18 |
+
"logps/rejected": -0.30243945121765137,
|
19 |
+
"loss": 0.9981,
|
20 |
+
"rewards/accuracies": 0.3499999940395355,
|
21 |
+
"rewards/chosen": -0.45104512572288513,
|
22 |
+
"rewards/margins": 0.002613987773656845,
|
23 |
+
"rewards/rejected": -0.45365914702415466,
|
24 |
+
"step": 10
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"epoch": 0.025396825396825397,
|
28 |
+
"grad_norm": 0.05173320695757866,
|
29 |
+
"learning_rate": 4.997807075247147e-06,
|
30 |
+
"logits/chosen": 14.680102348327637,
|
31 |
+
"logits/rejected": 14.592491149902344,
|
32 |
+
"logps/chosen": -0.3225177228450775,
|
33 |
+
"logps/rejected": -0.27230435609817505,
|
34 |
+
"loss": 0.9967,
|
35 |
+
"rewards/accuracies": 0.26249998807907104,
|
36 |
+
"rewards/chosen": -0.4837765693664551,
|
37 |
+
"rewards/margins": -0.07532001286745071,
|
38 |
+
"rewards/rejected": -0.40845656394958496,
|
39 |
+
"step": 20
|
40 |
+
},
|
41 |
+
{
|
42 |
+
"epoch": 0.0380952380952381,
|
43 |
+
"grad_norm": 0.04962443560361862,
|
44 |
+
"learning_rate": 4.9950668210706795e-06,
|
45 |
+
"logits/chosen": 15.399703979492188,
|
46 |
+
"logits/rejected": 15.089459419250488,
|
47 |
+
"logps/chosen": -0.2997470498085022,
|
48 |
+
"logps/rejected": -0.28447264432907104,
|
49 |
+
"loss": 0.9988,
|
50 |
+
"rewards/accuracies": 0.3125,
|
51 |
+
"rewards/chosen": -0.4496205747127533,
|
52 |
+
"rewards/margins": -0.022911589592695236,
|
53 |
+
"rewards/rejected": -0.42670899629592896,
|
54 |
+
"step": 30
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"epoch": 0.050793650793650794,
|
58 |
+
"grad_norm": 0.05171326920390129,
|
59 |
+
"learning_rate": 4.9912321481237616e-06,
|
60 |
+
"logits/chosen": 15.099847793579102,
|
61 |
+
"logits/rejected": 15.159170150756836,
|
62 |
+
"logps/chosen": -0.29869550466537476,
|
63 |
+
"logps/rejected": -0.2806033790111542,
|
64 |
+
"loss": 0.9841,
|
65 |
+
"rewards/accuracies": 0.375,
|
66 |
+
"rewards/chosen": -0.44804325699806213,
|
67 |
+
"rewards/margins": -0.02713816799223423,
|
68 |
+
"rewards/rejected": -0.42090511322021484,
|
69 |
+
"step": 40
|
70 |
+
},
|
71 |
+
{
|
72 |
+
"epoch": 0.06349206349206349,
|
73 |
+
"grad_norm": 0.048664532601833344,
|
74 |
+
"learning_rate": 4.986304738420684e-06,
|
75 |
+
"logits/chosen": 15.207334518432617,
|
76 |
+
"logits/rejected": 15.135488510131836,
|
77 |
+
"logps/chosen": -0.3121686577796936,
|
78 |
+
"logps/rejected": -0.3194735050201416,
|
79 |
+
"loss": 0.9953,
|
80 |
+
"rewards/accuracies": 0.3499999940395355,
|
81 |
+
"rewards/chosen": -0.468252956867218,
|
82 |
+
"rewards/margins": 0.010957291349768639,
|
83 |
+
"rewards/rejected": -0.47921022772789,
|
84 |
+
"step": 50
|
85 |
+
},
|
86 |
+
{
|
87 |
+
"epoch": 0.06349206349206349,
|
88 |
+
"eval_logits/chosen": 15.441752433776855,
|
89 |
+
"eval_logits/rejected": 15.288756370544434,
|
90 |
+
"eval_logps/chosen": -0.33557233214378357,
|
91 |
+
"eval_logps/rejected": -0.31198158860206604,
|
92 |
+
"eval_loss": 0.9914231300354004,
|
93 |
+
"eval_rewards/accuracies": 0.3125,
|
94 |
+
"eval_rewards/chosen": -0.5033585429191589,
|
95 |
+
"eval_rewards/margins": -0.03538615256547928,
|
96 |
+
"eval_rewards/rejected": -0.46797239780426025,
|
97 |
+
"eval_runtime": 19.0844,
|
98 |
+
"eval_samples_per_second": 26.723,
|
99 |
+
"eval_steps_per_second": 3.354,
|
100 |
+
"step": 50
|
101 |
+
},
|
102 |
+
{
|
103 |
+
"epoch": 0.0761904761904762,
|
104 |
+
"grad_norm": 0.0722479596734047,
|
105 |
+
"learning_rate": 4.980286753286196e-06,
|
106 |
+
"logits/chosen": 15.281786918640137,
|
107 |
+
"logits/rejected": 15.110156059265137,
|
108 |
+
"logps/chosen": -0.30892473459243774,
|
109 |
+
"logps/rejected": -0.26251715421676636,
|
110 |
+
"loss": 1.0022,
|
111 |
+
"rewards/accuracies": 0.25,
|
112 |
+
"rewards/chosen": -0.4633871018886566,
|
113 |
+
"rewards/margins": -0.0696113258600235,
|
114 |
+
"rewards/rejected": -0.3937757611274719,
|
115 |
+
"step": 60
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"epoch": 0.08888888888888889,
|
119 |
+
"grad_norm": 0.07008200883865356,
|
120 |
+
"learning_rate": 4.973180832407471e-06,
|
121 |
+
"logits/chosen": 14.836176872253418,
|
122 |
+
"logits/rejected": 14.98499584197998,
|
123 |
+
"logps/chosen": -0.29483428597450256,
|
124 |
+
"logps/rejected": -0.29870957136154175,
|
125 |
+
"loss": 0.9849,
|
126 |
+
"rewards/accuracies": 0.4000000059604645,
|
127 |
+
"rewards/chosen": -0.44225144386291504,
|
128 |
+
"rewards/margins": 0.0058129094541072845,
|
129 |
+
"rewards/rejected": -0.44806432723999023,
|
130 |
+
"step": 70
|
131 |
+
},
|
132 |
+
{
|
133 |
+
"epoch": 0.10158730158730159,
|
134 |
+
"grad_norm": 0.06503555178642273,
|
135 |
+
"learning_rate": 4.964990092676263e-06,
|
136 |
+
"logits/chosen": 15.508198738098145,
|
137 |
+
"logits/rejected": 15.592549324035645,
|
138 |
+
"logps/chosen": -0.3066270351409912,
|
139 |
+
"logps/rejected": -0.2757572531700134,
|
140 |
+
"loss": 0.9886,
|
141 |
+
"rewards/accuracies": 0.3125,
|
142 |
+
"rewards/chosen": -0.45994052290916443,
|
143 |
+
"rewards/margins": -0.046304650604724884,
|
144 |
+
"rewards/rejected": -0.41363590955734253,
|
145 |
+
"step": 80
|
146 |
+
},
|
147 |
+
{
|
148 |
+
"epoch": 0.11428571428571428,
|
149 |
+
"grad_norm": 0.10515156388282776,
|
150 |
+
"learning_rate": 4.9557181268217225e-06,
|
151 |
+
"logits/chosen": 15.301602363586426,
|
152 |
+
"logits/rejected": 15.421157836914062,
|
153 |
+
"logps/chosen": -0.31223705410957336,
|
154 |
+
"logps/rejected": -0.29449179768562317,
|
155 |
+
"loss": 0.981,
|
156 |
+
"rewards/accuracies": 0.2750000059604645,
|
157 |
+
"rewards/chosen": -0.46835556626319885,
|
158 |
+
"rewards/margins": -0.02661792002618313,
|
159 |
+
"rewards/rejected": -0.44173765182495117,
|
160 |
+
"step": 90
|
161 |
+
},
|
162 |
+
{
|
163 |
+
"epoch": 0.12698412698412698,
|
164 |
+
"grad_norm": 0.05785346403717995,
|
165 |
+
"learning_rate": 4.9453690018345144e-06,
|
166 |
+
"logits/chosen": 16.00307846069336,
|
167 |
+
"logits/rejected": 15.64977741241455,
|
168 |
+
"logps/chosen": -0.32283931970596313,
|
169 |
+
"logps/rejected": -0.28576889634132385,
|
170 |
+
"loss": 0.9883,
|
171 |
+
"rewards/accuracies": 0.2750000059604645,
|
172 |
+
"rewards/chosen": -0.4842589795589447,
|
173 |
+
"rewards/margins": -0.055605631321668625,
|
174 |
+
"rewards/rejected": -0.42865338921546936,
|
175 |
+
"step": 100
|
176 |
+
},
|
177 |
+
{
|
178 |
+
"epoch": 0.12698412698412698,
|
179 |
+
"eval_logits/chosen": 15.624425888061523,
|
180 |
+
"eval_logits/rejected": 15.548928260803223,
|
181 |
+
"eval_logps/chosen": -0.33450835943222046,
|
182 |
+
"eval_logps/rejected": -0.31935107707977295,
|
183 |
+
"eval_loss": 0.9836427569389343,
|
184 |
+
"eval_rewards/accuracies": 0.359375,
|
185 |
+
"eval_rewards/chosen": -0.5017625689506531,
|
186 |
+
"eval_rewards/margins": -0.022735953330993652,
|
187 |
+
"eval_rewards/rejected": -0.4790266156196594,
|
188 |
+
"eval_runtime": 18.6768,
|
189 |
+
"eval_samples_per_second": 27.307,
|
190 |
+
"eval_steps_per_second": 3.427,
|
191 |
+
"step": 100
|
192 |
+
},
|
193 |
+
{
|
194 |
+
"epoch": 0.13968253968253969,
|
195 |
+
"grad_norm": 0.08603859692811966,
|
196 |
+
"learning_rate": 4.933947257182901e-06,
|
197 |
+
"logits/chosen": 15.40850830078125,
|
198 |
+
"logits/rejected": 15.258935928344727,
|
199 |
+
"logps/chosen": -0.3209790587425232,
|
200 |
+
"logps/rejected": -0.29926618933677673,
|
201 |
+
"loss": 0.9852,
|
202 |
+
"rewards/accuracies": 0.4124999940395355,
|
203 |
+
"rewards/chosen": -0.4814685881137848,
|
204 |
+
"rewards/margins": -0.03256931155920029,
|
205 |
+
"rewards/rejected": -0.4488992691040039,
|
206 |
+
"step": 110
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"epoch": 0.1523809523809524,
|
210 |
+
"grad_norm": 0.13407552242279053,
|
211 |
+
"learning_rate": 4.921457902821578e-06,
|
212 |
+
"logits/chosen": 15.610095024108887,
|
213 |
+
"logits/rejected": 15.964601516723633,
|
214 |
+
"logps/chosen": -0.2977743446826935,
|
215 |
+
"logps/rejected": -0.3102283179759979,
|
216 |
+
"loss": 0.9839,
|
217 |
+
"rewards/accuracies": 0.38749998807907104,
|
218 |
+
"rewards/chosen": -0.4466615617275238,
|
219 |
+
"rewards/margins": 0.018680967390537262,
|
220 |
+
"rewards/rejected": -0.4653424620628357,
|
221 |
+
"step": 120
|
222 |
+
},
|
223 |
+
{
|
224 |
+
"epoch": 0.16507936507936508,
|
225 |
+
"grad_norm": 0.1397980898618698,
|
226 |
+
"learning_rate": 4.907906416994146e-06,
|
227 |
+
"logits/chosen": 15.487627983093262,
|
228 |
+
"logits/rejected": 15.767982482910156,
|
229 |
+
"logps/chosen": -0.2769243121147156,
|
230 |
+
"logps/rejected": -0.3168947100639343,
|
231 |
+
"loss": 0.9737,
|
232 |
+
"rewards/accuracies": 0.4749999940395355,
|
233 |
+
"rewards/chosen": -0.415386438369751,
|
234 |
+
"rewards/margins": 0.05995568633079529,
|
235 |
+
"rewards/rejected": -0.47534212470054626,
|
236 |
+
"step": 130
|
237 |
+
},
|
238 |
+
{
|
239 |
+
"epoch": 0.17777777777777778,
|
240 |
+
"grad_norm": 0.09849797189235687,
|
241 |
+
"learning_rate": 4.893298743830168e-06,
|
242 |
+
"logits/chosen": 15.779914855957031,
|
243 |
+
"logits/rejected": 15.66816234588623,
|
244 |
+
"logps/chosen": -0.2959491014480591,
|
245 |
+
"logps/rejected": -0.3029848635196686,
|
246 |
+
"loss": 0.9804,
|
247 |
+
"rewards/accuracies": 0.375,
|
248 |
+
"rewards/chosen": -0.4439236521720886,
|
249 |
+
"rewards/margins": 0.010553586296737194,
|
250 |
+
"rewards/rejected": -0.4544772207736969,
|
251 |
+
"step": 140
|
252 |
+
},
|
253 |
+
{
|
254 |
+
"epoch": 0.19047619047619047,
|
255 |
+
"grad_norm": 0.08089074492454529,
|
256 |
+
"learning_rate": 4.8776412907378845e-06,
|
257 |
+
"logits/chosen": 15.029818534851074,
|
258 |
+
"logits/rejected": 15.431653022766113,
|
259 |
+
"logps/chosen": -0.2956623435020447,
|
260 |
+
"logps/rejected": -0.3162347376346588,
|
261 |
+
"loss": 0.9728,
|
262 |
+
"rewards/accuracies": 0.4749999940395355,
|
263 |
+
"rewards/chosen": -0.443493515253067,
|
264 |
+
"rewards/margins": 0.030858617275953293,
|
265 |
+
"rewards/rejected": -0.4743521809577942,
|
266 |
+
"step": 150
|
267 |
+
},
|
268 |
+
{
|
269 |
+
"epoch": 0.19047619047619047,
|
270 |
+
"eval_logits/chosen": 15.575506210327148,
|
271 |
+
"eval_logits/rejected": 15.54050064086914,
|
272 |
+
"eval_logps/chosen": -0.3363308906555176,
|
273 |
+
"eval_logps/rejected": -0.3436908721923828,
|
274 |
+
"eval_loss": 0.9609583616256714,
|
275 |
+
"eval_rewards/accuracies": 0.4375,
|
276 |
+
"eval_rewards/chosen": -0.5044962763786316,
|
277 |
+
"eval_rewards/margins": 0.01103996392339468,
|
278 |
+
"eval_rewards/rejected": -0.5155363082885742,
|
279 |
+
"eval_runtime": 18.6082,
|
280 |
+
"eval_samples_per_second": 27.407,
|
281 |
+
"eval_steps_per_second": 3.439,
|
282 |
+
"step": 150
|
283 |
+
},
|
284 |
+
{
|
285 |
+
"epoch": 0.20317460317460317,
|
286 |
+
"grad_norm": 0.12168499082326889,
|
287 |
+
"learning_rate": 4.860940925593703e-06,
|
288 |
+
"logits/chosen": 15.47050952911377,
|
289 |
+
"logits/rejected": 15.637664794921875,
|
290 |
+
"logps/chosen": -0.32601848244667053,
|
291 |
+
"logps/rejected": -0.35739919543266296,
|
292 |
+
"loss": 0.9531,
|
293 |
+
"rewards/accuracies": 0.5249999761581421,
|
294 |
+
"rewards/chosen": -0.489027738571167,
|
295 |
+
"rewards/margins": 0.04707105830311775,
|
296 |
+
"rewards/rejected": -0.5360987782478333,
|
297 |
+
"step": 160
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"epoch": 0.21587301587301588,
|
301 |
+
"grad_norm": 0.12861700356006622,
|
302 |
+
"learning_rate": 4.84320497372973e-06,
|
303 |
+
"logits/chosen": 15.594339370727539,
|
304 |
+
"logits/rejected": 15.680140495300293,
|
305 |
+
"logps/chosen": -0.29271024465560913,
|
306 |
+
"logps/rejected": -0.3383347690105438,
|
307 |
+
"loss": 0.9386,
|
308 |
+
"rewards/accuracies": 0.5,
|
309 |
+
"rewards/chosen": -0.4390653669834137,
|
310 |
+
"rewards/margins": 0.06843684613704681,
|
311 |
+
"rewards/rejected": -0.5075021982192993,
|
312 |
+
"step": 170
|
313 |
+
},
|
314 |
+
{
|
315 |
+
"epoch": 0.22857142857142856,
|
316 |
+
"grad_norm": 0.10320646315813065,
|
317 |
+
"learning_rate": 4.824441214720629e-06,
|
318 |
+
"logits/chosen": 15.644658088684082,
|
319 |
+
"logits/rejected": 15.526695251464844,
|
320 |
+
"logps/chosen": -0.30950039625167847,
|
321 |
+
"logps/rejected": -0.33660295605659485,
|
322 |
+
"loss": 0.9313,
|
323 |
+
"rewards/accuracies": 0.4124999940395355,
|
324 |
+
"rewards/chosen": -0.46425050497055054,
|
325 |
+
"rewards/margins": 0.04065385088324547,
|
326 |
+
"rewards/rejected": -0.5049043893814087,
|
327 |
+
"step": 180
|
328 |
+
},
|
329 |
+
{
|
330 |
+
"epoch": 0.24126984126984127,
|
331 |
+
"grad_norm": 0.29178574681282043,
|
332 |
+
"learning_rate": 4.804657878971252e-06,
|
333 |
+
"logits/chosen": 15.795066833496094,
|
334 |
+
"logits/rejected": 15.640788078308105,
|
335 |
+
"logps/chosen": -0.34224197268486023,
|
336 |
+
"logps/rejected": -0.34523850679397583,
|
337 |
+
"loss": 0.9406,
|
338 |
+
"rewards/accuracies": 0.375,
|
339 |
+
"rewards/chosen": -0.5133630037307739,
|
340 |
+
"rewards/margins": 0.0044947536662220955,
|
341 |
+
"rewards/rejected": -0.5178577303886414,
|
342 |
+
"step": 190
|
343 |
+
},
|
344 |
+
{
|
345 |
+
"epoch": 0.25396825396825395,
|
346 |
+
"grad_norm": 0.15747429430484772,
|
347 |
+
"learning_rate": 4.783863644106502e-06,
|
348 |
+
"logits/chosen": 15.24070930480957,
|
349 |
+
"logits/rejected": 15.132087707519531,
|
350 |
+
"logps/chosen": -0.3026728630065918,
|
351 |
+
"logps/rejected": -0.3765440583229065,
|
352 |
+
"loss": 0.9031,
|
353 |
+
"rewards/accuracies": 0.4749999940395355,
|
354 |
+
"rewards/chosen": -0.4540092945098877,
|
355 |
+
"rewards/margins": 0.11080671846866608,
|
356 |
+
"rewards/rejected": -0.5648160576820374,
|
357 |
+
"step": 200
|
358 |
+
},
|
359 |
+
{
|
360 |
+
"epoch": 0.25396825396825395,
|
361 |
+
"eval_logits/chosen": 15.073077201843262,
|
362 |
+
"eval_logits/rejected": 15.098322868347168,
|
363 |
+
"eval_logps/chosen": -0.3540771007537842,
|
364 |
+
"eval_logps/rejected": -0.41381165385246277,
|
365 |
+
"eval_loss": 0.9153187274932861,
|
366 |
+
"eval_rewards/accuracies": 0.5,
|
367 |
+
"eval_rewards/chosen": -0.5311156511306763,
|
368 |
+
"eval_rewards/margins": 0.08960187435150146,
|
369 |
+
"eval_rewards/rejected": -0.6207175254821777,
|
370 |
+
"eval_runtime": 18.5936,
|
371 |
+
"eval_samples_per_second": 27.429,
|
372 |
+
"eval_steps_per_second": 3.442,
|
373 |
+
"step": 200
|
374 |
+
},
|
375 |
+
{
|
376 |
+
"epoch": 0.26666666666666666,
|
377 |
+
"grad_norm": 0.9226244688034058,
|
378 |
+
"learning_rate": 4.762067631165049e-06,
|
379 |
+
"logits/chosen": 15.300783157348633,
|
380 |
+
"logits/rejected": 15.6528902053833,
|
381 |
+
"logps/chosen": -0.3110392093658447,
|
382 |
+
"logps/rejected": -0.4790540635585785,
|
383 |
+
"loss": 0.8977,
|
384 |
+
"rewards/accuracies": 0.625,
|
385 |
+
"rewards/chosen": -0.4665588438510895,
|
386 |
+
"rewards/margins": 0.25202232599258423,
|
387 |
+
"rewards/rejected": -0.7185810804367065,
|
388 |
+
"step": 210
|
389 |
+
},
|
390 |
+
{
|
391 |
+
"epoch": 0.27936507936507937,
|
392 |
+
"grad_norm": 0.187363401055336,
|
393 |
+
"learning_rate": 4.7392794005985324e-06,
|
394 |
+
"logits/chosen": 15.123028755187988,
|
395 |
+
"logits/rejected": 14.940861701965332,
|
396 |
+
"logps/chosen": -0.33024150133132935,
|
397 |
+
"logps/rejected": -0.35755541920661926,
|
398 |
+
"loss": 0.9074,
|
399 |
+
"rewards/accuracies": 0.42500001192092896,
|
400 |
+
"rewards/chosen": -0.49536222219467163,
|
401 |
+
"rewards/margins": 0.04097090661525726,
|
402 |
+
"rewards/rejected": -0.5363331437110901,
|
403 |
+
"step": 220
|
404 |
+
},
|
405 |
+
{
|
406 |
+
"epoch": 0.2920634920634921,
|
407 |
+
"grad_norm": 0.27345994114875793,
|
408 |
+
"learning_rate": 4.715508948078037e-06,
|
409 |
+
"logits/chosen": 14.54762077331543,
|
410 |
+
"logits/rejected": 14.207303047180176,
|
411 |
+
"logps/chosen": -0.2951691150665283,
|
412 |
+
"logps/rejected": -0.41360992193222046,
|
413 |
+
"loss": 0.896,
|
414 |
+
"rewards/accuracies": 0.512499988079071,
|
415 |
+
"rewards/chosen": -0.4427536427974701,
|
416 |
+
"rewards/margins": 0.1776612401008606,
|
417 |
+
"rewards/rejected": -0.6204149723052979,
|
418 |
+
"step": 230
|
419 |
+
},
|
420 |
+
{
|
421 |
+
"epoch": 0.3047619047619048,
|
422 |
+
"grad_norm": 0.20160575211048126,
|
423 |
+
"learning_rate": 4.690766700109659e-06,
|
424 |
+
"logits/chosen": 14.768750190734863,
|
425 |
+
"logits/rejected": 14.940885543823242,
|
426 |
+
"logps/chosen": -0.3044833838939667,
|
427 |
+
"logps/rejected": -0.4275297224521637,
|
428 |
+
"loss": 0.891,
|
429 |
+
"rewards/accuracies": 0.512499988079071,
|
430 |
+
"rewards/chosen": -0.4567251205444336,
|
431 |
+
"rewards/margins": 0.18456946313381195,
|
432 |
+
"rewards/rejected": -0.6412945985794067,
|
433 |
+
"step": 240
|
434 |
+
},
|
435 |
+
{
|
436 |
+
"epoch": 0.31746031746031744,
|
437 |
+
"grad_norm": 0.9059060215950012,
|
438 |
+
"learning_rate": 4.665063509461098e-06,
|
439 |
+
"logits/chosen": 14.839933395385742,
|
440 |
+
"logits/rejected": 14.69981861114502,
|
441 |
+
"logps/chosen": -0.3137063980102539,
|
442 |
+
"logps/rejected": -0.49661844968795776,
|
443 |
+
"loss": 0.8621,
|
444 |
+
"rewards/accuracies": 0.5,
|
445 |
+
"rewards/chosen": -0.47055959701538086,
|
446 |
+
"rewards/margins": 0.2743679881095886,
|
447 |
+
"rewards/rejected": -0.7449275851249695,
|
448 |
+
"step": 250
|
449 |
+
},
|
450 |
+
{
|
451 |
+
"epoch": 0.31746031746031744,
|
452 |
+
"eval_logits/chosen": 14.19374942779541,
|
453 |
+
"eval_logits/rejected": 14.215425491333008,
|
454 |
+
"eval_logps/chosen": -0.3999108076095581,
|
455 |
+
"eval_logps/rejected": -0.7892026305198669,
|
456 |
+
"eval_loss": 0.7948001623153687,
|
457 |
+
"eval_rewards/accuracies": 0.53125,
|
458 |
+
"eval_rewards/chosen": -0.5998662114143372,
|
459 |
+
"eval_rewards/margins": 0.5839377641677856,
|
460 |
+
"eval_rewards/rejected": -1.1838040351867676,
|
461 |
+
"eval_runtime": 18.6098,
|
462 |
+
"eval_samples_per_second": 27.405,
|
463 |
+
"eval_steps_per_second": 3.439,
|
464 |
+
"step": 250
|
465 |
+
},
|
466 |
+
{
|
467 |
+
"epoch": 0.33015873015873015,
|
468 |
+
"grad_norm": 0.8104033470153809,
|
469 |
+
"learning_rate": 4.638410650401267e-06,
|
470 |
+
"logits/chosen": 14.144885063171387,
|
471 |
+
"logits/rejected": 14.350593566894531,
|
472 |
+
"logps/chosen": -0.3469873368740082,
|
473 |
+
"logps/rejected": -0.8288809657096863,
|
474 |
+
"loss": 0.7939,
|
475 |
+
"rewards/accuracies": 0.5375000238418579,
|
476 |
+
"rewards/chosen": -0.5204810500144958,
|
477 |
+
"rewards/margins": 0.7228401899337769,
|
478 |
+
"rewards/rejected": -1.243321418762207,
|
479 |
+
"step": 260
|
480 |
+
},
|
481 |
+
{
|
482 |
+
"epoch": 0.34285714285714286,
|
483 |
+
"grad_norm": 0.39150306582450867,
|
484 |
+
"learning_rate": 4.610819813755038e-06,
|
485 |
+
"logits/chosen": 14.15583324432373,
|
486 |
+
"logits/rejected": 13.783352851867676,
|
487 |
+
"logps/chosen": -0.34353378415107727,
|
488 |
+
"logps/rejected": -1.1232259273529053,
|
489 |
+
"loss": 0.7635,
|
490 |
+
"rewards/accuracies": 0.5375000238418579,
|
491 |
+
"rewards/chosen": -0.5153006911277771,
|
492 |
+
"rewards/margins": 1.1695382595062256,
|
493 |
+
"rewards/rejected": -1.684838891029358,
|
494 |
+
"step": 270
|
495 |
+
},
|
496 |
+
{
|
497 |
+
"epoch": 0.35555555555555557,
|
498 |
+
"grad_norm": 0.1740872859954834,
|
499 |
+
"learning_rate": 4.582303101775249e-06,
|
500 |
+
"logits/chosen": 13.705289840698242,
|
501 |
+
"logits/rejected": 13.493337631225586,
|
502 |
+
"logps/chosen": -0.35998308658599854,
|
503 |
+
"logps/rejected": -1.3943986892700195,
|
504 |
+
"loss": 0.7678,
|
505 |
+
"rewards/accuracies": 0.48750001192092896,
|
506 |
+
"rewards/chosen": -0.539974570274353,
|
507 |
+
"rewards/margins": 1.5516235828399658,
|
508 |
+
"rewards/rejected": -2.0915980339050293,
|
509 |
+
"step": 280
|
510 |
+
},
|
511 |
+
{
|
512 |
+
"epoch": 0.3682539682539683,
|
513 |
+
"grad_norm": 0.22531260550022125,
|
514 |
+
"learning_rate": 4.55287302283426e-06,
|
515 |
+
"logits/chosen": 13.186914443969727,
|
516 |
+
"logits/rejected": 13.140413284301758,
|
517 |
+
"logps/chosen": -0.3548193573951721,
|
518 |
+
"logps/rejected": -1.2321991920471191,
|
519 |
+
"loss": 0.7719,
|
520 |
+
"rewards/accuracies": 0.5874999761581421,
|
521 |
+
"rewards/chosen": -0.5322290062904358,
|
522 |
+
"rewards/margins": 1.3160697221755981,
|
523 |
+
"rewards/rejected": -1.8482987880706787,
|
524 |
+
"step": 290
|
525 |
+
},
|
526 |
+
{
|
527 |
+
"epoch": 0.38095238095238093,
|
528 |
+
"grad_norm": 0.5229180455207825,
|
529 |
+
"learning_rate": 4.522542485937369e-06,
|
530 |
+
"logits/chosen": 13.780011177062988,
|
531 |
+
"logits/rejected": 13.604715347290039,
|
532 |
+
"logps/chosen": -0.4277075231075287,
|
533 |
+
"logps/rejected": -1.415838599205017,
|
534 |
+
"loss": 0.7644,
|
535 |
+
"rewards/accuracies": 0.4749999940395355,
|
536 |
+
"rewards/chosen": -0.6415613293647766,
|
537 |
+
"rewards/margins": 1.482196569442749,
|
538 |
+
"rewards/rejected": -2.123757839202881,
|
539 |
+
"step": 300
|
540 |
+
},
|
541 |
+
{
|
542 |
+
"epoch": 0.38095238095238093,
|
543 |
+
"eval_logits/chosen": 13.13498592376709,
|
544 |
+
"eval_logits/rejected": 13.13513469696045,
|
545 |
+
"eval_logps/chosen": -0.476482629776001,
|
546 |
+
"eval_logps/rejected": -1.4701811075210571,
|
547 |
+
"eval_loss": 0.7514793872833252,
|
548 |
+
"eval_rewards/accuracies": 0.546875,
|
549 |
+
"eval_rewards/chosen": -0.7147239446640015,
|
550 |
+
"eval_rewards/margins": 1.4905478954315186,
|
551 |
+
"eval_rewards/rejected": -2.2052717208862305,
|
552 |
+
"eval_runtime": 18.6093,
|
553 |
+
"eval_samples_per_second": 27.406,
|
554 |
+
"eval_steps_per_second": 3.439,
|
555 |
+
"step": 300
|
556 |
+
},
|
557 |
+
{
|
558 |
+
"epoch": 0.39365079365079364,
|
559 |
+
"grad_norm": 0.7556002736091614,
|
560 |
+
"learning_rate": 4.491324795060491e-06,
|
561 |
+
"logits/chosen": 13.26073932647705,
|
562 |
+
"logits/rejected": 13.28388786315918,
|
563 |
+
"logps/chosen": -0.39378833770751953,
|
564 |
+
"logps/rejected": -1.4242979288101196,
|
565 |
+
"loss": 0.7092,
|
566 |
+
"rewards/accuracies": 0.5249999761581421,
|
567 |
+
"rewards/chosen": -0.5906823873519897,
|
568 |
+
"rewards/margins": 1.5457642078399658,
|
569 |
+
"rewards/rejected": -2.136446714401245,
|
570 |
+
"step": 310
|
571 |
+
},
|
572 |
+
{
|
573 |
+
"epoch": 0.40634920634920635,
|
574 |
+
"grad_norm": 0.8167753219604492,
|
575 |
+
"learning_rate": 4.4592336433146e-06,
|
576 |
+
"logits/chosen": 12.952977180480957,
|
577 |
+
"logits/rejected": 12.89118480682373,
|
578 |
+
"logps/chosen": -0.4167153835296631,
|
579 |
+
"logps/rejected": -1.1332799196243286,
|
580 |
+
"loss": 0.7364,
|
581 |
+
"rewards/accuracies": 0.512499988079071,
|
582 |
+
"rewards/chosen": -0.6250730752944946,
|
583 |
+
"rewards/margins": 1.074846625328064,
|
584 |
+
"rewards/rejected": -1.6999199390411377,
|
585 |
+
"step": 320
|
586 |
+
},
|
587 |
+
{
|
588 |
+
"epoch": 0.41904761904761906,
|
589 |
+
"grad_norm": 2.9806692600250244,
|
590 |
+
"learning_rate": 4.426283106939474e-06,
|
591 |
+
"logits/chosen": 12.890368461608887,
|
592 |
+
"logits/rejected": 12.765925407409668,
|
593 |
+
"logps/chosen": -0.5025959014892578,
|
594 |
+
"logps/rejected": -1.2589428424835205,
|
595 |
+
"loss": 0.748,
|
596 |
+
"rewards/accuracies": 0.612500011920929,
|
597 |
+
"rewards/chosen": -0.7538937926292419,
|
598 |
+
"rewards/margins": 1.1345205307006836,
|
599 |
+
"rewards/rejected": -1.8884143829345703,
|
600 |
+
"step": 330
|
601 |
+
},
|
602 |
+
{
|
603 |
+
"epoch": 0.43174603174603177,
|
604 |
+
"grad_norm": 1.568097710609436,
|
605 |
+
"learning_rate": 4.3924876391293915e-06,
|
606 |
+
"logits/chosen": 13.032608032226562,
|
607 |
+
"logits/rejected": 12.877195358276367,
|
608 |
+
"logps/chosen": -0.5034081935882568,
|
609 |
+
"logps/rejected": -1.585137963294983,
|
610 |
+
"loss": 0.7516,
|
611 |
+
"rewards/accuracies": 0.612500011920929,
|
612 |
+
"rewards/chosen": -0.7551122903823853,
|
613 |
+
"rewards/margins": 1.6225944757461548,
|
614 |
+
"rewards/rejected": -2.37770676612854,
|
615 |
+
"step": 340
|
616 |
+
},
|
617 |
+
{
|
618 |
+
"epoch": 0.4444444444444444,
|
619 |
+
"grad_norm": 0.5996735095977783,
|
620 |
+
"learning_rate": 4.357862063693486e-06,
|
621 |
+
"logits/chosen": 12.859817504882812,
|
622 |
+
"logits/rejected": 12.712678909301758,
|
623 |
+
"logps/chosen": -0.5043476819992065,
|
624 |
+
"logps/rejected": -1.525444507598877,
|
625 |
+
"loss": 0.7497,
|
626 |
+
"rewards/accuracies": 0.7124999761581421,
|
627 |
+
"rewards/chosen": -0.7565216422080994,
|
628 |
+
"rewards/margins": 1.5316450595855713,
|
629 |
+
"rewards/rejected": -2.2881667613983154,
|
630 |
+
"step": 350
|
631 |
+
},
|
632 |
+
{
|
633 |
+
"epoch": 0.4444444444444444,
|
634 |
+
"eval_logits/chosen": 12.228137969970703,
|
635 |
+
"eval_logits/rejected": 12.226001739501953,
|
636 |
+
"eval_logps/chosen": -0.5828607082366943,
|
637 |
+
"eval_logps/rejected": -1.6681612730026245,
|
638 |
+
"eval_loss": 0.7238383889198303,
|
639 |
+
"eval_rewards/accuracies": 0.6875,
|
640 |
+
"eval_rewards/chosen": -0.8742910623550415,
|
641 |
+
"eval_rewards/margins": 1.6279507875442505,
|
642 |
+
"eval_rewards/rejected": -2.502241611480713,
|
643 |
+
"eval_runtime": 18.6038,
|
644 |
+
"eval_samples_per_second": 27.414,
|
645 |
+
"eval_steps_per_second": 3.44,
|
646 |
+
"step": 350
|
647 |
+
},
|
648 |
+
{
|
649 |
+
"epoch": 0.45714285714285713,
|
650 |
+
"grad_norm": 0.605993926525116,
|
651 |
+
"learning_rate": 4.322421568553529e-06,
|
652 |
+
"logits/chosen": 11.993739128112793,
|
653 |
+
"logits/rejected": 11.75650691986084,
|
654 |
+
"logps/chosen": -0.5674928426742554,
|
655 |
+
"logps/rejected": -1.7509374618530273,
|
656 |
+
"loss": 0.7241,
|
657 |
+
"rewards/accuracies": 0.7124999761581421,
|
658 |
+
"rewards/chosen": -0.8512393236160278,
|
659 |
+
"rewards/margins": 1.7751665115356445,
|
660 |
+
"rewards/rejected": -2.626405954360962,
|
661 |
+
"step": 360
|
662 |
+
},
|
663 |
+
{
|
664 |
+
"epoch": 0.46984126984126984,
|
665 |
+
"grad_norm": 0.931057870388031,
|
666 |
+
"learning_rate": 4.286181699082008e-06,
|
667 |
+
"logits/chosen": 11.784490585327148,
|
668 |
+
"logits/rejected": 12.052295684814453,
|
669 |
+
"logps/chosen": -0.5866945385932922,
|
670 |
+
"logps/rejected": -1.8955312967300415,
|
671 |
+
"loss": 0.7141,
|
672 |
+
"rewards/accuracies": 0.75,
|
673 |
+
"rewards/chosen": -0.8800417184829712,
|
674 |
+
"rewards/margins": 1.9632551670074463,
|
675 |
+
"rewards/rejected": -2.843297243118286,
|
676 |
+
"step": 370
|
677 |
+
},
|
678 |
+
{
|
679 |
+
"epoch": 0.48253968253968255,
|
680 |
+
"grad_norm": 1.3936405181884766,
|
681 |
+
"learning_rate": 4.249158351283414e-06,
|
682 |
+
"logits/chosen": 11.842119216918945,
|
683 |
+
"logits/rejected": 11.340182304382324,
|
684 |
+
"logps/chosen": -0.7804869413375854,
|
685 |
+
"logps/rejected": -1.8759396076202393,
|
686 |
+
"loss": 0.6654,
|
687 |
+
"rewards/accuracies": 0.699999988079071,
|
688 |
+
"rewards/chosen": -1.1707303524017334,
|
689 |
+
"rewards/margins": 1.6431787014007568,
|
690 |
+
"rewards/rejected": -2.8139090538024902,
|
691 |
+
"step": 380
|
692 |
+
},
|
693 |
+
{
|
694 |
+
"epoch": 0.49523809523809526,
|
695 |
+
"grad_norm": 1.737855076789856,
|
696 |
+
"learning_rate": 4.211367764821722e-06,
|
697 |
+
"logits/chosen": 11.465726852416992,
|
698 |
+
"logits/rejected": 11.05290699005127,
|
699 |
+
"logps/chosen": -1.3201282024383545,
|
700 |
+
"logps/rejected": -2.3962795734405518,
|
701 |
+
"loss": 0.6301,
|
702 |
+
"rewards/accuracies": 0.8374999761581421,
|
703 |
+
"rewards/chosen": -1.9801921844482422,
|
704 |
+
"rewards/margins": 1.6142269372940063,
|
705 |
+
"rewards/rejected": -3.594419002532959,
|
706 |
+
"step": 390
|
707 |
+
},
|
708 |
+
{
|
709 |
+
"epoch": 0.5079365079365079,
|
710 |
+
"grad_norm": 1.6870065927505493,
|
711 |
+
"learning_rate": 4.172826515897146e-06,
|
712 |
+
"logits/chosen": 10.830609321594238,
|
713 |
+
"logits/rejected": 10.663077354431152,
|
714 |
+
"logps/chosen": -2.5642189979553223,
|
715 |
+
"logps/rejected": -3.535013198852539,
|
716 |
+
"loss": 0.6274,
|
717 |
+
"rewards/accuracies": 0.800000011920929,
|
718 |
+
"rewards/chosen": -3.8463282585144043,
|
719 |
+
"rewards/margins": 1.4561914205551147,
|
720 |
+
"rewards/rejected": -5.302519798278809,
|
721 |
+
"step": 400
|
722 |
+
},
|
723 |
+
{
|
724 |
+
"epoch": 0.5079365079365079,
|
725 |
+
"eval_logits/chosen": 9.964677810668945,
|
726 |
+
"eval_logits/rejected": 9.858954429626465,
|
727 |
+
"eval_logps/chosen": -2.578787088394165,
|
728 |
+
"eval_logps/rejected": -3.803541898727417,
|
729 |
+
"eval_loss": 0.590033233165741,
|
730 |
+
"eval_rewards/accuracies": 0.796875,
|
731 |
+
"eval_rewards/chosen": -3.868180513381958,
|
732 |
+
"eval_rewards/margins": 1.837132453918457,
|
733 |
+
"eval_rewards/rejected": -5.705312728881836,
|
734 |
+
"eval_runtime": 18.5898,
|
735 |
+
"eval_samples_per_second": 27.434,
|
736 |
+
"eval_steps_per_second": 3.443,
|
737 |
+
"step": 400
|
738 |
+
},
|
739 |
+
{
|
740 |
+
"epoch": 0.5206349206349207,
|
741 |
+
"grad_norm": 2.0417189598083496,
|
742 |
+
"learning_rate": 4.133551509975264e-06,
|
743 |
+
"logits/chosen": 9.34677505493164,
|
744 |
+
"logits/rejected": 9.576300621032715,
|
745 |
+
"logps/chosen": -2.1631455421447754,
|
746 |
+
"logps/rejected": -3.024636745452881,
|
747 |
+
"loss": 0.6309,
|
748 |
+
"rewards/accuracies": 0.8125,
|
749 |
+
"rewards/chosen": -3.244718074798584,
|
750 |
+
"rewards/margins": 1.2922370433807373,
|
751 |
+
"rewards/rejected": -4.536954879760742,
|
752 |
+
"step": 410
|
753 |
+
},
|
754 |
+
{
|
755 |
+
"epoch": 0.5333333333333333,
|
756 |
+
"grad_norm": 2.9144859313964844,
|
757 |
+
"learning_rate": 4.093559974371725e-06,
|
758 |
+
"logits/chosen": 9.20117473602295,
|
759 |
+
"logits/rejected": 9.481060028076172,
|
760 |
+
"logps/chosen": -2.7644081115722656,
|
761 |
+
"logps/rejected": -3.905733585357666,
|
762 |
+
"loss": 0.5839,
|
763 |
+
"rewards/accuracies": 0.824999988079071,
|
764 |
+
"rewards/chosen": -4.14661169052124,
|
765 |
+
"rewards/margins": 1.7119888067245483,
|
766 |
+
"rewards/rejected": -5.858600616455078,
|
767 |
+
"step": 420
|
768 |
+
},
|
769 |
+
{
|
770 |
+
"epoch": 0.546031746031746,
|
771 |
+
"grad_norm": 2.4795055389404297,
|
772 |
+
"learning_rate": 4.052869450695776e-06,
|
773 |
+
"logits/chosen": 9.674077987670898,
|
774 |
+
"logits/rejected": 9.64409065246582,
|
775 |
+
"logps/chosen": -2.562514066696167,
|
776 |
+
"logps/rejected": -3.8458714485168457,
|
777 |
+
"loss": 0.5266,
|
778 |
+
"rewards/accuracies": 0.875,
|
779 |
+
"rewards/chosen": -3.843771457672119,
|
780 |
+
"rewards/margins": 1.9250361919403076,
|
781 |
+
"rewards/rejected": -5.768807411193848,
|
782 |
+
"step": 430
|
783 |
+
},
|
784 |
+
{
|
785 |
+
"epoch": 0.5587301587301587,
|
786 |
+
"grad_norm": 1.897057056427002,
|
787 |
+
"learning_rate": 4.011497787155938e-06,
|
788 |
+
"logits/chosen": 8.887510299682617,
|
789 |
+
"logits/rejected": 8.687074661254883,
|
790 |
+
"logps/chosen": -3.2801125049591064,
|
791 |
+
"logps/rejected": -4.673043251037598,
|
792 |
+
"loss": 0.5665,
|
793 |
+
"rewards/accuracies": 0.8500000238418579,
|
794 |
+
"rewards/chosen": -4.920168876647949,
|
795 |
+
"rewards/margins": 2.089395523071289,
|
796 |
+
"rewards/rejected": -7.009564399719238,
|
797 |
+
"step": 440
|
798 |
+
},
|
799 |
+
{
|
800 |
+
"epoch": 0.5714285714285714,
|
801 |
+
"grad_norm": 2.1004762649536133,
|
802 |
+
"learning_rate": 3.969463130731183e-06,
|
803 |
+
"logits/chosen": 8.606618881225586,
|
804 |
+
"logits/rejected": 8.299476623535156,
|
805 |
+
"logps/chosen": -3.3771705627441406,
|
806 |
+
"logps/rejected": -4.999676704406738,
|
807 |
+
"loss": 0.5118,
|
808 |
+
"rewards/accuracies": 0.824999988079071,
|
809 |
+
"rewards/chosen": -5.0657548904418945,
|
810 |
+
"rewards/margins": 2.433760166168213,
|
811 |
+
"rewards/rejected": -7.499515533447266,
|
812 |
+
"step": 450
|
813 |
+
},
|
814 |
+
{
|
815 |
+
"epoch": 0.5714285714285714,
|
816 |
+
"eval_logits/chosen": 8.417736053466797,
|
817 |
+
"eval_logits/rejected": 8.183667182922363,
|
818 |
+
"eval_logps/chosen": -3.3982253074645996,
|
819 |
+
"eval_logps/rejected": -5.010103225708008,
|
820 |
+
"eval_loss": 0.5201926827430725,
|
821 |
+
"eval_rewards/accuracies": 0.796875,
|
822 |
+
"eval_rewards/chosen": -5.0973381996154785,
|
823 |
+
"eval_rewards/margins": 2.4178173542022705,
|
824 |
+
"eval_rewards/rejected": -7.515154838562012,
|
825 |
+
"eval_runtime": 18.6069,
|
826 |
+
"eval_samples_per_second": 27.409,
|
827 |
+
"eval_steps_per_second": 3.44,
|
828 |
+
"step": 450
|
829 |
+
},
|
830 |
+
{
|
831 |
+
"epoch": 0.5841269841269842,
|
832 |
+
"grad_norm": 2.016348123550415,
|
833 |
+
"learning_rate": 3.92678391921108e-06,
|
834 |
+
"logits/chosen": 9.348031997680664,
|
835 |
+
"logits/rejected": 8.707467079162598,
|
836 |
+
"logps/chosen": -3.687103271484375,
|
837 |
+
"logps/rejected": -5.414787769317627,
|
838 |
+
"loss": 0.4783,
|
839 |
+
"rewards/accuracies": 0.875,
|
840 |
+
"rewards/chosen": -5.5306549072265625,
|
841 |
+
"rewards/margins": 2.591526508331299,
|
842 |
+
"rewards/rejected": -8.12218189239502,
|
843 |
+
"step": 460
|
844 |
+
},
|
845 |
+
{
|
846 |
+
"epoch": 0.5968253968253968,
|
847 |
+
"grad_norm": 2.9189071655273438,
|
848 |
+
"learning_rate": 3.88347887310836e-06,
|
849 |
+
"logits/chosen": 8.294754028320312,
|
850 |
+
"logits/rejected": 7.891358852386475,
|
851 |
+
"logps/chosen": -3.737588405609131,
|
852 |
+
"logps/rejected": -5.187026023864746,
|
853 |
+
"loss": 0.534,
|
854 |
+
"rewards/accuracies": 0.875,
|
855 |
+
"rewards/chosen": -5.606382846832275,
|
856 |
+
"rewards/margins": 2.1741559505462646,
|
857 |
+
"rewards/rejected": -7.780538082122803,
|
858 |
+
"step": 470
|
859 |
+
},
|
860 |
+
{
|
861 |
+
"epoch": 0.6095238095238096,
|
862 |
+
"grad_norm": 2.306356906890869,
|
863 |
+
"learning_rate": 3.839566987447492e-06,
|
864 |
+
"logits/chosen": 8.484542846679688,
|
865 |
+
"logits/rejected": 8.39714241027832,
|
866 |
+
"logps/chosen": -3.494408369064331,
|
867 |
+
"logps/rejected": -5.29335880279541,
|
868 |
+
"loss": 0.4829,
|
869 |
+
"rewards/accuracies": 0.925000011920929,
|
870 |
+
"rewards/chosen": -5.241612911224365,
|
871 |
+
"rewards/margins": 2.6984262466430664,
|
872 |
+
"rewards/rejected": -7.940038204193115,
|
873 |
+
"step": 480
|
874 |
+
},
|
875 |
+
{
|
876 |
+
"epoch": 0.6222222222222222,
|
877 |
+
"grad_norm": 2.2581255435943604,
|
878 |
+
"learning_rate": 3.795067523432826e-06,
|
879 |
+
"logits/chosen": 8.763944625854492,
|
880 |
+
"logits/rejected": 8.361797332763672,
|
881 |
+
"logps/chosen": -3.9699864387512207,
|
882 |
+
"logps/rejected": -6.275031566619873,
|
883 |
+
"loss": 0.4437,
|
884 |
+
"rewards/accuracies": 0.949999988079071,
|
885 |
+
"rewards/chosen": -5.954979419708252,
|
886 |
+
"rewards/margins": 3.4575679302215576,
|
887 |
+
"rewards/rejected": -9.412548065185547,
|
888 |
+
"step": 490
|
889 |
+
},
|
890 |
+
{
|
891 |
+
"epoch": 0.6349206349206349,
|
892 |
+
"grad_norm": 2.2695906162261963,
|
893 |
+
"learning_rate": 3.7500000000000005e-06,
|
894 |
+
"logits/chosen": 7.8348212242126465,
|
895 |
+
"logits/rejected": 7.482022285461426,
|
896 |
+
"logps/chosen": -3.7032783031463623,
|
897 |
+
"logps/rejected": -5.9005255699157715,
|
898 |
+
"loss": 0.4411,
|
899 |
+
"rewards/accuracies": 0.887499988079071,
|
900 |
+
"rewards/chosen": -5.554916858673096,
|
901 |
+
"rewards/margins": 3.2958710193634033,
|
902 |
+
"rewards/rejected": -8.850788116455078,
|
903 |
+
"step": 500
|
904 |
+
},
|
905 |
+
{
|
906 |
+
"epoch": 0.6349206349206349,
|
907 |
+
"eval_logits/chosen": 7.651264190673828,
|
908 |
+
"eval_logits/rejected": 7.331784248352051,
|
909 |
+
"eval_logps/chosen": -3.6274948120117188,
|
910 |
+
"eval_logps/rejected": -5.359984874725342,
|
911 |
+
"eval_loss": 0.4819534122943878,
|
912 |
+
"eval_rewards/accuracies": 0.796875,
|
913 |
+
"eval_rewards/chosen": -5.441242694854736,
|
914 |
+
"eval_rewards/margins": 2.5987353324890137,
|
915 |
+
"eval_rewards/rejected": -8.03997802734375,
|
916 |
+
"eval_runtime": 18.6061,
|
917 |
+
"eval_samples_per_second": 27.41,
|
918 |
+
"eval_steps_per_second": 3.44,
|
919 |
+
"step": 500
|
920 |
+
},
|
921 |
+
{
|
922 |
+
"epoch": 0.6476190476190476,
|
923 |
+
"grad_norm": 4.491377353668213,
|
924 |
+
"learning_rate": 3.7043841852542884e-06,
|
925 |
+
"logits/chosen": 8.346134185791016,
|
926 |
+
"logits/rejected": 7.885122776031494,
|
927 |
+
"logps/chosen": -3.1610424518585205,
|
928 |
+
"logps/rejected": -4.682709217071533,
|
929 |
+
"loss": 0.5284,
|
930 |
+
"rewards/accuracies": 0.862500011920929,
|
931 |
+
"rewards/chosen": -4.7415642738342285,
|
932 |
+
"rewards/margins": 2.2825000286102295,
|
933 |
+
"rewards/rejected": -7.0240631103515625,
|
934 |
+
"step": 510
|
935 |
+
},
|
936 |
+
{
|
937 |
+
"epoch": 0.6603174603174603,
|
938 |
+
"grad_norm": 2.4325833320617676,
|
939 |
+
"learning_rate": 3.658240087799655e-06,
|
940 |
+
"logits/chosen": 7.592903137207031,
|
941 |
+
"logits/rejected": 7.519273281097412,
|
942 |
+
"logps/chosen": -3.836571455001831,
|
943 |
+
"logps/rejected": -5.284958839416504,
|
944 |
+
"loss": 0.5357,
|
945 |
+
"rewards/accuracies": 0.8374999761581421,
|
946 |
+
"rewards/chosen": -5.754857063293457,
|
947 |
+
"rewards/margins": 2.1725804805755615,
|
948 |
+
"rewards/rejected": -7.927438259124756,
|
949 |
+
"step": 520
|
950 |
+
},
|
951 |
+
{
|
952 |
+
"epoch": 0.6730158730158731,
|
953 |
+
"grad_norm": 3.2697038650512695,
|
954 |
+
"learning_rate": 3.611587947962319e-06,
|
955 |
+
"logits/chosen": 8.396175384521484,
|
956 |
+
"logits/rejected": 8.135710716247559,
|
957 |
+
"logps/chosen": -3.09209942817688,
|
958 |
+
"logps/rejected": -4.844483375549316,
|
959 |
+
"loss": 0.5079,
|
960 |
+
"rewards/accuracies": 0.862500011920929,
|
961 |
+
"rewards/chosen": -4.638149261474609,
|
962 |
+
"rewards/margins": 2.6285760402679443,
|
963 |
+
"rewards/rejected": -7.266725063323975,
|
964 |
+
"step": 530
|
965 |
+
},
|
966 |
+
{
|
967 |
+
"epoch": 0.6857142857142857,
|
968 |
+
"grad_norm": 3.9283788204193115,
|
969 |
+
"learning_rate": 3.564448228912682e-06,
|
970 |
+
"logits/chosen": 7.992170810699463,
|
971 |
+
"logits/rejected": 7.327617645263672,
|
972 |
+
"logps/chosen": -3.6388747692108154,
|
973 |
+
"logps/rejected": -5.46083927154541,
|
974 |
+
"loss": 0.4713,
|
975 |
+
"rewards/accuracies": 0.8999999761581421,
|
976 |
+
"rewards/chosen": -5.458312511444092,
|
977 |
+
"rewards/margins": 2.7329471111297607,
|
978 |
+
"rewards/rejected": -8.191259384155273,
|
979 |
+
"step": 540
|
980 |
+
},
|
981 |
+
{
|
982 |
+
"epoch": 0.6984126984126984,
|
983 |
+
"grad_norm": 5.740615367889404,
|
984 |
+
"learning_rate": 3.516841607689501e-06,
|
985 |
+
"logits/chosen": 7.8473920822143555,
|
986 |
+
"logits/rejected": 7.583371162414551,
|
987 |
+
"logps/chosen": -3.4951674938201904,
|
988 |
+
"logps/rejected": -5.054746150970459,
|
989 |
+
"loss": 0.5543,
|
990 |
+
"rewards/accuracies": 0.875,
|
991 |
+
"rewards/chosen": -5.242751121520996,
|
992 |
+
"rewards/margins": 2.3393683433532715,
|
993 |
+
"rewards/rejected": -7.582118988037109,
|
994 |
+
"step": 550
|
995 |
+
},
|
996 |
+
{
|
997 |
+
"epoch": 0.6984126984126984,
|
998 |
+
"eval_logits/chosen": 7.201205253601074,
|
999 |
+
"eval_logits/rejected": 6.811280727386475,
|
1000 |
+
"eval_logps/chosen": -3.9208078384399414,
|
1001 |
+
"eval_logps/rejected": -5.703615665435791,
|
1002 |
+
"eval_loss": 0.458388090133667,
|
1003 |
+
"eval_rewards/accuracies": 0.84375,
|
1004 |
+
"eval_rewards/chosen": -5.881211757659912,
|
1005 |
+
"eval_rewards/margins": 2.674211025238037,
|
1006 |
+
"eval_rewards/rejected": -8.555423736572266,
|
1007 |
+
"eval_runtime": 18.6149,
|
1008 |
+
"eval_samples_per_second": 27.397,
|
1009 |
+
"eval_steps_per_second": 3.438,
|
1010 |
+
"step": 550
|
1011 |
+
},
|
1012 |
+
{
|
1013 |
+
"epoch": 0.7111111111111111,
|
1014 |
+
"grad_norm": 2.257397413253784,
|
1015 |
+
"learning_rate": 3.4687889661302577e-06,
|
1016 |
+
"logits/chosen": 7.826712608337402,
|
1017 |
+
"logits/rejected": 7.213566780090332,
|
1018 |
+
"logps/chosen": -4.419582843780518,
|
1019 |
+
"logps/rejected": -6.427667140960693,
|
1020 |
+
"loss": 0.4126,
|
1021 |
+
"rewards/accuracies": 0.8999999761581421,
|
1022 |
+
"rewards/chosen": -6.629374027252197,
|
1023 |
+
"rewards/margins": 3.0121266841888428,
|
1024 |
+
"rewards/rejected": -9.641500473022461,
|
1025 |
+
"step": 560
|
1026 |
+
},
|
1027 |
+
{
|
1028 |
+
"epoch": 0.7238095238095238,
|
1029 |
+
"grad_norm": 3.2082905769348145,
|
1030 |
+
"learning_rate": 3.4203113817116955e-06,
|
1031 |
+
"logits/chosen": 6.789637565612793,
|
1032 |
+
"logits/rejected": 6.794576168060303,
|
1033 |
+
"logps/chosen": -3.8381495475769043,
|
1034 |
+
"logps/rejected": -5.592730522155762,
|
1035 |
+
"loss": 0.4379,
|
1036 |
+
"rewards/accuracies": 0.8999999761581421,
|
1037 |
+
"rewards/chosen": -5.757224082946777,
|
1038 |
+
"rewards/margins": 2.6318702697753906,
|
1039 |
+
"rewards/rejected": -8.389094352722168,
|
1040 |
+
"step": 570
|
1041 |
+
},
|
1042 |
+
{
|
1043 |
+
"epoch": 0.7365079365079366,
|
1044 |
+
"grad_norm": 1.4739922285079956,
|
1045 |
+
"learning_rate": 3.3714301183045382e-06,
|
1046 |
+
"logits/chosen": 6.731423854827881,
|
1047 |
+
"logits/rejected": 6.7872209548950195,
|
1048 |
+
"logps/chosen": -2.9625697135925293,
|
1049 |
+
"logps/rejected": -4.8117570877075195,
|
1050 |
+
"loss": 0.4483,
|
1051 |
+
"rewards/accuracies": 0.925000011920929,
|
1052 |
+
"rewards/chosen": -4.443854808807373,
|
1053 |
+
"rewards/margins": 2.773780345916748,
|
1054 |
+
"rewards/rejected": -7.217635154724121,
|
1055 |
+
"step": 580
|
1056 |
+
},
|
1057 |
+
{
|
1058 |
+
"epoch": 0.7492063492063492,
|
1059 |
+
"grad_norm": 2.3974905014038086,
|
1060 |
+
"learning_rate": 3.3221666168464584e-06,
|
1061 |
+
"logits/chosen": 7.254199981689453,
|
1062 |
+
"logits/rejected": 6.7625627517700195,
|
1063 |
+
"logps/chosen": -3.562770366668701,
|
1064 |
+
"logps/rejected": -5.307286262512207,
|
1065 |
+
"loss": 0.4229,
|
1066 |
+
"rewards/accuracies": 0.887499988079071,
|
1067 |
+
"rewards/chosen": -5.344155788421631,
|
1068 |
+
"rewards/margins": 2.616774082183838,
|
1069 |
+
"rewards/rejected": -7.960929870605469,
|
1070 |
+
"step": 590
|
1071 |
+
},
|
1072 |
+
{
|
1073 |
+
"epoch": 0.7619047619047619,
|
1074 |
+
"grad_norm": 2.3709428310394287,
|
1075 |
+
"learning_rate": 3.272542485937369e-06,
|
1076 |
+
"logits/chosen": 7.226127624511719,
|
1077 |
+
"logits/rejected": 6.73668909072876,
|
1078 |
+
"logps/chosen": -3.8387343883514404,
|
1079 |
+
"logps/rejected": -5.65582275390625,
|
1080 |
+
"loss": 0.4304,
|
1081 |
+
"rewards/accuracies": 0.887499988079071,
|
1082 |
+
"rewards/chosen": -5.7581024169921875,
|
1083 |
+
"rewards/margins": 2.725632429122925,
|
1084 |
+
"rewards/rejected": -8.483735084533691,
|
1085 |
+
"step": 600
|
1086 |
+
},
|
1087 |
+
{
|
1088 |
+
"epoch": 0.7619047619047619,
|
1089 |
+
"eval_logits/chosen": 6.816856861114502,
|
1090 |
+
"eval_logits/rejected": 6.3922905921936035,
|
1091 |
+
"eval_logps/chosen": -3.8147382736206055,
|
1092 |
+
"eval_logps/rejected": -5.733050346374512,
|
1093 |
+
"eval_loss": 0.43386051058769226,
|
1094 |
+
"eval_rewards/accuracies": 0.875,
|
1095 |
+
"eval_rewards/chosen": -5.722107410430908,
|
1096 |
+
"eval_rewards/margins": 2.877467393875122,
|
1097 |
+
"eval_rewards/rejected": -8.59957504272461,
|
1098 |
+
"eval_runtime": 18.5848,
|
1099 |
+
"eval_samples_per_second": 27.442,
|
1100 |
+
"eval_steps_per_second": 3.444,
|
1101 |
+
"step": 600
|
1102 |
+
},
|
1103 |
+
{
|
1104 |
+
"epoch": 0.7746031746031746,
|
1105 |
+
"grad_norm": 8.223690032958984,
|
1106 |
+
"learning_rate": 3.222579492361179e-06,
|
1107 |
+
"logits/chosen": 6.017186164855957,
|
1108 |
+
"logits/rejected": 6.098165988922119,
|
1109 |
+
"logps/chosen": -4.070714950561523,
|
1110 |
+
"logps/rejected": -5.999022006988525,
|
1111 |
+
"loss": 0.4752,
|
1112 |
+
"rewards/accuracies": 0.862500011920929,
|
1113 |
+
"rewards/chosen": -6.106072902679443,
|
1114 |
+
"rewards/margins": 2.8924598693847656,
|
1115 |
+
"rewards/rejected": -8.998533248901367,
|
1116 |
+
"step": 610
|
1117 |
+
},
|
1118 |
+
{
|
1119 |
+
"epoch": 0.7873015873015873,
|
1120 |
+
"grad_norm": 2.494403839111328,
|
1121 |
+
"learning_rate": 3.1722995515381644e-06,
|
1122 |
+
"logits/chosen": 5.941250801086426,
|
1123 |
+
"logits/rejected": 5.958924770355225,
|
1124 |
+
"logps/chosen": -3.984475612640381,
|
1125 |
+
"logps/rejected": -5.801859378814697,
|
1126 |
+
"loss": 0.4245,
|
1127 |
+
"rewards/accuracies": 0.887499988079071,
|
1128 |
+
"rewards/chosen": -5.97671365737915,
|
1129 |
+
"rewards/margins": 2.726074695587158,
|
1130 |
+
"rewards/rejected": -8.702788352966309,
|
1131 |
+
"step": 620
|
1132 |
+
},
|
1133 |
+
{
|
1134 |
+
"epoch": 0.8,
|
1135 |
+
"grad_norm": 1.906548023223877,
|
1136 |
+
"learning_rate": 3.121724717912138e-06,
|
1137 |
+
"logits/chosen": 6.673853874206543,
|
1138 |
+
"logits/rejected": 6.525673866271973,
|
1139 |
+
"logps/chosen": -3.4477615356445312,
|
1140 |
+
"logps/rejected": -5.480903148651123,
|
1141 |
+
"loss": 0.3671,
|
1142 |
+
"rewards/accuracies": 0.925000011920929,
|
1143 |
+
"rewards/chosen": -5.171643257141113,
|
1144 |
+
"rewards/margins": 3.0497121810913086,
|
1145 |
+
"rewards/rejected": -8.221354484558105,
|
1146 |
+
"step": 630
|
1147 |
+
},
|
1148 |
+
{
|
1149 |
+
"epoch": 0.8126984126984127,
|
1150 |
+
"grad_norm": 3.656189441680908,
|
1151 |
+
"learning_rate": 3.0708771752766397e-06,
|
1152 |
+
"logits/chosen": 6.097588062286377,
|
1153 |
+
"logits/rejected": 6.049706935882568,
|
1154 |
+
"logps/chosen": -3.8336167335510254,
|
1155 |
+
"logps/rejected": -5.6922125816345215,
|
1156 |
+
"loss": 0.4461,
|
1157 |
+
"rewards/accuracies": 0.875,
|
1158 |
+
"rewards/chosen": -5.750425338745117,
|
1159 |
+
"rewards/margins": 2.787893772125244,
|
1160 |
+
"rewards/rejected": -8.53831958770752,
|
1161 |
+
"step": 640
|
1162 |
+
},
|
1163 |
+
{
|
1164 |
+
"epoch": 0.8253968253968254,
|
1165 |
+
"grad_norm": 4.886603355407715,
|
1166 |
+
"learning_rate": 3.019779227044398e-06,
|
1167 |
+
"logits/chosen": 7.281914710998535,
|
1168 |
+
"logits/rejected": 7.21079158782959,
|
1169 |
+
"logps/chosen": -3.3890902996063232,
|
1170 |
+
"logps/rejected": -5.331442356109619,
|
1171 |
+
"loss": 0.4231,
|
1172 |
+
"rewards/accuracies": 0.949999988079071,
|
1173 |
+
"rewards/chosen": -5.083634853363037,
|
1174 |
+
"rewards/margins": 2.9135282039642334,
|
1175 |
+
"rewards/rejected": -7.99716329574585,
|
1176 |
+
"step": 650
|
1177 |
+
},
|
1178 |
+
{
|
1179 |
+
"epoch": 0.8253968253968254,
|
1180 |
+
"eval_logits/chosen": 7.003323554992676,
|
1181 |
+
"eval_logits/rejected": 6.476384162902832,
|
1182 |
+
"eval_logps/chosen": -3.6840155124664307,
|
1183 |
+
"eval_logps/rejected": -5.79384708404541,
|
1184 |
+
"eval_loss": 0.4155474007129669,
|
1185 |
+
"eval_rewards/accuracies": 0.875,
|
1186 |
+
"eval_rewards/chosen": -5.5260233879089355,
|
1187 |
+
"eval_rewards/margins": 3.164747476577759,
|
1188 |
+
"eval_rewards/rejected": -8.690771102905273,
|
1189 |
+
"eval_runtime": 18.6081,
|
1190 |
+
"eval_samples_per_second": 27.407,
|
1191 |
+
"eval_steps_per_second": 3.439,
|
1192 |
+
"step": 650
|
1193 |
+
},
|
1194 |
+
{
|
1195 |
+
"epoch": 0.8380952380952381,
|
1196 |
+
"grad_norm": 4.255698204040527,
|
1197 |
+
"learning_rate": 2.9684532864643123e-06,
|
1198 |
+
"logits/chosen": 7.213356018066406,
|
1199 |
+
"logits/rejected": 6.562827110290527,
|
1200 |
+
"logps/chosen": -4.553462505340576,
|
1201 |
+
"logps/rejected": -7.089639186859131,
|
1202 |
+
"loss": 0.4137,
|
1203 |
+
"rewards/accuracies": 0.925000011920929,
|
1204 |
+
"rewards/chosen": -6.830193996429443,
|
1205 |
+
"rewards/margins": 3.804264783859253,
|
1206 |
+
"rewards/rejected": -10.6344575881958,
|
1207 |
+
"step": 660
|
1208 |
+
},
|
1209 |
+
{
|
1210 |
+
"epoch": 0.8507936507936508,
|
1211 |
+
"grad_norm": 2.784740924835205,
|
1212 |
+
"learning_rate": 2.9169218667902562e-06,
|
1213 |
+
"logits/chosen": 7.139246463775635,
|
1214 |
+
"logits/rejected": 7.061759948730469,
|
1215 |
+
"logps/chosen": -3.2805087566375732,
|
1216 |
+
"logps/rejected": -5.112305641174316,
|
1217 |
+
"loss": 0.4138,
|
1218 |
+
"rewards/accuracies": 0.875,
|
1219 |
+
"rewards/chosen": -4.920762538909912,
|
1220 |
+
"rewards/margins": 2.7476963996887207,
|
1221 |
+
"rewards/rejected": -7.668459415435791,
|
1222 |
+
"step": 670
|
1223 |
+
},
|
1224 |
+
{
|
1225 |
+
"epoch": 0.8634920634920635,
|
1226 |
+
"grad_norm": 2.966514825820923,
|
1227 |
+
"learning_rate": 2.8652075714060296e-06,
|
1228 |
+
"logits/chosen": 7.687324523925781,
|
1229 |
+
"logits/rejected": 6.8130292892456055,
|
1230 |
+
"logps/chosen": -3.9359238147735596,
|
1231 |
+
"logps/rejected": -6.452606201171875,
|
1232 |
+
"loss": 0.4267,
|
1233 |
+
"rewards/accuracies": 0.949999988079071,
|
1234 |
+
"rewards/chosen": -5.903885841369629,
|
1235 |
+
"rewards/margins": 3.7750232219696045,
|
1236 |
+
"rewards/rejected": -9.678911209106445,
|
1237 |
+
"step": 680
|
1238 |
+
},
|
1239 |
+
{
|
1240 |
+
"epoch": 0.8761904761904762,
|
1241 |
+
"grad_norm": 2.919829845428467,
|
1242 |
+
"learning_rate": 2.813333083910761e-06,
|
1243 |
+
"logits/chosen": 7.361714839935303,
|
1244 |
+
"logits/rejected": 6.8447113037109375,
|
1245 |
+
"logps/chosen": -4.811502456665039,
|
1246 |
+
"logps/rejected": -7.118119716644287,
|
1247 |
+
"loss": 0.3531,
|
1248 |
+
"rewards/accuracies": 0.9375,
|
1249 |
+
"rewards/chosen": -7.217253684997559,
|
1250 |
+
"rewards/margins": 3.4599266052246094,
|
1251 |
+
"rewards/rejected": -10.677180290222168,
|
1252 |
+
"step": 690
|
1253 |
+
},
|
1254 |
+
{
|
1255 |
+
"epoch": 0.8888888888888888,
|
1256 |
+
"grad_norm": 4.350555896759033,
|
1257 |
+
"learning_rate": 2.761321158169134e-06,
|
1258 |
+
"logits/chosen": 7.161977291107178,
|
1259 |
+
"logits/rejected": 6.46688985824585,
|
1260 |
+
"logps/chosen": -5.0110602378845215,
|
1261 |
+
"logps/rejected": -7.346589088439941,
|
1262 |
+
"loss": 0.4327,
|
1263 |
+
"rewards/accuracies": 0.8374999761581421,
|
1264 |
+
"rewards/chosen": -7.516589164733887,
|
1265 |
+
"rewards/margins": 3.503293514251709,
|
1266 |
+
"rewards/rejected": -11.01988410949707,
|
1267 |
+
"step": 700
|
1268 |
+
},
|
1269 |
+
{
|
1270 |
+
"epoch": 0.8888888888888888,
|
1271 |
+
"eval_logits/chosen": 6.070926666259766,
|
1272 |
+
"eval_logits/rejected": 5.528128147125244,
|
1273 |
+
"eval_logps/chosen": -4.264724254608154,
|
1274 |
+
"eval_logps/rejected": -6.332221031188965,
|
1275 |
+
"eval_loss": 0.40030673146247864,
|
1276 |
+
"eval_rewards/accuracies": 0.875,
|
1277 |
+
"eval_rewards/chosen": -6.3970866203308105,
|
1278 |
+
"eval_rewards/margins": 3.1012446880340576,
|
1279 |
+
"eval_rewards/rejected": -9.498331069946289,
|
1280 |
+
"eval_runtime": 18.5969,
|
1281 |
+
"eval_samples_per_second": 27.424,
|
1282 |
+
"eval_steps_per_second": 3.441,
|
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": 1.70148503127851e+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:a5596c575b3ac9598d22b9072a75c78c8a21b1561e291767fb4db4d3d0245393
|
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)
|