PEFT
Safetensors
chen commited on
Commit
e00903b
·
verified ·
1 Parent(s): cb89c60

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: meta-llama/Llama-3.2-11B-Vision-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.15.2
adapter_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "/data1/chenjiazun/LLM/Llama-3.2-11B-Vision-Instruct",
5
+ "bias": "none",
6
+ "corda_config": null,
7
+ "eva_config": null,
8
+ "exclude_modules": null,
9
+ "fan_in_fan_out": false,
10
+ "inference_mode": true,
11
+ "init_lora_weights": true,
12
+ "layer_replication": null,
13
+ "layers_pattern": null,
14
+ "layers_to_transform": null,
15
+ "loftq_config": {},
16
+ "lora_alpha": 32,
17
+ "lora_bias": false,
18
+ "lora_dropout": 0.05,
19
+ "megatron_config": null,
20
+ "megatron_core": "megatron.core",
21
+ "modules_to_save": [],
22
+ "peft_type": "LORA",
23
+ "r": 16,
24
+ "rank_pattern": {},
25
+ "revision": null,
26
+ "target_modules": "(?!^(multi_modal_projector))^(language_model|vision_model).*\\.(down_proj|gate_proj|v_proj|q_proj|o_proj|k_proj|up_proj|fc1|fc2|v_proj|q_proj|o_proj|k_proj)$",
27
+ "task_type": "CAUSAL_LM",
28
+ "trainable_token_indices": null,
29
+ "use_dora": false,
30
+ "use_rslora": false
31
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d745b7006942c8219cab2941dcf8a814443536cf05114088016b8902b9b15291
3
+ size 134506880
additional_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"lora_dtype": null, "lorap_lr_ratio": null, "lorap_emb_lr": 1e-06}
args.json ADDED
@@ -0,0 +1,450 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "/data1/chenjiazun/LLM/Llama-3.2-11B-Vision-Instruct",
3
+ "model_type": "llama3_2_vision",
4
+ "model_revision": null,
5
+ "task_type": "causal_lm",
6
+ "torch_dtype": "bfloat16",
7
+ "attn_impl": null,
8
+ "num_labels": null,
9
+ "problem_type": null,
10
+ "rope_scaling": null,
11
+ "device_map": null,
12
+ "max_memory": {},
13
+ "local_repo_path": null,
14
+ "template": "llama3_2_vision",
15
+ "system": null,
16
+ "max_length": 8092,
17
+ "truncation_strategy": "left",
18
+ "max_pixels": null,
19
+ "agent_template": null,
20
+ "norm_bbox": null,
21
+ "response_prefix": null,
22
+ "padding_side": "right",
23
+ "loss_scale": "last_round",
24
+ "sequence_parallel_size": 1,
25
+ "use_chat_template": true,
26
+ "template_backend": "swift",
27
+ "dataset": [
28
+ "./new_task1_nothink_respone_onlycorrect.json"
29
+ ],
30
+ "val_dataset": [],
31
+ "split_dataset_ratio": 0.01,
32
+ "data_seed": 42,
33
+ "dataset_num_proc": 1,
34
+ "dataset_shuffle": true,
35
+ "val_dataset_shuffle": false,
36
+ "streaming": false,
37
+ "interleave_prob": null,
38
+ "stopping_strategy": "first_exhausted",
39
+ "shuffle_buffer_size": 1000,
40
+ "enable_cache": false,
41
+ "download_mode": "reuse_dataset_if_exists",
42
+ "columns": {},
43
+ "strict": false,
44
+ "remove_unused_columns": false,
45
+ "model_name": [
46
+ null,
47
+ null
48
+ ],
49
+ "model_author": [
50
+ null,
51
+ null
52
+ ],
53
+ "custom_dataset_info": [],
54
+ "quant_method": null,
55
+ "quant_bits": null,
56
+ "hqq_axis": null,
57
+ "bnb_4bit_compute_dtype": "bfloat16",
58
+ "bnb_4bit_quant_type": "nf4",
59
+ "bnb_4bit_use_double_quant": true,
60
+ "bnb_4bit_quant_storage": null,
61
+ "max_new_tokens": 64,
62
+ "temperature": 1.0,
63
+ "top_k": 50,
64
+ "top_p": 0.9,
65
+ "repetition_penalty": 1.1,
66
+ "num_beams": 1,
67
+ "stream": false,
68
+ "stop_words": [],
69
+ "logprobs": false,
70
+ "top_logprobs": null,
71
+ "ckpt_dir": null,
72
+ "load_dataset_config": null,
73
+ "lora_modules": [],
74
+ "tuner_backend": "peft",
75
+ "train_type": "lora",
76
+ "adapters": [],
77
+ "external_plugins": [
78
+ "/data/kdd/crag/cjz/ms-swift/examples/train/grpo/plugin/plugin.py"
79
+ ],
80
+ "seed": 42,
81
+ "model_kwargs": {},
82
+ "load_args": false,
83
+ "load_data_args": false,
84
+ "use_hf": false,
85
+ "hub_token": null,
86
+ "custom_register_path": [],
87
+ "ignore_args_error": false,
88
+ "use_swift_lora": false,
89
+ "output_dir": "/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v10-20250518-175827",
90
+ "overwrite_output_dir": false,
91
+ "do_train": false,
92
+ "do_eval": false,
93
+ "do_predict": false,
94
+ "eval_strategy": "steps",
95
+ "prediction_loss_only": false,
96
+ "per_device_train_batch_size": 8,
97
+ "per_device_eval_batch_size": 8,
98
+ "per_gpu_train_batch_size": null,
99
+ "per_gpu_eval_batch_size": null,
100
+ "gradient_accumulation_steps": 16,
101
+ "eval_accumulation_steps": null,
102
+ "eval_delay": 0,
103
+ "torch_empty_cache_steps": null,
104
+ "learning_rate": 0.0002,
105
+ "weight_decay": 0.1,
106
+ "adam_beta1": 0.9,
107
+ "adam_beta2": 0.95,
108
+ "adam_epsilon": 1e-08,
109
+ "max_grad_norm": 0.5,
110
+ "num_train_epochs": 4.0,
111
+ "max_steps": -1,
112
+ "lr_scheduler_type": "cosine",
113
+ "lr_scheduler_kwargs": null,
114
+ "warmup_ratio": 0.05,
115
+ "warmup_steps": 0,
116
+ "log_level": "passive",
117
+ "log_level_replica": "warning",
118
+ "log_on_each_node": true,
119
+ "logging_dir": "/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v10-20250518-175827/runs",
120
+ "logging_strategy": "steps",
121
+ "logging_first_step": true,
122
+ "logging_steps": 1,
123
+ "logging_nan_inf_filter": true,
124
+ "save_strategy": "steps",
125
+ "save_steps": 5.0,
126
+ "save_total_limit": null,
127
+ "save_safetensors": true,
128
+ "save_on_each_node": false,
129
+ "save_only_model": false,
130
+ "restore_callback_states_from_checkpoint": false,
131
+ "no_cuda": false,
132
+ "use_cpu": false,
133
+ "use_mps_device": false,
134
+ "jit_mode_eval": false,
135
+ "use_ipex": false,
136
+ "bf16": true,
137
+ "fp16": false,
138
+ "fp16_opt_level": "O1",
139
+ "half_precision_backend": "auto",
140
+ "bf16_full_eval": false,
141
+ "fp16_full_eval": false,
142
+ "tf32": null,
143
+ "local_rank": 0,
144
+ "ddp_backend": null,
145
+ "tpu_num_cores": null,
146
+ "tpu_metrics_debug": false,
147
+ "debug": null,
148
+ "dataloader_drop_last": true,
149
+ "eval_steps": 500.0,
150
+ "dataloader_num_workers": 4,
151
+ "dataloader_prefetch_factor": null,
152
+ "past_index": -1,
153
+ "run_name": null,
154
+ "disable_tqdm": null,
155
+ "label_names": null,
156
+ "load_best_model_at_end": false,
157
+ "metric_for_best_model": "reward",
158
+ "greater_is_better": true,
159
+ "ignore_data_skip": false,
160
+ "fsdp": "",
161
+ "fsdp_min_num_params": 0,
162
+ "fsdp_config": null,
163
+ "tp_size": 0,
164
+ "fsdp_transformer_layer_cls_to_wrap": null,
165
+ "accelerator_config": {
166
+ "dispatch_batches": false
167
+ },
168
+ "deepspeed": {
169
+ "fp16": {
170
+ "enabled": "auto",
171
+ "loss_scale": 0,
172
+ "loss_scale_window": 1000,
173
+ "initial_scale_power": 16,
174
+ "hysteresis": 2,
175
+ "min_loss_scale": 1
176
+ },
177
+ "bf16": {
178
+ "enabled": "auto"
179
+ },
180
+ "zero_optimization": {
181
+ "stage": 3,
182
+ "offload_optimizer": {
183
+ "device": "none",
184
+ "pin_memory": true
185
+ },
186
+ "offload_param": {
187
+ "device": "none",
188
+ "pin_memory": true
189
+ },
190
+ "overlap_comm": false,
191
+ "contiguous_gradients": true,
192
+ "sub_group_size": 1000000000.0,
193
+ "reduce_bucket_size": "auto",
194
+ "zero_quantized_weights": false,
195
+ "zero_quantized_gradients": false,
196
+ "stage3_prefetch_bucket_size": "auto",
197
+ "stage3_param_persistence_threshold": "auto",
198
+ "stage3_max_live_parameters": 1000000000.0,
199
+ "stage3_max_reuse_distance": 1000000000.0,
200
+ "stage3_gather_16bit_weights_on_model_save": true
201
+ },
202
+ "gradient_accumulation_steps": "auto",
203
+ "gradient_clipping": "auto",
204
+ "steps_per_print": 2000,
205
+ "train_batch_size": "auto",
206
+ "train_micro_batch_size_per_gpu": "auto",
207
+ "wall_clock_breakdown": false
208
+ },
209
+ "label_smoothing_factor": 0.0,
210
+ "optim": "adamw_torch",
211
+ "optim_args": null,
212
+ "adafactor": false,
213
+ "group_by_length": false,
214
+ "length_column_name": "length",
215
+ "report_to": [
216
+ "tensorboard"
217
+ ],
218
+ "ddp_find_unused_parameters": null,
219
+ "ddp_bucket_cap_mb": null,
220
+ "ddp_broadcast_buffers": null,
221
+ "dataloader_pin_memory": true,
222
+ "dataloader_persistent_workers": false,
223
+ "skip_memory_metrics": true,
224
+ "use_legacy_prediction_loop": false,
225
+ "push_to_hub": false,
226
+ "resume_from_checkpoint": "/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v9-20250518-172344/checkpoint-15",
227
+ "hub_model_id": null,
228
+ "hub_strategy": "every_save",
229
+ "hub_private_repo": null,
230
+ "hub_always_push": false,
231
+ "gradient_checkpointing": true,
232
+ "gradient_checkpointing_kwargs": null,
233
+ "include_inputs_for_metrics": false,
234
+ "include_for_metrics": [],
235
+ "eval_do_concat_batches": true,
236
+ "fp16_backend": "auto",
237
+ "push_to_hub_model_id": null,
238
+ "push_to_hub_organization": null,
239
+ "push_to_hub_token": null,
240
+ "mp_parameters": "",
241
+ "auto_find_batch_size": false,
242
+ "full_determinism": false,
243
+ "torchdynamo": null,
244
+ "ray_scope": "last",
245
+ "ddp_timeout": 1800,
246
+ "torch_compile": false,
247
+ "torch_compile_backend": null,
248
+ "torch_compile_mode": null,
249
+ "include_tokens_per_second": false,
250
+ "include_num_input_tokens_seen": false,
251
+ "neftune_noise_alpha": null,
252
+ "optim_target_modules": null,
253
+ "batch_eval_metrics": false,
254
+ "eval_on_start": false,
255
+ "use_liger_kernel": false,
256
+ "eval_use_gather_object": false,
257
+ "average_tokens_across_devices": false,
258
+ "sortish_sampler": false,
259
+ "predict_with_generate": false,
260
+ "generation_max_length": null,
261
+ "generation_num_beams": null,
262
+ "generation_config": null,
263
+ "check_model": true,
264
+ "acc_strategy": "token",
265
+ "train_dataloader_shuffle": true,
266
+ "metric_warmup_step": 0,
267
+ "fsdp_num": 1,
268
+ "acc_steps": 1,
269
+ "eval_use_evalscope": false,
270
+ "eval_datasets": [],
271
+ "eval_limit": null,
272
+ "eval_datasets_args": null,
273
+ "eval_generation_config": null,
274
+ "freeze_parameters": [
275
+ "multi_modal_projector"
276
+ ],
277
+ "freeze_parameters_ratio": 0.0,
278
+ "trainable_parameters": [],
279
+ "freeze_llm": false,
280
+ "freeze_vit": false,
281
+ "freeze_aligner": true,
282
+ "target_modules": [
283
+ "all-linear"
284
+ ],
285
+ "target_regex": null,
286
+ "modules_to_save": [],
287
+ "lora_rank": 16,
288
+ "lora_alpha": 32,
289
+ "lora_dropout": 0.05,
290
+ "lora_bias": "none",
291
+ "lora_dtype": null,
292
+ "lorap_lr_ratio": null,
293
+ "use_rslora": false,
294
+ "use_dora": false,
295
+ "lora_ga_batch_size": 2,
296
+ "lora_ga_iters": 2,
297
+ "lora_ga_max_length": 1024,
298
+ "lora_ga_direction": "ArB2r",
299
+ "lora_ga_scale": "stable",
300
+ "lora_ga_stable_gamma": 16,
301
+ "init_weights": true,
302
+ "fourier_n_frequency": 2000,
303
+ "fourier_scaling": 300.0,
304
+ "boft_block_size": 4,
305
+ "boft_block_num": 0,
306
+ "boft_n_butterfly_factor": 1,
307
+ "boft_dropout": 0.0,
308
+ "vera_rank": 256,
309
+ "vera_projection_prng_key": 0,
310
+ "vera_dropout": 0.0,
311
+ "vera_d_initial": 0.1,
312
+ "adapter_act": "gelu",
313
+ "adapter_length": 128,
314
+ "use_galore": false,
315
+ "galore_target_modules": null,
316
+ "galore_rank": 128,
317
+ "galore_update_proj_gap": 50,
318
+ "galore_scale": 1.0,
319
+ "galore_proj_type": "std",
320
+ "galore_optim_per_parameter": false,
321
+ "galore_with_embedding": false,
322
+ "galore_quantization": false,
323
+ "galore_proj_quant": false,
324
+ "galore_proj_bits": 4,
325
+ "galore_proj_group_size": 256,
326
+ "galore_cos_threshold": 0.4,
327
+ "galore_gamma_proj": 2,
328
+ "galore_queue_size": 5,
329
+ "adalora_target_r": 8,
330
+ "adalora_init_r": 12,
331
+ "adalora_tinit": 0,
332
+ "adalora_tfinal": 0,
333
+ "adalora_deltaT": 1,
334
+ "adalora_beta1": 0.85,
335
+ "adalora_beta2": 0.85,
336
+ "adalora_orth_reg_weight": 0.5,
337
+ "llamapro_num_new_blocks": 4,
338
+ "llamapro_num_groups": null,
339
+ "lisa_activated_layers": 0,
340
+ "lisa_step_interval": 20,
341
+ "reft_layer_key": null,
342
+ "reft_layers": null,
343
+ "reft_rank": 4,
344
+ "reft_intervention_type": "LoreftIntervention",
345
+ "reft_args": null,
346
+ "swanlab_token": null,
347
+ "swanlab_project": null,
348
+ "swanlab_workspace": null,
349
+ "swanlab_exp_name": null,
350
+ "swanlab_mode": "cloud",
351
+ "add_version": true,
352
+ "resume_only_model": false,
353
+ "create_checkpoint_symlink": false,
354
+ "packing": false,
355
+ "lazy_tokenize": true,
356
+ "loss_type": "grpo",
357
+ "optimizer": null,
358
+ "metric": null,
359
+ "zero_hpz_partition_size": null,
360
+ "reward_model": null,
361
+ "reward_adapters": [],
362
+ "reward_model_type": null,
363
+ "reward_model_revision": null,
364
+ "num_ppo_epochs": 4,
365
+ "whiten_rewards": false,
366
+ "kl_coef": 0.05,
367
+ "cliprange": 0.2,
368
+ "vf_coef": 0.1,
369
+ "cliprange_value": 0.2,
370
+ "gamma": 1.0,
371
+ "lam": 0.95,
372
+ "num_mini_batches": 1,
373
+ "local_rollout_forward_batch_size": 64,
374
+ "num_sample_generations": 10,
375
+ "response_length": 512,
376
+ "missing_eos_penalty": null,
377
+ "epsilon": 0.2,
378
+ "epsilon_high": 0.28,
379
+ "num_infer_workers": 1,
380
+ "vllm_device": [
381
+ "auto"
382
+ ],
383
+ "vllm_gpu_memory_utilization": 0.8,
384
+ "vllm_max_model_len": 8192,
385
+ "vllm_max_num_seqs": 8,
386
+ "vllm_enforce_eager": false,
387
+ "vllm_limit_mm_per_prompt": null,
388
+ "vllm_enable_prefix_caching": true,
389
+ "cosine_min_len_value_wrong": -0.5,
390
+ "cosine_max_len_value_wrong": 0.0,
391
+ "cosine_min_len_value_correct": 1.0,
392
+ "cosine_max_len_value_correct": 0.5,
393
+ "cosine_max_len": null,
394
+ "repetition_n_grams": 3,
395
+ "repetition_max_penalty": -1.0,
396
+ "use_lmdeploy": false,
397
+ "lmdeploy_device": "auto",
398
+ "lmdeploy_session_len": null,
399
+ "lmdeploy_cache_max_entry_count": 0.8,
400
+ "async_generate": false,
401
+ "tensor_parallel_size": 1,
402
+ "sleep_level": 0,
403
+ "move_model_batches": null,
404
+ "offload_optimizer": false,
405
+ "offload_model": false,
406
+ "gc_collect_after_offload": false,
407
+ "multi_turn_func": null,
408
+ "dynamic_sample": false,
409
+ "max_resample_times": 3,
410
+ "overlong_filter": false,
411
+ "soft_max_length": null,
412
+ "soft_cache_length": 20,
413
+ "scale_rewards": true,
414
+ "wandb_log_unique_prompts": null,
415
+ "vllm_server_host": null,
416
+ "vllm_server_port": 8000,
417
+ "vllm_server_timeout": 240.0,
418
+ "num_generations": 8,
419
+ "max_completion_length": 50,
420
+ "ds3_gather_for_generation": true,
421
+ "reward_funcs": [
422
+ "Response_no_think_reward"
423
+ ],
424
+ "reward_weights": null,
425
+ "log_completions": true,
426
+ "use_vllm": true,
427
+ "num_iterations": 2,
428
+ "rlhf_type": "grpo",
429
+ "ref_model": null,
430
+ "ref_model_type": null,
431
+ "ref_model_revision": null,
432
+ "beta": 0.0001,
433
+ "label_smoothing": 0,
434
+ "rpo_alpha": 1.0,
435
+ "cpo_alpha": 1.0,
436
+ "simpo_gamma": 1,
437
+ "desirable_weight": 1.0,
438
+ "undesirable_weight": 1.0,
439
+ "center_rewards_coefficient": null,
440
+ "rank": 0,
441
+ "global_world_size": 1,
442
+ "local_world_size": 1,
443
+ "model_suffix": "Llama-3.2-11B-Vision-Instruct",
444
+ "model_info": "ModelInfo(model_type='llama3_2_vision', model_dir='/data1/chenjiazun/LLM/Llama-3.2-11B-Vision-Instruct', torch_dtype=torch.bfloat16, max_model_len=131072, quant_method=None, quant_bits=None, rope_scaling={'factor': 8.0, 'high_freq_factor': 4.0, 'low_freq_factor': 1.0, 'original_max_position_embeddings': 8192, 'rope_type': 'llama3'}, config=None, task_type='causal_lm', num_labels=None)",
445
+ "model_meta": "ModelMeta(model_type='llama3_2_vision', model_groups=[ModelGroup(models=[Model(ms_model_id='LLM-Research/Llama-3.2-11B-Vision-Instruct', hf_model_id='meta-llama/Llama-3.2-11B-Vision-Instruct', model_path=None, ms_revision=None, hf_revision=None), Model(ms_model_id='LLM-Research/Llama-3.2-90B-Vision-Instruct', hf_model_id='meta-llama/Llama-3.2-90B-Vision-Instruct', model_path=None, ms_revision=None, hf_revision=None), Model(ms_model_id='LLM-Research/Llama-3.2-11B-Vision', hf_model_id='meta-llama/Llama-3.2-11B-Vision', model_path=None, ms_revision=None, hf_revision=None), Model(ms_model_id='LLM-Research/Llama-3.2-90B-Vision', hf_model_id='meta-llama/Llama-3.2-90B-Vision', model_path=None, ms_revision=None, hf_revision=None)], ignore_patterns=None, requires=None, tags=[])], template='llama3_2_vision', get_function=<function get_model_tokenizer_llama3_2_vision at 0x7e5165f700d0>, model_arch='llama3_2_vision', architectures=['MllamaForConditionalGeneration'], additional_saved_files=[], torch_dtype=None, is_multimodal=True, is_reward=False, task_type=None, ignore_patterns=None, requires=['transformers>=4.45'], tags=[])",
446
+ "model_dir": "/data1/chenjiazun/LLM/Llama-3.2-11B-Vision-Instruct",
447
+ "hub": "<class 'swift.hub.hub.MSHub'>",
448
+ "evaluation_strategy": "steps",
449
+ "training_args": "GRPOConfig(output_dir='/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v10-20250518-175827', overwrite_output_dir=False, do_train=False, do_eval=True, do_predict=False, eval_strategy=<IntervalStrategy.STEPS: 'steps'>, prediction_loss_only=False, per_device_train_batch_size=8, per_device_eval_batch_size=8, per_gpu_train_batch_size=None, per_gpu_eval_batch_size=None, gradient_accumulation_steps=16, eval_accumulation_steps=None, eval_delay=0, torch_empty_cache_steps=None, learning_rate=0.0002, weight_decay=0.1, adam_beta1=0.9, adam_beta2=0.95, adam_epsilon=1e-08, max_grad_norm=0.5, num_train_epochs=4.0, max_steps=-1, lr_scheduler_type=<SchedulerType.COSINE: 'cosine'>, lr_scheduler_kwargs=None, warmup_ratio=0.05, warmup_steps=0, log_level='passive', log_level_replica='warning', log_on_each_node=True, logging_dir='/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v10-20250518-175827/runs', logging_strategy=<IntervalStrategy.STEPS: 'steps'>, logging_first_step=True, logging_steps=1, logging_nan_inf_filter=True, save_strategy=<SaveStrategy.STEPS: 'steps'>, save_steps=5, save_total_limit=None, save_safetensors=True, save_on_each_node=False, save_only_model=False, restore_callback_states_from_checkpoint=False, no_cuda=False, use_cpu=False, use_mps_device=False, seed=42, data_seed=42, jit_mode_eval=False, use_ipex=False, bf16=True, fp16=False, fp16_opt_level='O1', half_precision_backend='auto', bf16_full_eval=False, fp16_full_eval=False, tf32=None, local_rank=0, ddp_backend=None, tpu_num_cores=None, tpu_metrics_debug=False, debug=[], dataloader_drop_last=True, eval_steps=500, dataloader_num_workers=4, dataloader_prefetch_factor=10, past_index=-1, run_name='/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v10-20250518-175827', disable_tqdm=False, remove_unused_columns=False, label_names=None, load_best_model_at_end=False, metric_for_best_model='reward', greater_is_better=True, ignore_data_skip=False, fsdp=[], fsdp_min_num_params=0, fsdp_config={'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}, tp_size=0, fsdp_transformer_layer_cls_to_wrap=None, accelerator_config=AcceleratorConfig(split_batches=False, dispatch_batches=False, even_batches=True, use_seedable_sampler=True, non_blocking=False, gradient_accumulation_kwargs=None, use_configured_state=False), deepspeed={'fp16': {'enabled': 'auto', 'loss_scale': 0, 'loss_scale_window': 1000, 'initial_scale_power': 16, 'hysteresis': 2, 'min_loss_scale': 1}, 'bf16': {'enabled': 'auto'}, 'zero_optimization': {'stage': 3, 'offload_optimizer': {'device': 'none', 'pin_memory': True}, 'offload_param': {'device': 'none', 'pin_memory': True}, 'overlap_comm': False, 'contiguous_gradients': True, 'sub_group_size': 1000000000.0, 'reduce_bucket_size': 'auto', 'zero_quantized_weights': False, 'zero_quantized_gradients': False, 'stage3_prefetch_bucket_size': 0, 'stage3_param_persistence_threshold': 'auto', 'stage3_max_live_parameters': 1000000000.0, 'stage3_max_reuse_distance': 1000000000.0, 'stage3_gather_16bit_weights_on_model_save': True}, 'gradient_accumulation_steps': 'auto', 'gradient_clipping': 'auto', 'steps_per_print': 2000, 'train_batch_size': 'auto', 'train_micro_batch_size_per_gpu': 'auto', 'wall_clock_breakdown': False}, label_smoothing_factor=0.0, optim=<OptimizerNames.ADAMW_TORCH: 'adamw_torch'>, optim_args=None, adafactor=False, group_by_length=False, length_column_name='length', report_to=['tensorboard'], ddp_find_unused_parameters=None, ddp_bucket_cap_mb=None, ddp_broadcast_buffers=None, dataloader_pin_memory=True, dataloader_persistent_workers=False, skip_memory_metrics=True, use_legacy_prediction_loop=False, push_to_hub=False, resume_from_checkpoint='/data2/kdd/crag/cjz/agents/output/response没kl全程reward2/v9-20250518-172344/checkpoint-15', hub_model_id=None, hub_strategy=<HubStrategy.EVERY_SAVE: 'every_save'>, hub_token=None, hub_private_repo=None, hub_always_push=False, gradient_checkpointing=True, gradient_checkpointing_kwargs=None, include_inputs_for_metrics=False, include_for_metrics=[], eval_do_concat_batches=True, fp16_backend='auto', push_to_hub_model_id=None, push_to_hub_organization=None, push_to_hub_token=None, mp_parameters='', auto_find_batch_size=False, full_determinism=False, torchdynamo=None, ray_scope='last', ddp_timeout=1800, torch_compile=False, torch_compile_backend=None, torch_compile_mode=None, include_tokens_per_second=None, include_num_input_tokens_seen=None, neftune_noise_alpha=None, optim_target_modules=None, batch_eval_metrics=False, eval_on_start=False, use_liger_kernel=False, eval_use_gather_object=False, average_tokens_across_devices=None, model_init_kwargs=None, disable_dropout=False, max_prompt_length=512, num_generations=8, max_completion_length=50, ds3_gather_for_generation=True, shuffle_dataset=True, temperature=1.0, top_p=0.9, top_k=50, min_p=None, repetition_penalty=1.1, cache_implementation=None, use_vllm=True, vllm_server_host=None, vllm_server_port=8000, vllm_server_timeout=240.0, vllm_guided_decoding_regex=None, beta=0.0001, num_iterations=2, epsilon=0.2, epsilon_high=0.28, reward_weights=None, scale_rewards=True, loss_type='grpo', mask_truncated_completions=False, sync_ref_model=False, ref_model_mixup_alpha=0.6, ref_model_sync_steps=512, use_liger_loss=False, log_completions=True, num_completions_to_print=None, wandb_log_unique_prompts=None, vllm_device=['auto'], vllm_gpu_memory_utilization=0.8, vllm_dtype=None, vllm_max_model_len=8192, vllm_enable_prefix_caching=True, check_model=True, acc_strategy='token', train_dataloader_shuffle=True, metric_warmup_step=0, fsdp_num=1, acc_steps=1, eval_use_evalscope=False, eval_datasets=[], eval_limit=None, eval_datasets_args=None, eval_generation_config=None, train_type='lora', optimizer=None, local_repo_path=None, galore_config=None, num_infer_workers=1, vllm_max_num_seqs=8, vllm_enforce_eager=False, vllm_limit_mm_per_prompt={}, cosine_min_len_value_wrong=-0.5, cosine_max_len_value_wrong=0.0, cosine_min_len_value_correct=1.0, cosine_max_len_value_correct=0.5, cosine_max_len=50, repetition_n_grams=3, repetition_max_penalty=-1.0, use_lmdeploy=False, lmdeploy_device='auto', lmdeploy_session_len=None, lmdeploy_cache_max_entry_count=0.8, async_generate=False, tensor_parallel_size=1, sleep_level=0, move_model_batches=None, offload_optimizer=False, offload_model=False, gc_collect_after_offload=False, multi_turn_func=None, dynamic_sample=False, max_resample_times=3, overlong_filter=False, soft_max_length=None, soft_cache_length=20, dataset_shuffle=True, stop_words=[])"
450
+ }
latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step60
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2e7e5b117772cf3e740827ee783ebfdfbe65ff2112ad28200667a239048b726
3
+ size 14356
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:994d867989c1edc3f014136481ad1ace3980227fef482846b88cb97090b177f3
3
+ size 1056
trainer_state.json ADDED
@@ -0,0 +1,1190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.6648199445983379,
6
+ "eval_steps": 500,
7
+ "global_step": 60,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "clip_ratio/high_max": 0.0,
14
+ "clip_ratio/high_mean": 0.0,
15
+ "clip_ratio/low_mean": 0.0,
16
+ "clip_ratio/low_min": 0.0,
17
+ "clip_ratio/region_mean": 0.0,
18
+ "completions/clipped_ratio": 0.046875,
19
+ "completions/max_length": 51.0,
20
+ "completions/mean_length": 16.6796875,
21
+ "completions/min_length": 3.0,
22
+ "epoch": 0.0110803324099723,
23
+ "grad_norm": 1.3400153486450683,
24
+ "kl": 0.0,
25
+ "learning_rate": 1.1111111111111112e-05,
26
+ "loss": -9.313225746154785e-10,
27
+ "memory(GiB)": 77.38,
28
+ "reward": -0.8125,
29
+ "reward_std": 0.38430261611938477,
30
+ "rewards/Response_no_think_reward/mean": -0.8125,
31
+ "rewards/Response_no_think_reward/std": 0.6958821415901184,
32
+ "step": 1,
33
+ "train_speed(iter/s)": 0.000753
34
+ },
35
+ {
36
+ "clip_ratio/high_max": 0.0,
37
+ "clip_ratio/high_mean": 0.0,
38
+ "clip_ratio/low_mean": 0.0,
39
+ "clip_ratio/low_min": 0.0,
40
+ "clip_ratio/region_mean": 0.0,
41
+ "epoch": 0.0221606648199446,
42
+ "grad_norm": 1.3454285871298992,
43
+ "kl": 0.0,
44
+ "learning_rate": 2.2222222222222223e-05,
45
+ "loss": -9.313225746154785e-10,
46
+ "memory(GiB)": 78.17,
47
+ "step": 2,
48
+ "train_speed(iter/s)": 0.001317
49
+ },
50
+ {
51
+ "clip_ratio/high_max": 0.0009920635493472219,
52
+ "clip_ratio/high_mean": 0.0009920635493472219,
53
+ "clip_ratio/low_mean": 0.0012351538171060383,
54
+ "clip_ratio/low_min": 0.0012351538171060383,
55
+ "clip_ratio/region_mean": 0.00222721736645326,
56
+ "completions/clipped_ratio": 0.0390625,
57
+ "completions/max_length": 51.0,
58
+ "completions/mean_length": 13.03125,
59
+ "completions/min_length": 3.0,
60
+ "epoch": 0.0332409972299169,
61
+ "grad_norm": 1.1739378406354548,
62
+ "kl": 0.0013750234156759689,
63
+ "learning_rate": 3.3333333333333335e-05,
64
+ "loss": 0.0005532659706659615,
65
+ "memory(GiB)": 78.17,
66
+ "reward": -0.0078125,
67
+ "reward_std": 0.7346676588058472,
68
+ "rewards/Response_no_think_reward/mean": -0.0078125,
69
+ "rewards/Response_no_think_reward/std": 1.411405086517334,
70
+ "step": 3,
71
+ "train_speed(iter/s)": 0.001417
72
+ },
73
+ {
74
+ "clip_ratio/high_max": 0.0006313131307251751,
75
+ "clip_ratio/high_mean": 0.0006313131307251751,
76
+ "clip_ratio/low_mean": 0.0009640990756452084,
77
+ "clip_ratio/low_min": 0.0009640990756452084,
78
+ "clip_ratio/region_mean": 0.0015954122063703835,
79
+ "epoch": 0.0443213296398892,
80
+ "grad_norm": 1.1825343839681348,
81
+ "kl": 0.0013630353023472708,
82
+ "learning_rate": 4.4444444444444447e-05,
83
+ "loss": -0.0013326075859367847,
84
+ "memory(GiB)": 78.17,
85
+ "step": 4,
86
+ "train_speed(iter/s)": 0.001735
87
+ },
88
+ {
89
+ "clip_ratio/high_max": 0.0,
90
+ "clip_ratio/high_mean": 0.0,
91
+ "clip_ratio/low_mean": 0.005316304974257946,
92
+ "clip_ratio/low_min": 0.005316304974257946,
93
+ "clip_ratio/region_mean": 0.005316304974257946,
94
+ "completions/clipped_ratio": 0.0078125,
95
+ "completions/max_length": 51.0,
96
+ "completions/mean_length": 13.3828125,
97
+ "completions/min_length": 3.0,
98
+ "epoch": 0.055401662049861494,
99
+ "grad_norm": 1.3399484117828366,
100
+ "kl": 0.0029429409933072748,
101
+ "learning_rate": 5.555555555555556e-05,
102
+ "loss": 0.0014606926124542952,
103
+ "memory(GiB)": 78.25,
104
+ "reward": -0.15625,
105
+ "reward_std": 0.9831876158714294,
106
+ "rewards/Response_no_think_reward/mean": -0.15625,
107
+ "rewards/Response_no_think_reward/std": 1.3541275262832642,
108
+ "step": 5,
109
+ "train_speed(iter/s)": 0.001752
110
+ },
111
+ {
112
+ "clip_ratio/high_max": 0.0014204545877873898,
113
+ "clip_ratio/high_mean": 0.0014204545877873898,
114
+ "clip_ratio/low_mean": 0.0008680555620230734,
115
+ "clip_ratio/low_min": 0.0008680555620230734,
116
+ "clip_ratio/region_mean": 0.002288510149810463,
117
+ "completions/clipped_ratio": 0.03125,
118
+ "completions/max_length": 51.0,
119
+ "completions/mean_length": 14.484375,
120
+ "completions/min_length": 2.0,
121
+ "epoch": 0.0664819944598338,
122
+ "grad_norm": 1.600021993041462,
123
+ "kl": 0.007914411224192008,
124
+ "learning_rate": 6.666666666666667e-05,
125
+ "loss": -0.0006625128444284201,
126
+ "memory(GiB)": 77.89,
127
+ "reward": -0.1328125,
128
+ "reward_std": 0.7212049961090088,
129
+ "rewards/Response_no_think_reward/mean": -0.1328125,
130
+ "rewards/Response_no_think_reward/std": 1.3653247356414795,
131
+ "step": 6,
132
+ "train_speed(iter/s)": 0.009313
133
+ },
134
+ {
135
+ "clip_ratio/high_max": 0.020065165997948498,
136
+ "clip_ratio/high_mean": 0.020065165997948498,
137
+ "clip_ratio/low_mean": 0.03063795086927712,
138
+ "clip_ratio/low_min": 0.03063795086927712,
139
+ "clip_ratio/region_mean": 0.050703116634394974,
140
+ "epoch": 0.07756232686980609,
141
+ "grad_norm": 0.9793694784898841,
142
+ "kl": 0.03891617391491309,
143
+ "learning_rate": 7.777777777777778e-05,
144
+ "loss": -0.00832418818026781,
145
+ "memory(GiB)": 77.89,
146
+ "step": 7,
147
+ "train_speed(iter/s)": 0.0084
148
+ },
149
+ {
150
+ "clip_ratio/high_max": 0.0005165289039723575,
151
+ "clip_ratio/high_mean": 0.0005165289039723575,
152
+ "clip_ratio/low_mean": 0.0012338250526227057,
153
+ "clip_ratio/low_min": 0.0012338250526227057,
154
+ "clip_ratio/region_mean": 0.0017503539565950632,
155
+ "completions/clipped_ratio": 0.0234375,
156
+ "completions/max_length": 51.0,
157
+ "completions/mean_length": 14.734375,
158
+ "completions/min_length": 3.0,
159
+ "epoch": 0.0886426592797784,
160
+ "grad_norm": 1.3164563077884395,
161
+ "kl": 0.05195357115007937,
162
+ "learning_rate": 8.888888888888889e-05,
163
+ "loss": -0.00010046618990600109,
164
+ "memory(GiB)": 78.03,
165
+ "reward": -0.2734375,
166
+ "reward_std": 0.7209804058074951,
167
+ "rewards/Response_no_think_reward/mean": -0.2734375,
168
+ "rewards/Response_no_think_reward/std": 1.27183198928833,
169
+ "step": 8,
170
+ "train_speed(iter/s)": 0.004412
171
+ },
172
+ {
173
+ "clip_ratio/high_max": 0.011744739342248067,
174
+ "clip_ratio/high_mean": 0.011744739342248067,
175
+ "clip_ratio/low_mean": 0.021301756787579507,
176
+ "clip_ratio/low_min": 0.021301756787579507,
177
+ "clip_ratio/region_mean": 0.033046496275346726,
178
+ "epoch": 0.0997229916897507,
179
+ "grad_norm": 0.7228491518243964,
180
+ "kl": 0.14250310882925987,
181
+ "learning_rate": 0.0001,
182
+ "loss": -0.009305480867624283,
183
+ "memory(GiB)": 78.03,
184
+ "step": 9,
185
+ "train_speed(iter/s)": 0.004494
186
+ },
187
+ {
188
+ "clip_ratio/high_max": 0.0,
189
+ "clip_ratio/high_mean": 0.0,
190
+ "clip_ratio/low_mean": 0.0,
191
+ "clip_ratio/low_min": 0.0,
192
+ "clip_ratio/region_mean": 0.0,
193
+ "completions/clipped_ratio": 0.0234375,
194
+ "completions/max_length": 51.0,
195
+ "completions/mean_length": 14.140625,
196
+ "completions/min_length": 3.0,
197
+ "epoch": 0.11080332409972299,
198
+ "grad_norm": 0.7948888253152248,
199
+ "kl": 0.04085417848546058,
200
+ "learning_rate": 0.00011111111111111112,
201
+ "loss": 0.00047483143862336874,
202
+ "memory(GiB)": 78.03,
203
+ "reward": 0.0546875,
204
+ "reward_std": 0.6801962852478027,
205
+ "rewards/Response_no_think_reward/mean": 0.0546875,
206
+ "rewards/Response_no_think_reward/std": 1.4380027055740356,
207
+ "step": 10,
208
+ "train_speed(iter/s)": 0.002899
209
+ },
210
+ {
211
+ "clip_ratio/high_max": 0.0,
212
+ "clip_ratio/high_mean": 0.0,
213
+ "clip_ratio/low_mean": 0.0,
214
+ "clip_ratio/low_min": 0.0,
215
+ "clip_ratio/region_mean": 0.0,
216
+ "completions/clipped_ratio": 0.0625,
217
+ "completions/max_length": 51.0,
218
+ "completions/mean_length": 17.5078125,
219
+ "completions/min_length": 4.0,
220
+ "epoch": 0.12188365650969529,
221
+ "grad_norm": 0.0004263039062328966,
222
+ "kl": 0.04189836711157113,
223
+ "learning_rate": 0.00012222222222222224,
224
+ "loss": 5.555100869969465e-06,
225
+ "memory(GiB)": 77.88,
226
+ "reward": 0.0,
227
+ "reward_std": 0.0,
228
+ "rewards/Response_no_think_reward/mean": 0.0,
229
+ "rewards/Response_no_think_reward/std": 0.0,
230
+ "step": 11,
231
+ "train_speed(iter/s)": 0.017791
232
+ },
233
+ {
234
+ "clip_ratio/high_max": 0.0,
235
+ "clip_ratio/high_mean": 0.0,
236
+ "clip_ratio/low_mean": 0.0,
237
+ "clip_ratio/low_min": 0.0,
238
+ "clip_ratio/region_mean": 0.0,
239
+ "epoch": 0.1329639889196676,
240
+ "grad_norm": 0.001194388957130102,
241
+ "kl": 0.06704438821179792,
242
+ "learning_rate": 0.00013333333333333334,
243
+ "loss": 9.91918750514742e-06,
244
+ "memory(GiB)": 77.88,
245
+ "step": 12,
246
+ "train_speed(iter/s)": 0.014858
247
+ },
248
+ {
249
+ "clip_ratio/high_max": 0.0,
250
+ "clip_ratio/high_mean": 0.0,
251
+ "clip_ratio/low_mean": 0.0,
252
+ "clip_ratio/low_min": 0.0,
253
+ "clip_ratio/region_mean": 0.0,
254
+ "completions/clipped_ratio": 0.078125,
255
+ "completions/max_length": 51.0,
256
+ "completions/mean_length": 19.8515625,
257
+ "completions/min_length": 2.0,
258
+ "epoch": 0.1440443213296399,
259
+ "grad_norm": 0.00032184673828801084,
260
+ "kl": 0.07992906332947314,
261
+ "learning_rate": 0.00014444444444444444,
262
+ "loss": 7.416723747155629e-06,
263
+ "memory(GiB)": 77.92,
264
+ "reward": 0.0,
265
+ "reward_std": 0.0,
266
+ "rewards/Response_no_think_reward/mean": 0.0,
267
+ "rewards/Response_no_think_reward/std": 0.0,
268
+ "step": 13,
269
+ "train_speed(iter/s)": 0.010543
270
+ },
271
+ {
272
+ "clip_ratio/high_max": 0.0,
273
+ "clip_ratio/high_mean": 0.0,
274
+ "clip_ratio/low_mean": 0.0,
275
+ "clip_ratio/low_min": 0.0,
276
+ "clip_ratio/region_mean": 0.0,
277
+ "epoch": 0.15512465373961218,
278
+ "grad_norm": 0.0009186451648310945,
279
+ "kl": 0.13713529019150883,
280
+ "learning_rate": 0.00015555555555555556,
281
+ "loss": 1.3553013559430838e-05,
282
+ "memory(GiB)": 77.92,
283
+ "step": 14,
284
+ "train_speed(iter/s)": 0.009842
285
+ },
286
+ {
287
+ "clip_ratio/high_max": 0.0,
288
+ "clip_ratio/high_mean": 0.0,
289
+ "clip_ratio/low_mean": 0.0,
290
+ "clip_ratio/low_min": 0.0,
291
+ "clip_ratio/region_mean": 0.0,
292
+ "completions/clipped_ratio": 0.0546875,
293
+ "completions/max_length": 51.0,
294
+ "completions/mean_length": 19.9609375,
295
+ "completions/min_length": 3.0,
296
+ "epoch": 0.16620498614958448,
297
+ "grad_norm": 0.0007871986446541219,
298
+ "kl": 0.10129890241660178,
299
+ "learning_rate": 0.0001666666666666667,
300
+ "loss": 1.3785504052066244e-05,
301
+ "memory(GiB)": 77.92,
302
+ "reward": 0.0,
303
+ "reward_std": 0.0,
304
+ "rewards/Response_no_think_reward/mean": 0.0,
305
+ "rewards/Response_no_think_reward/std": 0.0,
306
+ "step": 15,
307
+ "train_speed(iter/s)": 0.008057
308
+ },
309
+ {
310
+ "clip_ratio/high_max": 0.0,
311
+ "clip_ratio/high_mean": 0.0,
312
+ "clip_ratio/low_mean": 0.0028207504947204143,
313
+ "clip_ratio/low_min": 0.0028207504947204143,
314
+ "clip_ratio/region_mean": 0.0028207504947204143,
315
+ "completions/clipped_ratio": 0.109375,
316
+ "completions/max_length": 51.0,
317
+ "completions/mean_length": 21.1796875,
318
+ "completions/min_length": 3.0,
319
+ "epoch": 0.1772853185595568,
320
+ "grad_norm": 1.5221332407610604,
321
+ "kl": 0.12953427506727166,
322
+ "learning_rate": 0.00017777777777777779,
323
+ "loss": 0.0005249045789241791,
324
+ "memory(GiB)": 77.88,
325
+ "reward": -0.140625,
326
+ "reward_std": 0.747445285320282,
327
+ "rewards/Response_no_think_reward/mean": -0.140625,
328
+ "rewards/Response_no_think_reward/std": 1.3500328063964844,
329
+ "step": 16,
330
+ "train_speed(iter/s)": 0.0232
331
+ },
332
+ {
333
+ "clip_ratio/high_max": 0.014893613493768498,
334
+ "clip_ratio/high_mean": 0.014893613493768498,
335
+ "clip_ratio/low_mean": 0.08722472144290805,
336
+ "clip_ratio/low_min": 0.08722472144290805,
337
+ "clip_ratio/region_mean": 0.10211833566427231,
338
+ "epoch": 0.1883656509695291,
339
+ "grad_norm": 1.2273096796368343,
340
+ "kl": 9.949020208441652,
341
+ "learning_rate": 0.00018888888888888888,
342
+ "loss": -0.009794662706553936,
343
+ "memory(GiB)": 77.88,
344
+ "step": 17,
345
+ "train_speed(iter/s)": 0.019341
346
+ },
347
+ {
348
+ "clip_ratio/high_max": 0.00042517005931586027,
349
+ "clip_ratio/high_mean": 0.00042517005931586027,
350
+ "clip_ratio/low_mean": 0.005602272489340976,
351
+ "clip_ratio/low_min": 0.005602272489340976,
352
+ "clip_ratio/region_mean": 0.006027442548656836,
353
+ "completions/clipped_ratio": 0.078125,
354
+ "completions/max_length": 51.0,
355
+ "completions/mean_length": 16.5234375,
356
+ "completions/min_length": 3.0,
357
+ "epoch": 0.1994459833795014,
358
+ "grad_norm": 1.6723327645413764,
359
+ "kl": 19.73964432394132,
360
+ "learning_rate": 0.0002,
361
+ "loss": 0.0016888766549527645,
362
+ "memory(GiB)": 77.92,
363
+ "reward": -0.5078125,
364
+ "reward_std": 0.46106040477752686,
365
+ "rewards/Response_no_think_reward/mean": -0.5078125,
366
+ "rewards/Response_no_think_reward/std": 1.0038986206054688,
367
+ "step": 18,
368
+ "train_speed(iter/s)": 0.012746
369
+ },
370
+ {
371
+ "clip_ratio/high_max": 0.008699395693838596,
372
+ "clip_ratio/high_mean": 0.008699395693838596,
373
+ "clip_ratio/low_mean": 0.09401972405612469,
374
+ "clip_ratio/low_min": 0.09401972405612469,
375
+ "clip_ratio/region_mean": 0.10271912068128586,
376
+ "epoch": 0.21052631578947367,
377
+ "grad_norm": 0.9659705365958429,
378
+ "kl": 28.792964363470674,
379
+ "learning_rate": 0.00019999578095183124,
380
+ "loss": -0.005614398047327995,
381
+ "memory(GiB)": 77.92,
382
+ "step": 19,
383
+ "train_speed(iter/s)": 0.011863
384
+ },
385
+ {
386
+ "clip_ratio/high_max": 0.0009057971183210611,
387
+ "clip_ratio/high_mean": 0.0009057971183210611,
388
+ "clip_ratio/low_mean": 0.0047033663431648165,
389
+ "clip_ratio/low_min": 0.0047033663431648165,
390
+ "clip_ratio/region_mean": 0.005609163461485878,
391
+ "completions/clipped_ratio": 0.0234375,
392
+ "completions/max_length": 51.0,
393
+ "completions/mean_length": 17.703125,
394
+ "completions/min_length": 4.0,
395
+ "epoch": 0.22160664819944598,
396
+ "grad_norm": 2.0349350259537244,
397
+ "kl": 0.8193748028716072,
398
+ "learning_rate": 0.00019998312416333227,
399
+ "loss": 0.0007828018860891461,
400
+ "memory(GiB)": 77.92,
401
+ "reward": -0.40625,
402
+ "reward_std": 0.5371267199516296,
403
+ "rewards/Response_no_think_reward/mean": -0.40625,
404
+ "rewards/Response_no_think_reward/std": 1.1734429597854614,
405
+ "step": 20,
406
+ "train_speed(iter/s)": 0.009276
407
+ },
408
+ {
409
+ "clip_ratio/high_max": 0.017557535058585927,
410
+ "clip_ratio/high_mean": 0.017557535058585927,
411
+ "clip_ratio/low_mean": 0.0823797988705337,
412
+ "clip_ratio/low_min": 0.0823797988705337,
413
+ "clip_ratio/region_mean": 0.09993733279407024,
414
+ "epoch": 0.23268698060941828,
415
+ "grad_norm": 5.547205800030314,
416
+ "kl": 155.78269671928138,
417
+ "learning_rate": 0.00019996203070249516,
418
+ "loss": 0.028484804555773735,
419
+ "memory(GiB)": 79.88,
420
+ "step": 21,
421
+ "train_speed(iter/s)": 0.008942
422
+ },
423
+ {
424
+ "clip_ratio/high_max": 0.00173778529278934,
425
+ "clip_ratio/high_mean": 0.00173778529278934,
426
+ "clip_ratio/low_mean": 0.004023336310638115,
427
+ "clip_ratio/low_min": 0.004023336310638115,
428
+ "clip_ratio/region_mean": 0.005761121603427455,
429
+ "completions/clipped_ratio": 0.0390625,
430
+ "completions/max_length": 51.0,
431
+ "completions/mean_length": 16.359375,
432
+ "completions/min_length": 4.0,
433
+ "epoch": 0.24376731301939059,
434
+ "grad_norm": 1.1706684735088349,
435
+ "kl": 0.29493264015764,
436
+ "learning_rate": 0.00019993250234920636,
437
+ "loss": 0.0013634033966809511,
438
+ "memory(GiB)": 79.88,
439
+ "reward": 0.1640625,
440
+ "reward_std": 0.6870359778404236,
441
+ "rewards/Response_no_think_reward/mean": 0.1640625,
442
+ "rewards/Response_no_think_reward/std": 1.4240750074386597,
443
+ "step": 22,
444
+ "train_speed(iter/s)": 0.007618
445
+ },
446
+ {
447
+ "clip_ratio/high_max": 0.01892658555880189,
448
+ "clip_ratio/high_mean": 0.01892658555880189,
449
+ "clip_ratio/low_mean": 0.06755852687638253,
450
+ "clip_ratio/low_min": 0.06755852687638253,
451
+ "clip_ratio/region_mean": 0.0864851123187691,
452
+ "epoch": 0.2548476454293629,
453
+ "grad_norm": 0.5069456216354334,
454
+ "kl": 0.7371144236531109,
455
+ "learning_rate": 0.0001998945415950969,
456
+ "loss": -0.015337318181991577,
457
+ "memory(GiB)": 79.88,
458
+ "step": 23,
459
+ "train_speed(iter/s)": 0.007472
460
+ },
461
+ {
462
+ "clip_ratio/high_max": 0.0,
463
+ "clip_ratio/high_mean": 0.0,
464
+ "clip_ratio/low_mean": 0.00311830299324356,
465
+ "clip_ratio/low_min": 0.00311830299324356,
466
+ "clip_ratio/region_mean": 0.00311830299324356,
467
+ "completions/clipped_ratio": 0.0625,
468
+ "completions/max_length": 51.0,
469
+ "completions/mean_length": 15.4296875,
470
+ "completions/min_length": 5.0,
471
+ "epoch": 0.2659279778393352,
472
+ "grad_norm": 1.2087135470902275,
473
+ "kl": 0.9872721234764867,
474
+ "learning_rate": 0.00019984815164333163,
475
+ "loss": 0.0027771026361733675,
476
+ "memory(GiB)": 79.88,
477
+ "reward": -0.109375,
478
+ "reward_std": 0.3798917531967163,
479
+ "rewards/Response_no_think_reward/mean": -0.109375,
480
+ "rewards/Response_no_think_reward/std": 1.1310532093048096,
481
+ "step": 24,
482
+ "train_speed(iter/s)": 0.006636
483
+ },
484
+ {
485
+ "clip_ratio/high_max": 0.0029115322104189545,
486
+ "clip_ratio/high_mean": 0.0029115322104189545,
487
+ "clip_ratio/low_mean": 0.07530217664316297,
488
+ "clip_ratio/low_min": 0.07530217664316297,
489
+ "clip_ratio/region_mean": 0.07821370894089341,
490
+ "epoch": 0.2770083102493075,
491
+ "grad_norm": 0.702071136643931,
492
+ "kl": 26.457206293552645,
493
+ "learning_rate": 0.00019979333640833947,
494
+ "loss": -0.003078086068853736,
495
+ "memory(GiB)": 79.88,
496
+ "step": 25,
497
+ "train_speed(iter/s)": 0.006569
498
+ },
499
+ {
500
+ "clip_ratio/high_max": 0.0023347785463556647,
501
+ "clip_ratio/high_mean": 0.0023347785463556647,
502
+ "clip_ratio/low_mean": 0.01951372090843506,
503
+ "clip_ratio/low_min": 0.01951372090843506,
504
+ "clip_ratio/region_mean": 0.021848499542102218,
505
+ "completions/clipped_ratio": 0.015625,
506
+ "completions/max_length": 51.0,
507
+ "completions/mean_length": 14.6953125,
508
+ "completions/min_length": 4.0,
509
+ "epoch": 0.2880886426592798,
510
+ "grad_norm": 1.6527510231667384,
511
+ "kl": 7.873713016277179,
512
+ "learning_rate": 0.00019973010051548275,
513
+ "loss": 0.0009247222333215177,
514
+ "memory(GiB)": 79.88,
515
+ "reward": 0.015625,
516
+ "reward_std": 0.7059091925621033,
517
+ "rewards/Response_no_think_reward/mean": 0.015625,
518
+ "rewards/Response_no_think_reward/std": 1.2610729932785034,
519
+ "step": 26,
520
+ "train_speed(iter/s)": 0.005996
521
+ },
522
+ {
523
+ "clip_ratio/high_max": 0.01952397992135957,
524
+ "clip_ratio/high_mean": 0.01952397992135957,
525
+ "clip_ratio/low_mean": 0.1283843811834231,
526
+ "clip_ratio/low_min": 0.1283843811834231,
527
+ "clip_ratio/region_mean": 0.1479083604644984,
528
+ "epoch": 0.29916897506925205,
529
+ "grad_norm": 12.590003285629427,
530
+ "kl": 741.7941563371569,
531
+ "learning_rate": 0.000199658449300667,
532
+ "loss": 0.036141443997621536,
533
+ "memory(GiB)": 79.88,
534
+ "step": 27,
535
+ "train_speed(iter/s)": 0.005965
536
+ },
537
+ {
538
+ "clip_ratio/high_max": 0.0036726996186189353,
539
+ "clip_ratio/high_mean": 0.0036726996186189353,
540
+ "clip_ratio/low_mean": 0.005622756987577304,
541
+ "clip_ratio/low_min": 0.005622756987577304,
542
+ "clip_ratio/region_mean": 0.00929545663530007,
543
+ "completions/clipped_ratio": 0.0390625,
544
+ "completions/max_length": 51.0,
545
+ "completions/mean_length": 13.8203125,
546
+ "completions/min_length": 4.0,
547
+ "epoch": 0.31024930747922436,
548
+ "grad_norm": 2.1964117931286085,
549
+ "kl": 11.635613721329719,
550
+ "learning_rate": 0.00019957838880989078,
551
+ "loss": 0.002877343213185668,
552
+ "memory(GiB)": 79.88,
553
+ "reward": 0.390625,
554
+ "reward_std": 0.6595449447631836,
555
+ "rewards/Response_no_think_reward/mean": 0.390625,
556
+ "rewards/Response_no_think_reward/std": 1.1379936933517456,
557
+ "step": 28,
558
+ "train_speed(iter/s)": 0.005568
559
+ },
560
+ {
561
+ "clip_ratio/high_max": 0.017762314528226852,
562
+ "clip_ratio/high_mean": 0.017762314528226852,
563
+ "clip_ratio/low_mean": 0.047843097941949964,
564
+ "clip_ratio/low_min": 0.047843097941949964,
565
+ "clip_ratio/region_mean": 0.06560541247017682,
566
+ "epoch": 0.32132963988919666,
567
+ "grad_norm": 1.3735654410758578,
568
+ "kl": 80.49331146203622,
569
+ "learning_rate": 0.00019948992579873538,
570
+ "loss": -0.005675393156707287,
571
+ "memory(GiB)": 79.88,
572
+ "step": 29,
573
+ "train_speed(iter/s)": 0.005557
574
+ },
575
+ {
576
+ "clip_ratio/high_max": 0.00618883827701211,
577
+ "clip_ratio/high_mean": 0.00618883827701211,
578
+ "clip_ratio/low_mean": 0.005286419298499823,
579
+ "clip_ratio/low_min": 0.005286419298499823,
580
+ "clip_ratio/region_mean": 0.011475257691927254,
581
+ "completions/clipped_ratio": 0.015625,
582
+ "completions/max_length": 51.0,
583
+ "completions/mean_length": 11.484375,
584
+ "completions/min_length": 3.0,
585
+ "epoch": 0.33240997229916897,
586
+ "grad_norm": 1.1914361173581312,
587
+ "kl": 3.281426345667569,
588
+ "learning_rate": 0.00019939306773179497,
589
+ "loss": 0.0003165462985634804,
590
+ "memory(GiB)": 79.88,
591
+ "reward": 0.5625,
592
+ "reward_std": 0.4207349121570587,
593
+ "rewards/Response_no_think_reward/mean": 0.5625,
594
+ "rewards/Response_no_think_reward/std": 1.3265905380249023,
595
+ "step": 30,
596
+ "train_speed(iter/s)": 0.005222
597
+ },
598
+ {
599
+ "clip_ratio/high_max": 0.05031776078976691,
600
+ "clip_ratio/high_mean": 0.05031776078976691,
601
+ "clip_ratio/low_mean": 0.041757271508686244,
602
+ "clip_ratio/low_min": 0.041757271508686244,
603
+ "clip_ratio/region_mean": 0.09207503264769912,
604
+ "epoch": 0.34349030470914127,
605
+ "grad_norm": 0.9882009232899025,
606
+ "kl": 9.828547842378612,
607
+ "learning_rate": 0.0001992878227820465,
608
+ "loss": -0.0019915460143238306,
609
+ "memory(GiB)": 79.88,
610
+ "step": 31,
611
+ "train_speed(iter/s)": 0.005221
612
+ },
613
+ {
614
+ "clip_ratio/high_max": 0.0014815493486821651,
615
+ "clip_ratio/high_mean": 0.0014815493486821651,
616
+ "clip_ratio/low_mean": 0.00400914296915289,
617
+ "clip_ratio/low_min": 0.00400914296915289,
618
+ "clip_ratio/region_mean": 0.005490692317835055,
619
+ "completions/clipped_ratio": 0.046875,
620
+ "completions/max_length": 51.0,
621
+ "completions/mean_length": 19.078125,
622
+ "completions/min_length": 4.0,
623
+ "epoch": 0.3545706371191136,
624
+ "grad_norm": 1.1670914229830547,
625
+ "kl": 3.5491041047498584,
626
+ "learning_rate": 0.00019917419983016025,
627
+ "loss": 0.0021022851578891277,
628
+ "memory(GiB)": 79.88,
629
+ "reward": 0.25,
630
+ "reward_std": 0.7367533445358276,
631
+ "rewards/Response_no_think_reward/mean": 0.25,
632
+ "rewards/Response_no_think_reward/std": 1.3631829023361206,
633
+ "step": 32,
634
+ "train_speed(iter/s)": 0.004948
635
+ },
636
+ {
637
+ "clip_ratio/high_max": 0.02484438387909904,
638
+ "clip_ratio/high_mean": 0.02484438387909904,
639
+ "clip_ratio/low_mean": 0.0674317826051265,
640
+ "clip_ratio/low_min": 0.0674317826051265,
641
+ "clip_ratio/region_mean": 0.09227616689167917,
642
+ "epoch": 0.3656509695290859,
643
+ "grad_norm": 0.9959477925686483,
644
+ "kl": 51.25826009634329,
645
+ "learning_rate": 0.00019905220846375032,
646
+ "loss": -0.002379298210144043,
647
+ "memory(GiB)": 79.88,
648
+ "step": 33,
649
+ "train_speed(iter/s)": 0.004958
650
+ },
651
+ {
652
+ "clip_ratio/high_max": 0.0034505740622989833,
653
+ "clip_ratio/high_mean": 0.0034505740622989833,
654
+ "clip_ratio/low_mean": 0.0069533721543848515,
655
+ "clip_ratio/low_min": 0.0069533721543848515,
656
+ "clip_ratio/region_mean": 0.010403946158476174,
657
+ "completions/clipped_ratio": 0.03125,
658
+ "completions/max_length": 51.0,
659
+ "completions/mean_length": 12.4375,
660
+ "completions/min_length": 4.0,
661
+ "epoch": 0.3767313019390582,
662
+ "grad_norm": 1.1883165046483204,
663
+ "kl": 6.391523744328879,
664
+ "learning_rate": 0.00019892185897656578,
665
+ "loss": 0.0010706284083425999,
666
+ "memory(GiB)": 79.88,
667
+ "reward": 0.078125,
668
+ "reward_std": 0.3766237795352936,
669
+ "rewards/Response_no_think_reward/mean": 0.078125,
670
+ "rewards/Response_no_think_reward/std": 1.1126288175582886,
671
+ "step": 34,
672
+ "train_speed(iter/s)": 0.004716
673
+ },
674
+ {
675
+ "clip_ratio/high_max": 0.01320959790609777,
676
+ "clip_ratio/high_mean": 0.01320959790609777,
677
+ "clip_ratio/low_mean": 0.059380761347711086,
678
+ "clip_ratio/low_min": 0.059380761347711086,
679
+ "clip_ratio/region_mean": 0.07259036041796207,
680
+ "epoch": 0.3878116343490305,
681
+ "grad_norm": 0.527136254278729,
682
+ "kl": 34.938005739822984,
683
+ "learning_rate": 0.00019878316236762196,
684
+ "loss": -0.005408844910562038,
685
+ "memory(GiB)": 79.88,
686
+ "step": 35,
687
+ "train_speed(iter/s)": 0.004731
688
+ },
689
+ {
690
+ "clip_ratio/high_max": 0.002702809404581785,
691
+ "clip_ratio/high_mean": 0.002702809404581785,
692
+ "clip_ratio/low_mean": 0.0033881079871207476,
693
+ "clip_ratio/low_min": 0.0033881079871207476,
694
+ "clip_ratio/region_mean": 0.006090917449910194,
695
+ "completions/clipped_ratio": 0.0078125,
696
+ "completions/max_length": 51.0,
697
+ "completions/mean_length": 10.703125,
698
+ "completions/min_length": 4.0,
699
+ "epoch": 0.3988919667590028,
700
+ "grad_norm": 1.0383854818250358,
701
+ "kl": 10.416337528149597,
702
+ "learning_rate": 0.00019863613034027224,
703
+ "loss": 0.0015072962269186974,
704
+ "memory(GiB)": 79.88,
705
+ "reward": 0.5,
706
+ "reward_std": 0.4501557946205139,
707
+ "rewards/Response_no_think_reward/mean": 0.5,
708
+ "rewards/Response_no_think_reward/std": 1.1294203996658325,
709
+ "step": 36,
710
+ "train_speed(iter/s)": 0.004567
711
+ },
712
+ {
713
+ "clip_ratio/high_max": 0.04597766371443868,
714
+ "clip_ratio/high_mean": 0.04597766371443868,
715
+ "clip_ratio/low_mean": 0.029037245316430926,
716
+ "clip_ratio/low_min": 0.029037245316430926,
717
+ "clip_ratio/region_mean": 0.07501490786671638,
718
+ "epoch": 0.4099722991689751,
719
+ "grad_norm": 1.198632656262216,
720
+ "kl": 1.9380782267544419,
721
+ "learning_rate": 0.00019848077530122083,
722
+ "loss": -0.00020142836729064584,
723
+ "memory(GiB)": 79.88,
724
+ "step": 37,
725
+ "train_speed(iter/s)": 0.004584
726
+ },
727
+ {
728
+ "clip_ratio/high_max": 0.0011905284482054412,
729
+ "clip_ratio/high_mean": 0.0011905284482054412,
730
+ "clip_ratio/low_mean": 0.013364006066694856,
731
+ "clip_ratio/low_min": 0.013364006066694856,
732
+ "clip_ratio/region_mean": 0.014554534514900297,
733
+ "completions/clipped_ratio": 0.0078125,
734
+ "completions/max_length": 51.0,
735
+ "completions/mean_length": 9.28125,
736
+ "completions/min_length": 3.0,
737
+ "epoch": 0.42105263157894735,
738
+ "grad_norm": 1.9489606220013782,
739
+ "kl": 19.19968014501501,
740
+ "learning_rate": 0.0001983171103594755,
741
+ "loss": 0.0004887112881988287,
742
+ "memory(GiB)": 79.88,
743
+ "reward": 0.0625,
744
+ "reward_std": 0.47397348284721375,
745
+ "rewards/Response_no_think_reward/mean": 0.0625,
746
+ "rewards/Response_no_think_reward/std": 0.9618715047836304,
747
+ "step": 38,
748
+ "train_speed(iter/s)": 0.004438
749
+ },
750
+ {
751
+ "clip_ratio/high_max": 0.0027730573201552033,
752
+ "clip_ratio/high_mean": 0.0027730573201552033,
753
+ "clip_ratio/low_mean": 0.11966108158230782,
754
+ "clip_ratio/low_min": 0.11966108158230782,
755
+ "clip_ratio/region_mean": 0.12243413866963238,
756
+ "epoch": 0.43213296398891965,
757
+ "grad_norm": 1.0018802051645932,
758
+ "kl": 49.89589491917286,
759
+ "learning_rate": 0.0001981451493252418,
760
+ "loss": -0.009153969585895538,
761
+ "memory(GiB)": 79.88,
762
+ "step": 39,
763
+ "train_speed(iter/s)": 0.004457
764
+ },
765
+ {
766
+ "clip_ratio/high_max": 0.0013888889225199819,
767
+ "clip_ratio/high_mean": 0.0013888889225199819,
768
+ "clip_ratio/low_mean": 0.01340760855237022,
769
+ "clip_ratio/low_min": 0.01340760855237022,
770
+ "clip_ratio/region_mean": 0.014796497474890202,
771
+ "completions/clipped_ratio": 0.0078125,
772
+ "completions/max_length": 51.0,
773
+ "completions/mean_length": 8.34375,
774
+ "completions/min_length": 3.0,
775
+ "epoch": 0.44321329639889195,
776
+ "grad_norm": 1.5554099620650559,
777
+ "kl": 4.425425759982318,
778
+ "learning_rate": 0.0001979649067087574,
779
+ "loss": 0.006227841135114431,
780
+ "memory(GiB)": 79.88,
781
+ "reward": 0.109375,
782
+ "reward_std": 0.5266703963279724,
783
+ "rewards/Response_no_think_reward/mean": 0.109375,
784
+ "rewards/Response_no_think_reward/std": 1.0057659149169922,
785
+ "step": 40,
786
+ "train_speed(iter/s)": 0.004236
787
+ },
788
+ {
789
+ "clip_ratio/high_max": 0.017265826056245714,
790
+ "clip_ratio/high_mean": 0.017265826056245714,
791
+ "clip_ratio/low_mean": 0.11041530082002282,
792
+ "clip_ratio/low_min": 0.11041530082002282,
793
+ "clip_ratio/region_mean": 0.1276811266434379,
794
+ "epoch": 0.45429362880886426,
795
+ "grad_norm": 6.231748769450823,
796
+ "kl": 522.7659375867806,
797
+ "learning_rate": 0.00019777639771906795,
798
+ "loss": -0.0034558051265776157,
799
+ "memory(GiB)": 79.88,
800
+ "step": 41,
801
+ "train_speed(iter/s)": 0.004255
802
+ },
803
+ {
804
+ "clip_ratio/high_max": 0.0,
805
+ "clip_ratio/high_mean": 0.0,
806
+ "clip_ratio/low_mean": 0.006427675718441606,
807
+ "clip_ratio/low_min": 0.006427675718441606,
808
+ "clip_ratio/region_mean": 0.006427675718441606,
809
+ "completions/clipped_ratio": 0.015625,
810
+ "completions/max_length": 51.0,
811
+ "completions/mean_length": 7.34375,
812
+ "completions/min_length": 5.0,
813
+ "epoch": 0.46537396121883656,
814
+ "grad_norm": 1.0020303907992343,
815
+ "kl": 6.527791675332992,
816
+ "learning_rate": 0.00019757963826274357,
817
+ "loss": -0.0012322411639615893,
818
+ "memory(GiB)": 79.88,
819
+ "reward": 0.1484375,
820
+ "reward_std": 0.21095064282417297,
821
+ "rewards/Response_no_think_reward/mean": 0.1484375,
822
+ "rewards/Response_no_think_reward/std": 0.628582239151001,
823
+ "step": 42,
824
+ "train_speed(iter/s)": 0.004165
825
+ },
826
+ {
827
+ "clip_ratio/high_max": 0.01585913705639541,
828
+ "clip_ratio/high_mean": 0.01585913705639541,
829
+ "clip_ratio/low_mean": 0.026421017944812775,
830
+ "clip_ratio/low_min": 0.026421017944812775,
831
+ "clip_ratio/region_mean": 0.04228015476837754,
832
+ "epoch": 0.47645429362880887,
833
+ "grad_norm": 0.4174666284613835,
834
+ "kl": 30.479038277953805,
835
+ "learning_rate": 0.0001973746449425368,
836
+ "loss": -0.009352116845548153,
837
+ "memory(GiB)": 79.88,
838
+ "step": 43,
839
+ "train_speed(iter/s)": 0.004185
840
+ },
841
+ {
842
+ "clip_ratio/high_max": 0.0026535717770457268,
843
+ "clip_ratio/high_mean": 0.0026535717770457268,
844
+ "clip_ratio/low_mean": 0.008503502060193568,
845
+ "clip_ratio/low_min": 0.008503502060193568,
846
+ "clip_ratio/region_mean": 0.011157073837239295,
847
+ "completions/clipped_ratio": 0.0390625,
848
+ "completions/max_length": 51.0,
849
+ "completions/mean_length": 9.953125,
850
+ "completions/min_length": 5.0,
851
+ "epoch": 0.48753462603878117,
852
+ "grad_norm": 2.3666909999114085,
853
+ "kl": 21.929430570075056,
854
+ "learning_rate": 0.0001971614350559814,
855
+ "loss": 0.0009473273530602455,
856
+ "memory(GiB)": 79.88,
857
+ "reward": -0.03125,
858
+ "reward_std": 0.3844763934612274,
859
+ "rewards/Response_no_think_reward/mean": -0.03125,
860
+ "rewards/Response_no_think_reward/std": 0.6750619411468506,
861
+ "step": 44,
862
+ "train_speed(iter/s)": 0.0041
863
+ },
864
+ {
865
+ "clip_ratio/high_max": 0.003926915815100074,
866
+ "clip_ratio/high_mean": 0.003926915815100074,
867
+ "clip_ratio/low_mean": 0.1417178469710052,
868
+ "clip_ratio/low_min": 0.1417178469710052,
869
+ "clip_ratio/region_mean": 0.14564476208761334,
870
+ "epoch": 0.4986149584487535,
871
+ "grad_norm": 51.49679854517617,
872
+ "kl": 4715.846689800266,
873
+ "learning_rate": 0.00019694002659393305,
874
+ "loss": 0.22465737164020538,
875
+ "memory(GiB)": 79.88,
876
+ "step": 45,
877
+ "train_speed(iter/s)": 0.004121
878
+ },
879
+ {
880
+ "clip_ratio/high_max": 0.0025718168762978166,
881
+ "clip_ratio/high_mean": 0.0025718168762978166,
882
+ "clip_ratio/low_mean": 0.0054531682981178164,
883
+ "clip_ratio/low_min": 0.0054531682981178164,
884
+ "clip_ratio/region_mean": 0.008024985319934785,
885
+ "completions/clipped_ratio": 0.015625,
886
+ "completions/max_length": 51.0,
887
+ "completions/mean_length": 7.453125,
888
+ "completions/min_length": 3.0,
889
+ "epoch": 0.5096952908587258,
890
+ "grad_norm": 7.932036097415596,
891
+ "kl": 134.56803331989795,
892
+ "learning_rate": 0.0001967104382390511,
893
+ "loss": 0.00671145785599947,
894
+ "memory(GiB)": 79.88,
895
+ "reward": 0.109375,
896
+ "reward_std": 0.21731878817081451,
897
+ "rewards/Response_no_think_reward/mean": 0.109375,
898
+ "rewards/Response_no_think_reward/std": 0.6303901672363281,
899
+ "step": 46,
900
+ "train_speed(iter/s)": 0.004027
901
+ },
902
+ {
903
+ "clip_ratio/high_max": 0.013239058025646955,
904
+ "clip_ratio/high_mean": 0.013239058025646955,
905
+ "clip_ratio/low_mean": 0.03283043531700969,
906
+ "clip_ratio/low_min": 0.03283043531700969,
907
+ "clip_ratio/region_mean": 0.04606949305161834,
908
+ "epoch": 0.5207756232686981,
909
+ "grad_norm": 2.141404413074471,
910
+ "kl": 68.84463222045451,
911
+ "learning_rate": 0.00019647268936422206,
912
+ "loss": -0.005232019349932671,
913
+ "memory(GiB)": 79.88,
914
+ "step": 47,
915
+ "train_speed(iter/s)": 0.004048
916
+ },
917
+ {
918
+ "clip_ratio/high_max": 0.0005482456181198359,
919
+ "clip_ratio/high_mean": 0.0005482456181198359,
920
+ "clip_ratio/low_mean": 0.005675954627804458,
921
+ "clip_ratio/low_min": 0.005675954627804458,
922
+ "clip_ratio/region_mean": 0.006224200245924294,
923
+ "completions/clipped_ratio": 0.0078125,
924
+ "completions/max_length": 51.0,
925
+ "completions/mean_length": 6.5078125,
926
+ "completions/min_length": 3.0,
927
+ "epoch": 0.5318559556786704,
928
+ "grad_norm": 2.4236302292247642,
929
+ "kl": 80.9618124118424,
930
+ "learning_rate": 0.00019622680003092503,
931
+ "loss": 0.005468316841870546,
932
+ "memory(GiB)": 79.88,
933
+ "reward": 0.0703125,
934
+ "reward_std": 0.1054728701710701,
935
+ "rewards/Response_no_think_reward/mean": 0.0703125,
936
+ "rewards/Response_no_think_reward/std": 0.50483638048172,
937
+ "step": 48,
938
+ "train_speed(iter/s)": 0.003952
939
+ },
940
+ {
941
+ "clip_ratio/high_max": 0.0366715406998992,
942
+ "clip_ratio/high_mean": 0.0366715406998992,
943
+ "clip_ratio/low_mean": 0.0379418209195137,
944
+ "clip_ratio/low_min": 0.0379418209195137,
945
+ "clip_ratio/region_mean": 0.07461336255073547,
946
+ "epoch": 0.5429362880886427,
947
+ "grad_norm": 27.44200416529675,
948
+ "kl": 31.79825783398701,
949
+ "learning_rate": 0.0001959727909875389,
950
+ "loss": 0.08109890669584274,
951
+ "memory(GiB)": 79.88,
952
+ "step": 49,
953
+ "train_speed(iter/s)": 0.003972
954
+ },
955
+ {
956
+ "clip_ratio/high_max": 0.002227982331532985,
957
+ "clip_ratio/high_mean": 0.002227982331532985,
958
+ "clip_ratio/low_mean": 0.006371813942678273,
959
+ "clip_ratio/low_min": 0.006371813942678273,
960
+ "clip_ratio/region_mean": 0.008599796216003597,
961
+ "completions/clipped_ratio": 0.0078125,
962
+ "completions/max_length": 51.0,
963
+ "completions/mean_length": 7.3125,
964
+ "completions/min_length": 5.0,
965
+ "epoch": 0.554016620498615,
966
+ "grad_norm": 1.8915627714701582,
967
+ "kl": 32.8292202873854,
968
+ "learning_rate": 0.00019571068366759143,
969
+ "loss": 0.004485747776925564,
970
+ "memory(GiB)": 79.88,
971
+ "reward": 0.046875,
972
+ "reward_std": 0.2615792155265808,
973
+ "rewards/Response_no_think_reward/mean": 0.046875,
974
+ "rewards/Response_no_think_reward/std": 0.5731440782546997,
975
+ "step": 50,
976
+ "train_speed(iter/s)": 0.003883
977
+ },
978
+ {
979
+ "clip_ratio/high_max": 0.02533616591244936,
980
+ "clip_ratio/high_mean": 0.02533616591244936,
981
+ "clip_ratio/low_mean": 0.05068295169621706,
982
+ "clip_ratio/low_min": 0.05068295169621706,
983
+ "clip_ratio/region_mean": 0.07601911667734385,
984
+ "epoch": 0.5650969529085873,
985
+ "grad_norm": 3.4383916295396406,
986
+ "kl": 341.1058924796962,
987
+ "learning_rate": 0.00019544050018795075,
988
+ "loss": -2.989325366797857e-06,
989
+ "memory(GiB)": 79.88,
990
+ "step": 51,
991
+ "train_speed(iter/s)": 0.003903
992
+ },
993
+ {
994
+ "clip_ratio/high_max": 0.0,
995
+ "clip_ratio/high_mean": 0.0,
996
+ "clip_ratio/low_mean": 0.0021551724057644606,
997
+ "clip_ratio/low_min": 0.0021551724057644606,
998
+ "clip_ratio/region_mean": 0.0021551724057644606,
999
+ "completions/clipped_ratio": 0.0,
1000
+ "completions/max_length": 24.0,
1001
+ "completions/mean_length": 6.3046875,
1002
+ "completions/min_length": 6.0,
1003
+ "epoch": 0.5761772853185596,
1004
+ "grad_norm": 0.7839236512036062,
1005
+ "kl": 20.716427901759744,
1006
+ "learning_rate": 0.0001951622633469592,
1007
+ "loss": 0.0010195983340963721,
1008
+ "memory(GiB)": 79.88,
1009
+ "reward": 0.0390625,
1010
+ "reward_std": 0.09916213154792786,
1011
+ "rewards/Response_no_think_reward/mean": 0.0390625,
1012
+ "rewards/Response_no_think_reward/std": 0.3847965598106384,
1013
+ "step": 52,
1014
+ "train_speed(iter/s)": 0.003843
1015
+ },
1016
+ {
1017
+ "clip_ratio/high_max": 0.0052083334885537624,
1018
+ "clip_ratio/high_mean": 0.0052083334885537624,
1019
+ "clip_ratio/low_mean": 0.031070403289049864,
1020
+ "clip_ratio/low_min": 0.031070403289049864,
1021
+ "clip_ratio/region_mean": 0.036278736777603626,
1022
+ "epoch": 0.5872576177285319,
1023
+ "grad_norm": 0.5191411391520966,
1024
+ "kl": 69.86534339073114,
1025
+ "learning_rate": 0.00019487599662250943,
1026
+ "loss": -0.0016538399504497647,
1027
+ "memory(GiB)": 79.88,
1028
+ "step": 53,
1029
+ "train_speed(iter/s)": 0.003863
1030
+ },
1031
+ {
1032
+ "clip_ratio/high_max": 0.0,
1033
+ "clip_ratio/high_mean": 0.0,
1034
+ "clip_ratio/low_mean": 0.0052784152794629335,
1035
+ "clip_ratio/low_min": 0.0052784152794629335,
1036
+ "clip_ratio/region_mean": 0.0052784152794629335,
1037
+ "completions/clipped_ratio": 0.015625,
1038
+ "completions/max_length": 51.0,
1039
+ "completions/mean_length": 7.3046875,
1040
+ "completions/min_length": 3.0,
1041
+ "epoch": 0.5983379501385041,
1042
+ "grad_norm": 2.311740957637672,
1043
+ "kl": 2.841107105177798,
1044
+ "learning_rate": 0.00019458172417006347,
1045
+ "loss": 0.004196230787783861,
1046
+ "memory(GiB)": 79.88,
1047
+ "reward": 0.3984375,
1048
+ "reward_std": 0.26962828636169434,
1049
+ "rewards/Response_no_think_reward/mean": 0.3984375,
1050
+ "rewards/Response_no_think_reward/std": 1.0221164226531982,
1051
+ "step": 54,
1052
+ "train_speed(iter/s)": 0.003692
1053
+ },
1054
+ {
1055
+ "clip_ratio/high_max": 0.017684109043329954,
1056
+ "clip_ratio/high_mean": 0.017684109043329954,
1057
+ "clip_ratio/low_mean": 0.09186162473633885,
1058
+ "clip_ratio/low_min": 0.09186162473633885,
1059
+ "clip_ratio/region_mean": 0.10954573331400752,
1060
+ "epoch": 0.6094182825484764,
1061
+ "grad_norm": 2.0764162059344025,
1062
+ "kl": 263.63854900409933,
1063
+ "learning_rate": 0.00019427947082061432,
1064
+ "loss": 0.006979572586715221,
1065
+ "memory(GiB)": 79.88,
1066
+ "step": 55,
1067
+ "train_speed(iter/s)": 0.003712
1068
+ },
1069
+ {
1070
+ "clip_ratio/high_max": 0.0,
1071
+ "clip_ratio/high_mean": 0.0,
1072
+ "clip_ratio/low_mean": 0.018976572435349226,
1073
+ "clip_ratio/low_min": 0.018976572435349226,
1074
+ "clip_ratio/region_mean": 0.018976572435349226,
1075
+ "completions/clipped_ratio": 0.0078125,
1076
+ "completions/max_length": 51.0,
1077
+ "completions/mean_length": 8.0,
1078
+ "completions/min_length": 3.0,
1079
+ "epoch": 0.6204986149584487,
1080
+ "grad_norm": 2.3049148508787534,
1081
+ "kl": 227.90118128014728,
1082
+ "learning_rate": 0.00019396926207859084,
1083
+ "loss": 0.00933245662599802,
1084
+ "memory(GiB)": 79.88,
1085
+ "reward": -0.1171875,
1086
+ "reward_std": 0.33797404170036316,
1087
+ "rewards/Response_no_think_reward/mean": -0.1171875,
1088
+ "rewards/Response_no_think_reward/std": 0.7594143748283386,
1089
+ "step": 56,
1090
+ "train_speed(iter/s)": 0.003618
1091
+ },
1092
+ {
1093
+ "clip_ratio/high_max": 0.024031779495999217,
1094
+ "clip_ratio/high_mean": 0.024031779495999217,
1095
+ "clip_ratio/low_mean": 0.10989384504500777,
1096
+ "clip_ratio/low_min": 0.10989384504500777,
1097
+ "clip_ratio/region_mean": 0.13392562558874488,
1098
+ "epoch": 0.631578947368421,
1099
+ "grad_norm": 408.32691013228697,
1100
+ "kl": 23.09741603245493,
1101
+ "learning_rate": 0.0001936511241197055,
1102
+ "loss": 1.690829873085022,
1103
+ "memory(GiB)": 79.88,
1104
+ "step": 57,
1105
+ "train_speed(iter/s)": 0.003638
1106
+ },
1107
+ {
1108
+ "clip_ratio/high_max": 0.00028280544211156666,
1109
+ "clip_ratio/high_mean": 0.00028280544211156666,
1110
+ "clip_ratio/low_mean": 0.023381341248750687,
1111
+ "clip_ratio/low_min": 0.023381341248750687,
1112
+ "clip_ratio/region_mean": 0.023664146661758423,
1113
+ "completions/clipped_ratio": 0.046875,
1114
+ "completions/max_length": 51.0,
1115
+ "completions/mean_length": 12.25,
1116
+ "completions/min_length": 3.0,
1117
+ "epoch": 0.6426592797783933,
1118
+ "grad_norm": 2.545625270383155,
1119
+ "kl": 130.25380403241434,
1120
+ "learning_rate": 0.0001933250837887457,
1121
+ "loss": 0.014269158244132996,
1122
+ "memory(GiB)": 79.88,
1123
+ "reward": 0.203125,
1124
+ "reward_std": 0.3562659025192261,
1125
+ "rewards/Response_no_think_reward/mean": 0.203125,
1126
+ "rewards/Response_no_think_reward/std": 1.0600800514221191,
1127
+ "step": 58,
1128
+ "train_speed(iter/s)": 0.003488
1129
+ },
1130
+ {
1131
+ "clip_ratio/high_max": 0.0029069767333567142,
1132
+ "clip_ratio/high_mean": 0.0029069767333567142,
1133
+ "clip_ratio/low_mean": 0.15388594008982182,
1134
+ "clip_ratio/low_min": 0.15388594008982182,
1135
+ "clip_ratio/region_mean": 0.15679291728883982,
1136
+ "epoch": 0.6537396121883656,
1137
+ "grad_norm": 16.25636826382254,
1138
+ "kl": 3078.323552307884,
1139
+ "learning_rate": 0.0001929911685973088,
1140
+ "loss": 0.1047079786658287,
1141
+ "memory(GiB)": 79.88,
1142
+ "step": 59,
1143
+ "train_speed(iter/s)": 0.003508
1144
+ },
1145
+ {
1146
+ "clip_ratio/high_max": 0.0012499999720603228,
1147
+ "clip_ratio/high_mean": 0.0012499999720603228,
1148
+ "clip_ratio/low_mean": 0.032458390574902296,
1149
+ "clip_ratio/low_min": 0.032458390574902296,
1150
+ "clip_ratio/region_mean": 0.03370839054696262,
1151
+ "completions/clipped_ratio": 0.125,
1152
+ "completions/max_length": 51.0,
1153
+ "completions/mean_length": 10.96875,
1154
+ "completions/min_length": 4.0,
1155
+ "epoch": 0.6648199445983379,
1156
+ "grad_norm": 7.944638763107582,
1157
+ "kl": 1613.5422123023309,
1158
+ "learning_rate": 0.00019264940672148018,
1159
+ "loss": 0.06612621992826462,
1160
+ "memory(GiB)": 79.88,
1161
+ "reward": -0.2109375,
1162
+ "reward_std": 0.21648234128952026,
1163
+ "rewards/Response_no_think_reward/mean": -0.2109375,
1164
+ "rewards/Response_no_think_reward/std": 0.4636782705783844,
1165
+ "step": 60,
1166
+ "train_speed(iter/s)": 0.003389
1167
+ }
1168
+ ],
1169
+ "logging_steps": 1,
1170
+ "max_steps": 360,
1171
+ "num_input_tokens_seen": 0,
1172
+ "num_train_epochs": 4,
1173
+ "save_steps": 5,
1174
+ "stateful_callbacks": {
1175
+ "TrainerControl": {
1176
+ "args": {
1177
+ "should_epoch_stop": false,
1178
+ "should_evaluate": false,
1179
+ "should_log": false,
1180
+ "should_save": true,
1181
+ "should_training_stop": false
1182
+ },
1183
+ "attributes": {}
1184
+ }
1185
+ },
1186
+ "total_flos": 0.0,
1187
+ "train_batch_size": 8,
1188
+ "trial_name": null,
1189
+ "trial_params": null
1190
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d687b8e1a620d39f463f0cdaff5c9b4a3e4b169125aef77a418326896c9811b
3
+ size 10208
zero_to_fp32.py ADDED
@@ -0,0 +1,760 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example:
14
+ # python zero_to_fp32.py . output_dir/
15
+ # or
16
+ # python zero_to_fp32.py . output_dir/ --safe_serialization
17
+
18
+ import argparse
19
+ import torch
20
+ import glob
21
+ import math
22
+ import os
23
+ import re
24
+ import gc
25
+ import json
26
+ import numpy as np
27
+ from tqdm import tqdm
28
+ from collections import OrderedDict
29
+ from dataclasses import dataclass
30
+
31
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
32
+ # DeepSpeed data structures it has to be available in the current python environment.
33
+ from deepspeed.utils import logger
34
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
35
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
36
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
37
+
38
+
39
+ @dataclass
40
+ class zero_model_state:
41
+ buffers: dict()
42
+ param_shapes: dict()
43
+ shared_params: list
44
+ ds_version: int
45
+ frozen_param_shapes: dict()
46
+ frozen_param_fragments: dict()
47
+
48
+
49
+ debug = 0
50
+
51
+ # load to cpu
52
+ device = torch.device('cpu')
53
+
54
+
55
+ def atoi(text):
56
+ return int(text) if text.isdigit() else text
57
+
58
+
59
+ def natural_keys(text):
60
+ '''
61
+ alist.sort(key=natural_keys) sorts in human order
62
+ http://nedbatchelder.com/blog/200712/human_sorting.html
63
+ (See Toothy's implementation in the comments)
64
+ '''
65
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
66
+
67
+
68
+ def get_model_state_file(checkpoint_dir, zero_stage):
69
+ if not os.path.isdir(checkpoint_dir):
70
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
71
+
72
+ # there should be only one file
73
+ if zero_stage <= 2:
74
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
75
+ elif zero_stage == 3:
76
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
77
+
78
+ if not os.path.exists(file):
79
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
80
+
81
+ return file
82
+
83
+
84
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
85
+ # XXX: need to test that this simple glob rule works for multi-node setup too
86
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
87
+
88
+ if len(ckpt_files) == 0:
89
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
90
+
91
+ return ckpt_files
92
+
93
+
94
+ def get_optim_files(checkpoint_dir):
95
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
96
+
97
+
98
+ def get_model_state_files(checkpoint_dir):
99
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
100
+
101
+
102
+ def parse_model_states(files):
103
+ zero_model_states = []
104
+ for file in files:
105
+ state_dict = torch.load(file, map_location=device, weights_only=False)
106
+
107
+ if BUFFER_NAMES not in state_dict:
108
+ raise ValueError(f"{file} is not a model state checkpoint")
109
+ buffer_names = state_dict[BUFFER_NAMES]
110
+ if debug:
111
+ print("Found buffers:", buffer_names)
112
+
113
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
114
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
115
+ param_shapes = state_dict[PARAM_SHAPES]
116
+
117
+ # collect parameters that are included in param_shapes
118
+ param_names = []
119
+ for s in param_shapes:
120
+ for name in s.keys():
121
+ param_names.append(name)
122
+
123
+ # update with frozen parameters
124
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
125
+ if frozen_param_shapes is not None:
126
+ if debug:
127
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
128
+ param_names += list(frozen_param_shapes.keys())
129
+
130
+ # handle shared params
131
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
132
+
133
+ ds_version = state_dict.get(DS_VERSION, None)
134
+
135
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
136
+
137
+ z_model_state = zero_model_state(buffers=buffers,
138
+ param_shapes=param_shapes,
139
+ shared_params=shared_params,
140
+ ds_version=ds_version,
141
+ frozen_param_shapes=frozen_param_shapes,
142
+ frozen_param_fragments=frozen_param_fragments)
143
+ zero_model_states.append(z_model_state)
144
+
145
+ return zero_model_states
146
+
147
+
148
+ def parse_optim_states(files, ds_checkpoint_dir):
149
+ total_files = len(files)
150
+ state_dicts = []
151
+ for f in tqdm(files, desc='Loading checkpoint shards'):
152
+ state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
153
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
154
+ # and also handle the case where it was already removed by another helper script
155
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
156
+ state_dicts.append(state_dict)
157
+
158
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
159
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
160
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
161
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
162
+
163
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
164
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
165
+ # use the max of the partition_count to get the dp world_size.
166
+
167
+ if type(world_size) is list:
168
+ world_size = max(world_size)
169
+
170
+ if world_size != total_files:
171
+ raise ValueError(
172
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
173
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
174
+ )
175
+
176
+ # the groups are named differently in each stage
177
+ if zero_stage <= 2:
178
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
179
+ elif zero_stage == 3:
180
+ fp32_groups_key = FP32_FLAT_GROUPS
181
+ else:
182
+ raise ValueError(f"unknown zero stage {zero_stage}")
183
+
184
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
185
+ return zero_stage, world_size, fp32_flat_groups
186
+
187
+
188
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
189
+ """
190
+ Returns fp32 state_dict reconstructed from ds checkpoint
191
+
192
+ Args:
193
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
194
+
195
+ """
196
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
197
+
198
+ optim_files = get_optim_files(ds_checkpoint_dir)
199
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
200
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
201
+
202
+ model_files = get_model_state_files(ds_checkpoint_dir)
203
+
204
+ zero_model_states = parse_model_states(model_files)
205
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
206
+
207
+ if zero_stage <= 2:
208
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
209
+ exclude_frozen_parameters)
210
+ elif zero_stage == 3:
211
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
212
+ exclude_frozen_parameters)
213
+
214
+
215
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
216
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
217
+ return
218
+
219
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
220
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
221
+
222
+ if debug:
223
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
224
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
225
+
226
+ wanted_params = len(frozen_param_shapes)
227
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
228
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
229
+ print(f'Frozen params: Have {avail_numel} numels to process.')
230
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
231
+
232
+ total_params = 0
233
+ total_numel = 0
234
+ for name, shape in frozen_param_shapes.items():
235
+ total_params += 1
236
+ unpartitioned_numel = shape.numel()
237
+ total_numel += unpartitioned_numel
238
+
239
+ state_dict[name] = frozen_param_fragments[name]
240
+
241
+ if debug:
242
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
243
+
244
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
245
+
246
+
247
+ def _has_callable(obj, fn):
248
+ attr = getattr(obj, fn, None)
249
+ return callable(attr)
250
+
251
+
252
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
253
+ param_shapes = zero_model_states[0].param_shapes
254
+
255
+ # Reconstruction protocol:
256
+ #
257
+ # XXX: document this
258
+
259
+ if debug:
260
+ for i in range(world_size):
261
+ for j in range(len(fp32_flat_groups[0])):
262
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
263
+
264
+ # XXX: memory usage doubles here (zero2)
265
+ num_param_groups = len(fp32_flat_groups[0])
266
+ merged_single_partition_of_fp32_groups = []
267
+ for i in range(num_param_groups):
268
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
269
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
270
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
271
+ avail_numel = sum(
272
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
273
+
274
+ if debug:
275
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
276
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
277
+ # not asserting if there is a mismatch due to possible padding
278
+ print(f"Have {avail_numel} numels to process.")
279
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
280
+
281
+ # params
282
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
283
+ # out-of-core computing solution
284
+ total_numel = 0
285
+ total_params = 0
286
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
287
+ offset = 0
288
+ avail_numel = full_single_fp32_vector.numel()
289
+ for name, shape in shapes.items():
290
+
291
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
292
+ total_numel += unpartitioned_numel
293
+ total_params += 1
294
+
295
+ if debug:
296
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
297
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
298
+ offset += unpartitioned_numel
299
+
300
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
301
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
302
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
303
+ # live optimizer object, so we are checking that the numbers are within the right range
304
+ align_to = 2 * world_size
305
+
306
+ def zero2_align(x):
307
+ return align_to * math.ceil(x / align_to)
308
+
309
+ if debug:
310
+ print(f"original offset={offset}, avail_numel={avail_numel}")
311
+
312
+ offset = zero2_align(offset)
313
+ avail_numel = zero2_align(avail_numel)
314
+
315
+ if debug:
316
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
317
+
318
+ # Sanity check
319
+ if offset != avail_numel:
320
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
321
+
322
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
323
+
324
+
325
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
326
+ exclude_frozen_parameters):
327
+ state_dict = OrderedDict()
328
+
329
+ # buffers
330
+ buffers = zero_model_states[0].buffers
331
+ state_dict.update(buffers)
332
+ if debug:
333
+ print(f"added {len(buffers)} buffers")
334
+
335
+ if not exclude_frozen_parameters:
336
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
337
+
338
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
339
+
340
+ # recover shared parameters
341
+ for pair in zero_model_states[0].shared_params:
342
+ if pair[1] in state_dict:
343
+ state_dict[pair[0]] = state_dict[pair[1]]
344
+
345
+ return state_dict
346
+
347
+
348
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
349
+ remainder = unpartitioned_numel % world_size
350
+ padding_numel = (world_size - remainder) if remainder else 0
351
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
352
+ return partitioned_numel, padding_numel
353
+
354
+
355
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
356
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
357
+ return
358
+
359
+ if debug:
360
+ for i in range(world_size):
361
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
362
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
363
+
364
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
365
+ wanted_params = len(frozen_param_shapes)
366
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
367
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
368
+ print(f'Frozen params: Have {avail_numel} numels to process.')
369
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
370
+
371
+ total_params = 0
372
+ total_numel = 0
373
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
374
+ total_params += 1
375
+ unpartitioned_numel = shape.numel()
376
+ total_numel += unpartitioned_numel
377
+
378
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
379
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
380
+
381
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
382
+
383
+ if debug:
384
+ print(
385
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
386
+ )
387
+
388
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
389
+
390
+
391
+ class GatheredTensor:
392
+ """
393
+ A pseudo tensor that collects partitioned weights.
394
+ It is more memory efficient when there are multiple groups.
395
+ """
396
+
397
+ def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
398
+ self.flat_groups = flat_groups
399
+ self.flat_groups_offset = flat_groups_offset
400
+ self.offset = offset
401
+ self.partitioned_numel = partitioned_numel
402
+ self.shape = shape
403
+ self.dtype = self.flat_groups[0][0].dtype
404
+
405
+ def contiguous(self):
406
+ """
407
+ Merge partitioned weights from flat_groups into a single tensor.
408
+ """
409
+ end_idx = self.offset + self.partitioned_numel
410
+ world_size = len(self.flat_groups)
411
+ pad_flat_param_chunks = []
412
+
413
+ for rank_i in range(world_size):
414
+ # for each rank, we need to collect weights from related group/groups
415
+ flat_groups_at_rank_i = self.flat_groups[rank_i]
416
+ start_group_id = None
417
+ end_group_id = None
418
+ for group_id in range(len(self.flat_groups_offset)):
419
+ if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
420
+ start_group_id = group_id
421
+ if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
422
+ end_group_id = group_id
423
+ break
424
+ # collect weights from related group/groups
425
+ for group_id in range(start_group_id, end_group_id + 1):
426
+ flat_tensor = flat_groups_at_rank_i[group_id]
427
+ start_offset = self.offset - self.flat_groups_offset[group_id]
428
+ end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
429
+ pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
430
+
431
+ # collect weights from all ranks
432
+ pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
433
+ param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
434
+ return param
435
+
436
+
437
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
438
+ param_shapes = zero_model_states[0].param_shapes
439
+ avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
440
+
441
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
442
+ # param, re-consolidating each param, while dealing with padding if any
443
+
444
+ # merge list of dicts, preserving order
445
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
446
+
447
+ if debug:
448
+ for i in range(world_size):
449
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
450
+
451
+ wanted_params = len(param_shapes)
452
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
453
+ # not asserting if there is a mismatch due to possible padding
454
+ avail_numel = fp32_flat_groups[0].numel() * world_size
455
+ print(f"Trainable params: Have {avail_numel} numels to process.")
456
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
457
+
458
+ # params
459
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
460
+ # out-of-core computing solution
461
+ offset = 0
462
+ total_numel = 0
463
+ total_params = 0
464
+ flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
465
+ for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
466
+ unpartitioned_numel = shape.numel()
467
+ total_numel += unpartitioned_numel
468
+ total_params += 1
469
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
470
+
471
+ if debug:
472
+ print(
473
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
474
+ )
475
+
476
+ # memory efficient tensor
477
+ tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
478
+ state_dict[name] = tensor
479
+ offset += partitioned_numel
480
+
481
+ offset *= world_size
482
+
483
+ # Sanity check
484
+ if offset != avail_numel:
485
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
486
+
487
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
488
+
489
+
490
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
491
+ exclude_frozen_parameters):
492
+ state_dict = OrderedDict()
493
+
494
+ # buffers
495
+ buffers = zero_model_states[0].buffers
496
+ state_dict.update(buffers)
497
+ if debug:
498
+ print(f"added {len(buffers)} buffers")
499
+
500
+ if not exclude_frozen_parameters:
501
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
502
+
503
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
504
+
505
+ # recover shared parameters
506
+ for pair in zero_model_states[0].shared_params:
507
+ if pair[1] in state_dict:
508
+ state_dict[pair[0]] = state_dict[pair[1]]
509
+
510
+ return state_dict
511
+
512
+
513
+ def to_torch_tensor(state_dict, return_empty_tensor=False):
514
+ """
515
+ Convert state_dict of GatheredTensor to torch tensor
516
+ """
517
+ torch_state_dict = {}
518
+ converted_tensors = {}
519
+ for name, tensor in state_dict.items():
520
+ tensor_id = id(tensor)
521
+ if tensor_id in converted_tensors: # shared tensors
522
+ shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
523
+ torch_state_dict[name] = shared_tensor
524
+ else:
525
+ converted_tensors[tensor_id] = name
526
+ if return_empty_tensor:
527
+ torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
528
+ else:
529
+ torch_state_dict[name] = tensor.contiguous()
530
+ return torch_state_dict
531
+
532
+
533
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
534
+ tag=None,
535
+ exclude_frozen_parameters=False,
536
+ lazy_mode=False):
537
+ """
538
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
539
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
540
+ via a model hub.
541
+
542
+ Args:
543
+ - ``checkpoint_dir``: path to the desired checkpoint folder
544
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
545
+ - ``exclude_frozen_parameters``: exclude frozen parameters
546
+ - ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
547
+ Convert the pesduo tensor to torch tensor by ``.contiguous()``
548
+
549
+ Returns:
550
+ - pytorch ``state_dict``
551
+
552
+ A typical usage might be ::
553
+
554
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
555
+ # do the training and checkpoint saving
556
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
557
+ model = model.cpu() # move to cpu
558
+ model.load_state_dict(state_dict)
559
+ # submit to model hub or save the model to share with others
560
+
561
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
562
+ application. i.e. you will need to re-initialize the deepspeed engine, since
563
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
564
+
565
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
566
+
567
+ Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
568
+ You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
569
+ the checkpoint. Or you can load state_dict in lazy mode ::
570
+
571
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
572
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
573
+ for name, lazy_tensor in state_dict.item():
574
+ tensor = lazy_tensor.contiguous() # to cpu
575
+ print(name, tensor)
576
+ # del tensor to release memory if it no longer in use
577
+ """
578
+ if tag is None:
579
+ latest_path = os.path.join(checkpoint_dir, 'latest')
580
+ if os.path.isfile(latest_path):
581
+ with open(latest_path, 'r') as fd:
582
+ tag = fd.read().strip()
583
+ else:
584
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
585
+
586
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
587
+
588
+ if not os.path.isdir(ds_checkpoint_dir):
589
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
590
+
591
+ state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
592
+ if lazy_mode:
593
+ return state_dict
594
+ else:
595
+ return to_torch_tensor(state_dict)
596
+
597
+
598
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
599
+ output_dir,
600
+ max_shard_size="5GB",
601
+ safe_serialization=False,
602
+ tag=None,
603
+ exclude_frozen_parameters=False):
604
+ """
605
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
606
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
607
+
608
+ Args:
609
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
610
+ - ``output_dir``: directory to the pytorch fp32 state_dict output files
611
+ - ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
612
+ - ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
613
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
614
+ - ``exclude_frozen_parameters``: exclude frozen parameters
615
+ """
616
+
617
+ # Dependency pre-check
618
+ if safe_serialization:
619
+ try:
620
+ from safetensors.torch import save_file
621
+ except ImportError:
622
+ print('If you want to use `safe_serialization`, please `pip install safetensors`')
623
+ raise
624
+ if max_shard_size is not None:
625
+ try:
626
+ from huggingface_hub import split_torch_state_dict_into_shards
627
+ except ImportError:
628
+ print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
629
+ raise
630
+
631
+ # Convert zero checkpoint to state_dict
632
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
633
+ tag,
634
+ exclude_frozen_parameters,
635
+ lazy_mode=True)
636
+
637
+ # Shard the model if it is too big.
638
+ weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
639
+ if max_shard_size is not None:
640
+ filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
641
+ # an memory-efficient approach for sharding
642
+ empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
643
+ state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
644
+ filename_pattern=filename_pattern,
645
+ max_shard_size=max_shard_size)
646
+ else:
647
+ from collections import namedtuple
648
+ StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
649
+ state_dict_split = StateDictSplit(is_sharded=False,
650
+ filename_to_tensors={weights_name: list(state_dict.keys())})
651
+
652
+ # Save the model by shard
653
+ os.makedirs(output_dir, exist_ok=True)
654
+ filename_to_tensors = state_dict_split.filename_to_tensors.items()
655
+ for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
656
+ shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
657
+ shard_state_dict = to_torch_tensor(shard_state_dict)
658
+ output_path = os.path.join(output_dir, shard_file)
659
+ if safe_serialization:
660
+ save_file(shard_state_dict, output_path, metadata={"format": "pt"})
661
+ else:
662
+ torch.save(shard_state_dict, output_path)
663
+ # release the memory of current shard
664
+ for tensor_name in list(shard_state_dict.keys()):
665
+ del state_dict[tensor_name]
666
+ del shard_state_dict[tensor_name]
667
+ del shard_state_dict
668
+ gc.collect()
669
+
670
+ # Save index if sharded
671
+ if state_dict_split.is_sharded:
672
+ index = {
673
+ "metadata": state_dict_split.metadata,
674
+ "weight_map": state_dict_split.tensor_to_filename,
675
+ }
676
+ save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
677
+ save_index_file = os.path.join(output_dir, save_index_file)
678
+ with open(save_index_file, "w", encoding="utf-8") as f:
679
+ content = json.dumps(index, indent=2, sort_keys=True) + "\n"
680
+ f.write(content)
681
+
682
+
683
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
684
+ """
685
+ 1. Put the provided model to cpu
686
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
687
+ 3. Load it into the provided model
688
+
689
+ Args:
690
+ - ``model``: the model object to update
691
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
692
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
693
+
694
+ Returns:
695
+ - ``model`: modified model
696
+
697
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
698
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
699
+ conveniently placed for you in the checkpoint folder.
700
+
701
+ A typical usage might be ::
702
+
703
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
704
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
705
+ # submit to model hub or save the model to share with others
706
+
707
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
708
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
709
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
710
+
711
+ """
712
+ logger.info(f"Extracting fp32 weights")
713
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
714
+
715
+ logger.info(f"Overwriting model with fp32 weights")
716
+ model = model.cpu()
717
+ model.load_state_dict(state_dict, strict=False)
718
+
719
+ return model
720
+
721
+
722
+ if __name__ == "__main__":
723
+ parser = argparse.ArgumentParser()
724
+ parser.add_argument("checkpoint_dir",
725
+ type=str,
726
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
727
+ parser.add_argument("output_dir",
728
+ type=str,
729
+ help="directory to the pytorch fp32 state_dict output files"
730
+ "(e.g. path/checkpoint-12-output/)")
731
+ parser.add_argument(
732
+ "--max_shard_size",
733
+ type=str,
734
+ default="5GB",
735
+ help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
736
+ "lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
737
+ "We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
738
+ "without CPU OOM issues.")
739
+ parser.add_argument(
740
+ "--safe_serialization",
741
+ default=False,
742
+ action='store_true',
743
+ help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
744
+ parser.add_argument("-t",
745
+ "--tag",
746
+ type=str,
747
+ default=None,
748
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
749
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
750
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
751
+ args = parser.parse_args()
752
+
753
+ debug = args.debug
754
+
755
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
756
+ args.output_dir,
757
+ max_shard_size=args.max_shard_size,
758
+ safe_serialization=args.safe_serialization,
759
+ tag=args.tag,
760
+ exclude_frozen_parameters=args.exclude_frozen_parameters)