starforge-cli 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- starforge_cli/__init__.py +3 -0
- starforge_cli/api_client.py +589 -0
- starforge_cli/auth.py +349 -0
- starforge_cli/catalog.py +124 -0
- starforge_cli/cli.py +74 -0
- starforge_cli/cli_ui.py +469 -0
- starforge_cli/client_device.py +104 -0
- starforge_cli/commands/__init__.py +1 -0
- starforge_cli/commands/admin.py +140 -0
- starforge_cli/commands/bench.py +94 -0
- starforge_cli/commands/common.py +178 -0
- starforge_cli/commands/dataset.py +150 -0
- starforge_cli/commands/exp.py +213 -0
- starforge_cli/commands/init.py +52 -0
- starforge_cli/commands/jobs.py +223 -0
- starforge_cli/commands/login.py +54 -0
- starforge_cli/commands/plugin.py +243 -0
- starforge_cli/commands/recipe.py +163 -0
- starforge_cli/commands/serve.py +79 -0
- starforge_cli/commands/submit.py +467 -0
- starforge_cli/commands/sweep.py +154 -0
- starforge_cli/config_resolve.py +17 -0
- starforge_cli/data_prep.py +60 -0
- starforge_cli/new_experiment.py +195 -0
- starforge_cli/packing.py +179 -0
- starforge_cli/plugins_lock.py +73 -0
- starforge_cli/project.py +130 -0
- starforge_cli/recipe_lock.py +453 -0
- starforge_cli/scaffold/agent-run.py.tmpl +146 -0
- starforge_cli/scaffold/custom-framework/train.sh +56 -0
- starforge_cli/scaffold/experiment-template/.gitkeep +0 -0
- starforge_cli/scaffold/experiment-template/README.md +36 -0
- starforge_cli/scaffold/experiment-template/config.yaml +44 -0
- starforge_cli/scaffold/project/common/README.md +12 -0
- starforge_cli/scaffold/project/common/__init__.py +0 -0
- starforge_cli/scaffold/project/configs/README.md +103 -0
- starforge_cli/scaffold/project/configs/base/README.md +24 -0
- starforge_cli/scaffold/project/configs/base/distillation_math.yaml +284 -0
- starforge_cli/scaffold/project/configs/base/grpo_lora.yaml +30 -0
- starforge_cli/scaffold/project/configs/base/grpo_math_1B.yaml +470 -0
- starforge_cli/scaffold/project/configs/base/grpo_megatron.yaml +43 -0
- starforge_cli/scaffold/project/configs/base/grpo_noncolocated.yaml +18 -0
- starforge_cli/scaffold/project/configs/base/grpo_sliding_puzzle.yaml +81 -0
- starforge_cli/scaffold/project/configs/base/ppo_math_1B.yaml +454 -0
- starforge_cli/scaffold/project/configs/base/rm.yaml +224 -0
- starforge_cli/scaffold/project/configs/base/sft.yaml +294 -0
- starforge_cli/scaffold/project/configs/models/README.md +16 -0
- starforge_cli/scaffold/project/configs/models/qwen3.5-4b.yaml +12 -0
- starforge_cli/scaffold/project/configs/models/qwen3.5-9b.yaml +10 -0
- starforge_cli/scaffold/project/gitignore +11 -0
- starforge_cli/spec_builder.py +372 -0
- starforge_cli-0.1.6.dist-info/METADATA +40 -0
- starforge_cli-0.1.6.dist-info/RECORD +55 -0
- starforge_cli-0.1.6.dist-info/WHEEL +4 -0
- starforge_cli-0.1.6.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
# PPO-DAPO with DTensor (Automodel) Backend
|
|
2
|
+
# DAPO-style PPO: no KL penalty, asymmetric clipping, dual-clip, reward scaling
|
|
3
|
+
# Dynamic sampling is disabled (standard PPO batching).
|
|
4
|
+
|
|
5
|
+
ppo:
|
|
6
|
+
num_prompts_per_step: 32
|
|
7
|
+
num_generations_per_prompt: 16
|
|
8
|
+
max_rollout_turns: 1
|
|
9
|
+
max_num_epochs: 100000
|
|
10
|
+
max_num_steps: 100000
|
|
11
|
+
ppo_epochs: 4
|
|
12
|
+
policy_training_start_step: 0 # number of PPO steps of critic-only warmup before policy training begins
|
|
13
|
+
val_period: 20
|
|
14
|
+
val_at_start: true
|
|
15
|
+
val_at_end: false
|
|
16
|
+
overlong_filtering: false
|
|
17
|
+
max_val_samples: 256
|
|
18
|
+
val_batch_size: 256
|
|
19
|
+
seed: 42
|
|
20
|
+
use_dynamic_sampling: false # DAPO dynamic sampling OFF
|
|
21
|
+
dynamic_sampling_max_gen_batches: 10
|
|
22
|
+
batch_multiplier: 1
|
|
23
|
+
skip_reference_policy_logprobs_calculation: true # No KL, so skip ref logprobs
|
|
24
|
+
|
|
25
|
+
reward_shaping:
|
|
26
|
+
enabled: true
|
|
27
|
+
overlong_buffer_length: 2048
|
|
28
|
+
overlong_buffer_penalty: 1
|
|
29
|
+
max_response_length: 14336
|
|
30
|
+
stop_properly_penalty_coef: null
|
|
31
|
+
|
|
32
|
+
adv_estimator:
|
|
33
|
+
name: "gae"
|
|
34
|
+
gae_lambda: 0.95
|
|
35
|
+
gae_gamma: 1
|
|
36
|
+
normalize_advantages: true
|
|
37
|
+
# VAPO decoupled GAE (arXiv:2504.05118): separate λ for value vs policy.
|
|
38
|
+
# null = use gae_lambda for both (standard GAE, no decoupling).
|
|
39
|
+
gae_lambda_value: null # VAPO: 1.0 (MC-like unbiased value returns)
|
|
40
|
+
gae_lambda_policy: null # VAPO: null (let length_adaptive_alpha decide)
|
|
41
|
+
# Length-adaptive λ_policy = 1 - 1/(α·l). 0 = disabled.
|
|
42
|
+
length_adaptive_alpha: 0.0 # VAPO: 0.05
|
|
43
|
+
|
|
44
|
+
reward_scaling:
|
|
45
|
+
enabled: true
|
|
46
|
+
source_min: 0.0
|
|
47
|
+
source_max: 1.0
|
|
48
|
+
target_min: -1.0 # DAPO: scale rewards to [-1, 1]
|
|
49
|
+
target_max: 1.0
|
|
50
|
+
|
|
51
|
+
loss_fn:
|
|
52
|
+
disable_ppo_ratio: false
|
|
53
|
+
reference_policy_kl_penalty: 0.0 # DAPO: no KL penalty
|
|
54
|
+
reference_policy_kl_type: "k3"
|
|
55
|
+
kl_input_clamp_value: 20.0
|
|
56
|
+
kl_output_clamp_value: 10.0
|
|
57
|
+
ratio_clip_min: 0.2
|
|
58
|
+
ratio_clip_max: 0.28 # DAPO: asymmetric clipping (wider upper bound)
|
|
59
|
+
ratio_clip_c: 10 # DAPO: dual-clip with c=10
|
|
60
|
+
use_on_policy_kl_approximation: false
|
|
61
|
+
use_importance_sampling_correction: false
|
|
62
|
+
truncated_importance_sampling_type: null
|
|
63
|
+
truncated_importance_sampling_ratio: null
|
|
64
|
+
truncated_importance_sampling_ratio_min: null
|
|
65
|
+
sequence_level_importance_ratios: false
|
|
66
|
+
token_level_loss: true
|
|
67
|
+
force_on_policy_ratio: false
|
|
68
|
+
use_kl_in_reward: false # No KL in reward (KL penalty is 0 anyway)
|
|
69
|
+
# VAPO: NLL loss on correct samples. 0 = disabled.
|
|
70
|
+
positive_example_nll_weight: 0.0 # VAPO: 0.1
|
|
71
|
+
|
|
72
|
+
value_loss_fn:
|
|
73
|
+
scale: 0.4
|
|
74
|
+
cliprange: 0.2
|
|
75
|
+
|
|
76
|
+
checkpointing:
|
|
77
|
+
enabled: true
|
|
78
|
+
checkpoint_dir: "results/ppo_dapo"
|
|
79
|
+
metric_name: "val:accuracy"
|
|
80
|
+
higher_is_better: true
|
|
81
|
+
keep_top_k: 5
|
|
82
|
+
save_period: 10
|
|
83
|
+
checkpoint_must_save_by: null
|
|
84
|
+
model_save_format: "safetensors"
|
|
85
|
+
save_consolidated: false
|
|
86
|
+
save_optimizer: true
|
|
87
|
+
|
|
88
|
+
policy:
|
|
89
|
+
model_name: "Qwen/Qwen2.5-1.5B"
|
|
90
|
+
tokenizer:
|
|
91
|
+
name: ${policy.model_name}
|
|
92
|
+
chat_template_kwargs: null
|
|
93
|
+
hf_config_overrides: {}
|
|
94
|
+
train_global_batch_size: 512
|
|
95
|
+
train_micro_batch_size: 4
|
|
96
|
+
generation_batch_size: 64
|
|
97
|
+
logprob_batch_size: ${policy.train_micro_batch_size}
|
|
98
|
+
max_total_sequence_length: 16384
|
|
99
|
+
precision: "bfloat16"
|
|
100
|
+
logprob_chunk_size: null
|
|
101
|
+
offload_optimizer_for_logprob: false
|
|
102
|
+
|
|
103
|
+
dtensor_cfg:
|
|
104
|
+
_v2: true
|
|
105
|
+
enabled: true
|
|
106
|
+
cpu_offload: False
|
|
107
|
+
sequence_parallel: false
|
|
108
|
+
activation_checkpointing: false
|
|
109
|
+
tensor_parallel_size: 1
|
|
110
|
+
context_parallel_size: 1
|
|
111
|
+
custom_parallel_plan: null
|
|
112
|
+
lora_cfg:
|
|
113
|
+
enabled: False
|
|
114
|
+
target_modules: []
|
|
115
|
+
exclude_modules: []
|
|
116
|
+
match_all_linear: true
|
|
117
|
+
dim: 8
|
|
118
|
+
alpha: 32
|
|
119
|
+
dropout: 0.0
|
|
120
|
+
dropout_position: "post"
|
|
121
|
+
lora_A_init: "xavier"
|
|
122
|
+
use_triton: true
|
|
123
|
+
|
|
124
|
+
megatron_cfg:
|
|
125
|
+
enabled: false
|
|
126
|
+
empty_unused_memory_level: 1
|
|
127
|
+
activation_checkpointing: false
|
|
128
|
+
converter_type: "Qwen2ForCausalLM"
|
|
129
|
+
tensor_model_parallel_size: 1
|
|
130
|
+
expert_tensor_parallel_size: 1
|
|
131
|
+
expert_model_parallel_size: 1
|
|
132
|
+
pipeline_model_parallel_size: 1
|
|
133
|
+
num_layers_in_first_pipeline_stage: null
|
|
134
|
+
num_layers_in_last_pipeline_stage: null
|
|
135
|
+
context_parallel_size: 1
|
|
136
|
+
pipeline_dtype: ${policy.precision}
|
|
137
|
+
sequence_parallel: false
|
|
138
|
+
freeze_moe_router: true
|
|
139
|
+
moe_router_dtype: "fp64"
|
|
140
|
+
moe_router_load_balancing_type: "none"
|
|
141
|
+
moe_router_bias_update_rate: 0.0
|
|
142
|
+
moe_permute_fusion: false
|
|
143
|
+
moe_enable_deepep: false
|
|
144
|
+
moe_token_dispatcher_type: "allgather"
|
|
145
|
+
moe_shared_expert_overlap: false
|
|
146
|
+
apply_rope_fusion: True
|
|
147
|
+
bias_activation_fusion: True
|
|
148
|
+
gradient_accumulation_fusion: false
|
|
149
|
+
use_fused_weighted_squared_relu: false
|
|
150
|
+
defer_fp32_logits: False
|
|
151
|
+
moe_per_layer_logging: False
|
|
152
|
+
|
|
153
|
+
optimizer:
|
|
154
|
+
optimizer: "adam"
|
|
155
|
+
lr: 1.0e-6 # DAPO: lower LR
|
|
156
|
+
min_lr: 1.0e-7
|
|
157
|
+
weight_decay: 0.1 # DAPO: higher weight decay
|
|
158
|
+
bf16: true
|
|
159
|
+
fp16: false
|
|
160
|
+
params_dtype: "float32"
|
|
161
|
+
adam_beta1: 0.9
|
|
162
|
+
adam_beta2: 0.999
|
|
163
|
+
adam_eps: 1e-8
|
|
164
|
+
sgd_momentum: 0.9
|
|
165
|
+
use_distributed_optimizer: true
|
|
166
|
+
use_precision_aware_optimizer: true
|
|
167
|
+
clip_grad: ${policy.max_grad_norm}
|
|
168
|
+
optimizer_cpu_offload: false
|
|
169
|
+
optimizer_offload_fraction: 0.0
|
|
170
|
+
|
|
171
|
+
scheduler:
|
|
172
|
+
start_weight_decay: ${policy.megatron_cfg.optimizer.weight_decay}
|
|
173
|
+
end_weight_decay: ${policy.megatron_cfg.optimizer.weight_decay}
|
|
174
|
+
weight_decay_incr_style: "constant"
|
|
175
|
+
lr_decay_style: "constant"
|
|
176
|
+
lr_decay_iters: 1000
|
|
177
|
+
lr_warmup_iters: 10
|
|
178
|
+
lr_warmup_init: 1.0e-7
|
|
179
|
+
|
|
180
|
+
distributed_data_parallel_config:
|
|
181
|
+
grad_reduce_in_fp32: false
|
|
182
|
+
overlap_grad_reduce: true
|
|
183
|
+
overlap_param_gather: true
|
|
184
|
+
use_custom_fsdp: false
|
|
185
|
+
data_parallel_sharding_strategy: "optim_grads_params"
|
|
186
|
+
|
|
187
|
+
fp8_cfg:
|
|
188
|
+
enabled: false
|
|
189
|
+
fp8: "e4m3"
|
|
190
|
+
fp8_recipe: "blockwise"
|
|
191
|
+
fp8_param: false
|
|
192
|
+
env_vars: null
|
|
193
|
+
|
|
194
|
+
dynamic_batching:
|
|
195
|
+
enabled: False
|
|
196
|
+
train_mb_tokens: ${mul:${policy.max_total_sequence_length}, ${policy.train_micro_batch_size}}
|
|
197
|
+
logprob_mb_tokens: ${mul:${policy.max_total_sequence_length}, ${policy.logprob_batch_size}}
|
|
198
|
+
sequence_length_round: 64
|
|
199
|
+
|
|
200
|
+
sequence_packing:
|
|
201
|
+
enabled: True
|
|
202
|
+
train_mb_tokens: ${mul:${policy.max_total_sequence_length}, ${policy.train_micro_batch_size}}
|
|
203
|
+
logprob_mb_tokens: ${mul:${policy.max_total_sequence_length}, ${policy.logprob_batch_size}}
|
|
204
|
+
algorithm: "modified_first_fit_decreasing"
|
|
205
|
+
sequence_length_round: 64
|
|
206
|
+
|
|
207
|
+
make_sequence_length_divisible_by: ${policy.dtensor_cfg.tensor_parallel_size}
|
|
208
|
+
max_grad_norm: 1.0
|
|
209
|
+
|
|
210
|
+
optimizer:
|
|
211
|
+
name: torch.optim.AdamW
|
|
212
|
+
kwargs:
|
|
213
|
+
lr: 1.0e-06
|
|
214
|
+
weight_decay: 0.01
|
|
215
|
+
betas:
|
|
216
|
+
- 0.9
|
|
217
|
+
- 0.999
|
|
218
|
+
eps: 1.0e-08
|
|
219
|
+
foreach: false
|
|
220
|
+
fused: false
|
|
221
|
+
|
|
222
|
+
scheduler:
|
|
223
|
+
- name: torch.optim.lr_scheduler.ConstantLR
|
|
224
|
+
kwargs:
|
|
225
|
+
factor: 1.0
|
|
226
|
+
total_iters: 10000000000
|
|
227
|
+
- milestones: []
|
|
228
|
+
|
|
229
|
+
generation:
|
|
230
|
+
backend: "vllm"
|
|
231
|
+
max_new_tokens: ${policy.max_total_sequence_length}
|
|
232
|
+
temperature: 1.0
|
|
233
|
+
top_p: 1.0
|
|
234
|
+
top_k: null
|
|
235
|
+
stop_token_ids: null
|
|
236
|
+
stop_strings: null
|
|
237
|
+
mcore_generation_config:
|
|
238
|
+
buffer_size_gb: 20
|
|
239
|
+
buffer_guaranteed_fraction: 0.1
|
|
240
|
+
num_cuda_graphs: 16
|
|
241
|
+
block_size_tokens: 256
|
|
242
|
+
use_cuda_graphs_for_non_decode_steps: true
|
|
243
|
+
enable_chunked_prefill: true
|
|
244
|
+
unified_memory_level: 0
|
|
245
|
+
max_tokens: 16384
|
|
246
|
+
vllm_cfg:
|
|
247
|
+
async_engine: false
|
|
248
|
+
precision: ${policy.precision}
|
|
249
|
+
kv_cache_dtype: "auto"
|
|
250
|
+
tensor_parallel_size: 1
|
|
251
|
+
pipeline_parallel_size: 1
|
|
252
|
+
expert_parallel_size: 1
|
|
253
|
+
gpu_memory_utilization: 0.6
|
|
254
|
+
max_model_len: ${policy.max_total_sequence_length}
|
|
255
|
+
enforce_eager: False
|
|
256
|
+
use_deep_gemm: False
|
|
257
|
+
num_last_layers_in_bf16: 0
|
|
258
|
+
num_first_layers_in_bf16: 0
|
|
259
|
+
enable_vllm_metrics_logger: true
|
|
260
|
+
vllm_metrics_logger_interval: 0.5
|
|
261
|
+
vllm_kwargs: {}
|
|
262
|
+
colocated:
|
|
263
|
+
enabled: true
|
|
264
|
+
resources:
|
|
265
|
+
gpus_per_node: null
|
|
266
|
+
num_nodes: null
|
|
267
|
+
|
|
268
|
+
# Value Model with DTensor (Automodel) Backend (for GAE in PPO)
|
|
269
|
+
value:
|
|
270
|
+
model_name: ${policy.model_name}
|
|
271
|
+
tokenizer:
|
|
272
|
+
name: ${value.model_name}
|
|
273
|
+
chat_template_kwargs: null
|
|
274
|
+
hf_config_overrides: {}
|
|
275
|
+
|
|
276
|
+
train_global_batch_size: ${policy.train_global_batch_size}
|
|
277
|
+
train_micro_batch_size: ${policy.train_micro_batch_size}
|
|
278
|
+
max_total_sequence_length: ${policy.max_total_sequence_length}
|
|
279
|
+
make_sequence_length_divisible_by: ${value.dtensor_cfg.tensor_parallel_size}
|
|
280
|
+
precision: "bfloat16"
|
|
281
|
+
|
|
282
|
+
reward_model_cfg:
|
|
283
|
+
enabled: true # DTensor V2 value worker requires reward_model_cfg.enabled=true
|
|
284
|
+
reward_model_type: "regression"
|
|
285
|
+
|
|
286
|
+
dtensor_cfg:
|
|
287
|
+
_v2: true
|
|
288
|
+
enabled: true
|
|
289
|
+
cpu_offload: false
|
|
290
|
+
sequence_parallel: false
|
|
291
|
+
activation_checkpointing: false
|
|
292
|
+
tensor_parallel_size: 1
|
|
293
|
+
context_parallel_size: 1
|
|
294
|
+
custom_parallel_plan: null
|
|
295
|
+
lora_cfg:
|
|
296
|
+
enabled: false
|
|
297
|
+
target_modules: []
|
|
298
|
+
exclude_modules: []
|
|
299
|
+
match_all_linear: true
|
|
300
|
+
dim: 8
|
|
301
|
+
alpha: 32
|
|
302
|
+
dropout: 0.0
|
|
303
|
+
dropout_position: "post"
|
|
304
|
+
lora_A_init: "xavier"
|
|
305
|
+
use_triton: true
|
|
306
|
+
|
|
307
|
+
megatron_cfg:
|
|
308
|
+
enabled: false
|
|
309
|
+
empty_unused_memory_level: 1
|
|
310
|
+
activation_checkpointing: false
|
|
311
|
+
tensor_model_parallel_size: 1
|
|
312
|
+
expert_tensor_parallel_size: 1
|
|
313
|
+
expert_model_parallel_size: 1
|
|
314
|
+
pipeline_model_parallel_size: 1
|
|
315
|
+
num_layers_in_first_pipeline_stage: null
|
|
316
|
+
num_layers_in_last_pipeline_stage: null
|
|
317
|
+
context_parallel_size: 1
|
|
318
|
+
pipeline_dtype: ${value.precision}
|
|
319
|
+
sequence_parallel: false
|
|
320
|
+
freeze_moe_router: true
|
|
321
|
+
moe_router_dtype: "fp64"
|
|
322
|
+
moe_router_load_balancing_type: "none"
|
|
323
|
+
moe_router_bias_update_rate: 0.0
|
|
324
|
+
moe_permute_fusion: false
|
|
325
|
+
moe_enable_deepep: false
|
|
326
|
+
moe_token_dispatcher_type: "allgather"
|
|
327
|
+
moe_shared_expert_overlap: false
|
|
328
|
+
apply_rope_fusion: True
|
|
329
|
+
bias_activation_fusion: True
|
|
330
|
+
gradient_accumulation_fusion: false
|
|
331
|
+
use_fused_weighted_squared_relu: false
|
|
332
|
+
defer_fp32_logits: False
|
|
333
|
+
moe_per_layer_logging: False
|
|
334
|
+
|
|
335
|
+
optimizer:
|
|
336
|
+
optimizer: "adam"
|
|
337
|
+
lr: 2.0e-6
|
|
338
|
+
min_lr: 1.0e-7
|
|
339
|
+
weight_decay: 0.1
|
|
340
|
+
bf16: true
|
|
341
|
+
fp16: false
|
|
342
|
+
params_dtype: "float32"
|
|
343
|
+
adam_beta1: 0.9
|
|
344
|
+
adam_beta2: 0.999
|
|
345
|
+
adam_eps: 1e-8
|
|
346
|
+
sgd_momentum: 0.9
|
|
347
|
+
use_distributed_optimizer: true
|
|
348
|
+
use_precision_aware_optimizer: true
|
|
349
|
+
clip_grad: 1.0
|
|
350
|
+
optimizer_cpu_offload: false
|
|
351
|
+
optimizer_offload_fraction: 0.0
|
|
352
|
+
|
|
353
|
+
scheduler:
|
|
354
|
+
start_weight_decay: 0.1
|
|
355
|
+
end_weight_decay: 0.1
|
|
356
|
+
weight_decay_incr_style: "constant"
|
|
357
|
+
lr_decay_style: "constant"
|
|
358
|
+
lr_decay_iters: 1000
|
|
359
|
+
lr_warmup_iters: 10
|
|
360
|
+
lr_warmup_init: 1.0e-7
|
|
361
|
+
|
|
362
|
+
distributed_data_parallel_config:
|
|
363
|
+
grad_reduce_in_fp32: false
|
|
364
|
+
overlap_grad_reduce: true
|
|
365
|
+
overlap_param_gather: true
|
|
366
|
+
use_custom_fsdp: false
|
|
367
|
+
data_parallel_sharding_strategy: "optim_grads_params"
|
|
368
|
+
|
|
369
|
+
fp8_cfg:
|
|
370
|
+
enabled: false
|
|
371
|
+
fp8: "e4m3"
|
|
372
|
+
fp8_recipe: "blockwise"
|
|
373
|
+
fp8_param: false
|
|
374
|
+
env_vars: null
|
|
375
|
+
|
|
376
|
+
dynamic_batching:
|
|
377
|
+
enabled: false
|
|
378
|
+
train_mb_tokens: ${mul:${value.max_total_sequence_length}, ${value.train_micro_batch_size}}
|
|
379
|
+
# Value has no separate logprob-batch config (get_values is a forward pass
|
|
380
|
+
# analogous to policy logprob); reuse the train microbatch budget.
|
|
381
|
+
logprob_mb_tokens: ${mul:${value.max_total_sequence_length}, ${value.train_micro_batch_size}}
|
|
382
|
+
sequence_length_round: 64
|
|
383
|
+
|
|
384
|
+
sequence_packing:
|
|
385
|
+
enabled: false
|
|
386
|
+
train_mb_tokens: ${mul:${value.max_total_sequence_length}, ${value.train_micro_batch_size}}
|
|
387
|
+
logprob_mb_tokens: ${mul:${value.max_total_sequence_length}, ${value.train_micro_batch_size}}
|
|
388
|
+
algorithm: "modified_first_fit_decreasing"
|
|
389
|
+
|
|
390
|
+
max_grad_norm: 1.0
|
|
391
|
+
|
|
392
|
+
optimizer:
|
|
393
|
+
name: torch.optim.AdamW
|
|
394
|
+
kwargs:
|
|
395
|
+
lr: 1.0e-05
|
|
396
|
+
weight_decay: 0.01
|
|
397
|
+
betas:
|
|
398
|
+
- 0.9
|
|
399
|
+
- 0.999
|
|
400
|
+
eps: 1.0e-08
|
|
401
|
+
foreach: false
|
|
402
|
+
fused: false
|
|
403
|
+
|
|
404
|
+
scheduler:
|
|
405
|
+
- name: torch.optim.lr_scheduler.ConstantLR
|
|
406
|
+
kwargs:
|
|
407
|
+
factor: 1.0
|
|
408
|
+
total_iters: 10000000000
|
|
409
|
+
- milestones: []
|
|
410
|
+
|
|
411
|
+
data:
|
|
412
|
+
max_input_seq_length: 2048
|
|
413
|
+
shuffle: true
|
|
414
|
+
num_workers: 1
|
|
415
|
+
train:
|
|
416
|
+
dataset_name: DAPOMath17K
|
|
417
|
+
validation:
|
|
418
|
+
dataset_name: DAPOMathAIME2024
|
|
419
|
+
default:
|
|
420
|
+
prompt_file: null
|
|
421
|
+
system_prompt_file: null
|
|
422
|
+
processor: "math_hf_data_processor"
|
|
423
|
+
env_name: "math"
|
|
424
|
+
|
|
425
|
+
env:
|
|
426
|
+
math:
|
|
427
|
+
num_workers: 8
|
|
428
|
+
math_verify_impl: "dapo_math_verify"
|
|
429
|
+
|
|
430
|
+
logger:
|
|
431
|
+
log_dir: "logs"
|
|
432
|
+
num_val_samples_to_print: 0
|
|
433
|
+
wandb_enabled: false
|
|
434
|
+
tensorboard_enabled: false
|
|
435
|
+
mlflow_enabled: false
|
|
436
|
+
swanlab_enabled: false
|
|
437
|
+
monitor_gpus: false
|
|
438
|
+
wandb:
|
|
439
|
+
project: "ppo-dapo-dtensor-dev"
|
|
440
|
+
name: "ppo_dapo_dtensor_1B"
|
|
441
|
+
swanlab:
|
|
442
|
+
project: "ppo-dapo-dtensor-dev"
|
|
443
|
+
name: "ppo_dapo_dtensor_1B"
|
|
444
|
+
tensorboard: {}
|
|
445
|
+
mlflow:
|
|
446
|
+
experiment_name: "ppo-dapo-dtensor-dev"
|
|
447
|
+
run_name: "ppo_dapo_dtensor_1B"
|
|
448
|
+
gpu_monitoring:
|
|
449
|
+
collection_interval: 10
|
|
450
|
+
flush_interval: 10
|
|
451
|
+
|
|
452
|
+
cluster:
|
|
453
|
+
gpus_per_node: 1
|
|
454
|
+
num_nodes: 1
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Bradley-Terry (BT) Reward Model Training Configuration
|
|
2
|
+
rm:
|
|
3
|
+
## total number of steps to train will equal
|
|
4
|
+
## min((max_num_epochs * len(train_dataloader)), max_num_steps)
|
|
5
|
+
max_num_epochs: 1
|
|
6
|
+
max_num_steps: -1 # by default, train for 1 epoch
|
|
7
|
+
|
|
8
|
+
val_period: 16
|
|
9
|
+
val_batches: -1
|
|
10
|
+
val_global_batch_size: 32
|
|
11
|
+
val_micro_batch_size: 1
|
|
12
|
+
val_at_start: false
|
|
13
|
+
val_at_end: false
|
|
14
|
+
seed: 42
|
|
15
|
+
|
|
16
|
+
checkpointing:
|
|
17
|
+
enabled: true
|
|
18
|
+
checkpoint_dir: "results/rm"
|
|
19
|
+
metric_name: "val:validation-default_loss" # one of "val:" or "train:" followed by the metric name
|
|
20
|
+
higher_is_better: false
|
|
21
|
+
keep_top_k: 3
|
|
22
|
+
save_period: ${rm.val_period}
|
|
23
|
+
checkpoint_must_save_by: null
|
|
24
|
+
save_optimizer: true
|
|
25
|
+
|
|
26
|
+
policy:
|
|
27
|
+
model_name: "meta-llama/Llama-3.2-1B-Instruct"
|
|
28
|
+
tokenizer:
|
|
29
|
+
name: ${policy.model_name} ## specify if you'd like to use a tokenizer different from the model's default
|
|
30
|
+
# We don't use the "default" chat template because the Llama tokenizer inserts the current
|
|
31
|
+
# date in the system prompt, which could make the reward model's output date-dependent.
|
|
32
|
+
chat_template: "{{- bos_token }}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = '' %}\n{%- endif %}\n\n{#- System message #}\n{{- '<|start_header_id|>system<|end_header_id|>\n\n' }}\n{{- system_message }}\n{{- '<|eot_id|>' }}\n\n{%- for message in messages %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' + message['content'] | trim + '<|eot_id|>' }}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id>\n\n' }}\n{%- endif %}"
|
|
33
|
+
chat_template_kwargs: null # can be used to pass kwargs to the chat template, e.g., enable_thinking=true
|
|
34
|
+
train_global_batch_size: 128
|
|
35
|
+
train_micro_batch_size: 1
|
|
36
|
+
max_total_sequence_length: 8192
|
|
37
|
+
precision: "bfloat16"
|
|
38
|
+
activation_checkpointing_enabled: false
|
|
39
|
+
|
|
40
|
+
offload_optimizer_for_logprob: false
|
|
41
|
+
|
|
42
|
+
reward_model_cfg:
|
|
43
|
+
enabled: true # loads model as a Reward Model (do not change)
|
|
44
|
+
reward_model_type: "bradley_terry" # only "bradley_terry" is currently supported
|
|
45
|
+
|
|
46
|
+
dtensor_cfg:
|
|
47
|
+
enabled: true
|
|
48
|
+
cpu_offload: false
|
|
49
|
+
sequence_parallel: false
|
|
50
|
+
activation_checkpointing: false
|
|
51
|
+
tensor_parallel_size: 1
|
|
52
|
+
context_parallel_size: 1
|
|
53
|
+
custom_parallel_plan: null
|
|
54
|
+
|
|
55
|
+
dynamic_batching:
|
|
56
|
+
enabled: false
|
|
57
|
+
|
|
58
|
+
sequence_packing:
|
|
59
|
+
enabled: false
|
|
60
|
+
|
|
61
|
+
# makes the training sequence length divisible by the tensor parallel size
|
|
62
|
+
# this is useful for sequence parallel training
|
|
63
|
+
make_sequence_length_divisible_by: ${policy.dtensor_cfg.tensor_parallel_size}
|
|
64
|
+
max_grad_norm: 1.0
|
|
65
|
+
|
|
66
|
+
optimizer:
|
|
67
|
+
name: "torch.optim.AdamW"
|
|
68
|
+
kwargs:
|
|
69
|
+
lr: 2.0e-6
|
|
70
|
+
weight_decay: 0.1
|
|
71
|
+
betas: [0.9, 0.98]
|
|
72
|
+
eps: 1e-5
|
|
73
|
+
# when using Dtensor, we need to set `foreach` and `fused` to false
|
|
74
|
+
foreach: false
|
|
75
|
+
fused: false
|
|
76
|
+
|
|
77
|
+
## ignored since enabled=false, but needed for testing purposes
|
|
78
|
+
megatron_cfg:
|
|
79
|
+
enabled: false
|
|
80
|
+
force_reconvert_from_hf: False # Set to True to force reconvert of the model from Hugging Face
|
|
81
|
+
empty_unused_memory_level: 1
|
|
82
|
+
activation_checkpointing: false
|
|
83
|
+
tensor_model_parallel_size: 2
|
|
84
|
+
pipeline_model_parallel_size: 2
|
|
85
|
+
context_parallel_size: 1
|
|
86
|
+
pipeline_dtype: ${policy.precision}
|
|
87
|
+
num_layers_in_first_pipeline_stage: null
|
|
88
|
+
num_layers_in_last_pipeline_stage: null
|
|
89
|
+
sequence_parallel: false
|
|
90
|
+
gradient_accumulation_fusion: false
|
|
91
|
+
use_fused_weighted_squared_relu: false
|
|
92
|
+
|
|
93
|
+
optimizer:
|
|
94
|
+
optimizer: "adam"
|
|
95
|
+
lr: 2.0e-6
|
|
96
|
+
min_lr: 1.9999e-6
|
|
97
|
+
weight_decay: 0.1
|
|
98
|
+
bf16: false
|
|
99
|
+
fp16: false
|
|
100
|
+
params_dtype: "float32"
|
|
101
|
+
|
|
102
|
+
#adam
|
|
103
|
+
adam_beta1: 0.9
|
|
104
|
+
adam_beta2: 0.98
|
|
105
|
+
adam_eps: 1e-5
|
|
106
|
+
|
|
107
|
+
#sgd
|
|
108
|
+
sgd_momentum: 0.9
|
|
109
|
+
|
|
110
|
+
#distributed optimizer
|
|
111
|
+
use_distributed_optimizer: true
|
|
112
|
+
use_precision_aware_optimizer: true
|
|
113
|
+
|
|
114
|
+
clip_grad: ${policy.max_grad_norm}
|
|
115
|
+
|
|
116
|
+
# optimizer cpu offload
|
|
117
|
+
optimizer_cpu_offload: false
|
|
118
|
+
optimizer_offload_fraction: 0.0
|
|
119
|
+
|
|
120
|
+
scheduler:
|
|
121
|
+
start_weight_decay: ${policy.megatron_cfg.optimizer.weight_decay}
|
|
122
|
+
end_weight_decay: ${policy.megatron_cfg.optimizer.weight_decay}
|
|
123
|
+
weight_decay_incr_style: "constant"
|
|
124
|
+
lr_decay_style: "constant"
|
|
125
|
+
lr_decay_iters: 1000
|
|
126
|
+
lr_warmup_iters: 50
|
|
127
|
+
lr_warmup_init: 1.9999e-6
|
|
128
|
+
|
|
129
|
+
distributed_data_parallel_config:
|
|
130
|
+
grad_reduce_in_fp32: false
|
|
131
|
+
overlap_grad_reduce: true
|
|
132
|
+
overlap_param_gather: false
|
|
133
|
+
data_parallel_sharding_strategy: "optim_grads_params"
|
|
134
|
+
|
|
135
|
+
fp8_cfg:
|
|
136
|
+
enabled: false
|
|
137
|
+
fp8: "e4m3"
|
|
138
|
+
fp8_recipe: "blockwise"
|
|
139
|
+
fp8_param: false
|
|
140
|
+
|
|
141
|
+
data:
|
|
142
|
+
max_input_seq_length: ${policy.max_total_sequence_length}
|
|
143
|
+
shuffle: true
|
|
144
|
+
num_workers: 1
|
|
145
|
+
|
|
146
|
+
# dataset
|
|
147
|
+
train:
|
|
148
|
+
dataset_name: HelpSteer3
|
|
149
|
+
split: train
|
|
150
|
+
validation:
|
|
151
|
+
dataset_name: HelpSteer3
|
|
152
|
+
split: validation
|
|
153
|
+
# You can use custom preference datasets for training and validation. For example:
|
|
154
|
+
# 1. PreferenceDataset
|
|
155
|
+
# train:
|
|
156
|
+
# # this dataset will override prompt_key and use the default values for other vars
|
|
157
|
+
# data_path: /path/to/local/train_dataset.jsonl # local file or hf_org/hf_dataset_name (HuggingFace)
|
|
158
|
+
# subset: null # used for HuggingFace datasets
|
|
159
|
+
# split: train # used for HuggingFace datasets
|
|
160
|
+
# validation:
|
|
161
|
+
# # this dataset will use the default values for other vars except data_path
|
|
162
|
+
# data_path: /path/to/local/val_dataset.jsonl
|
|
163
|
+
# default:
|
|
164
|
+
# # will use below vars as default values if dataset doesn't specify it
|
|
165
|
+
# dataset_name: PreferenceDataset
|
|
166
|
+
# prompt_file: null
|
|
167
|
+
# system_prompt_file: null
|
|
168
|
+
# # multiple validation sets is supported by using val_data_paths
|
|
169
|
+
# # this will be removed after refactor
|
|
170
|
+
# val_data_paths:
|
|
171
|
+
# <NameOfValidationDataset1>: /path/to/local/val_dataset_1.jsonl
|
|
172
|
+
# <NameOfValidationDataset2>: /path/to/local/val_dataset_2.jsonl
|
|
173
|
+
# 2. BinaryPreferenceDataset
|
|
174
|
+
# train:
|
|
175
|
+
# # this dataset will override prompt_key and use the default values for other vars
|
|
176
|
+
# data_path: /path/to/local/train_dataset.jsonl # local file or hf_org/hf_dataset_name (HuggingFace)
|
|
177
|
+
# prompt_key: context
|
|
178
|
+
# subset: null # used for HuggingFace datasets
|
|
179
|
+
# split: train # used for HuggingFace datasets
|
|
180
|
+
# validation:
|
|
181
|
+
# # this dataset will use the default values for other vars except data_path
|
|
182
|
+
# data_path: /path/to/local/val_dataset.jsonl
|
|
183
|
+
# default:
|
|
184
|
+
# # will use below vars as default values if dataset doesn't specify it
|
|
185
|
+
# dataset_name: BinaryPreferenceDataset
|
|
186
|
+
# prompt_key: prompt
|
|
187
|
+
# chosen_key: chosen
|
|
188
|
+
# rejected_key: rejected
|
|
189
|
+
# prompt_file: null
|
|
190
|
+
# system_prompt_file: null
|
|
191
|
+
# See https://github.com/NVIDIA-NeMo/RL/blob/main/docs/guides/rm.md#datasets for more details.
|
|
192
|
+
|
|
193
|
+
# If you are doing checkpointing, `metric_name` should reflect the metric and validation set to be tracked. For example:
|
|
194
|
+
# checkpointing:
|
|
195
|
+
# metric_name: "validation-<NameOfValidationDataset1>_loss"
|
|
196
|
+
# ...
|
|
197
|
+
|
|
198
|
+
logger:
|
|
199
|
+
log_dir: "logs" # Base directory for all logs
|
|
200
|
+
wandb_enabled: true # Make sure you do a ``wandb login [Your API key]'' before running
|
|
201
|
+
tensorboard_enabled: true
|
|
202
|
+
mlflow_enabled: false
|
|
203
|
+
swanlab_enabled: false # Disable SwanLab logging
|
|
204
|
+
monitor_gpus: true # If true, will monitor GPU usage and log to wandb and/or tensorboard
|
|
205
|
+
wandb:
|
|
206
|
+
project: "rm-dev"
|
|
207
|
+
name: "rm-dev-${data.train.dataset_name}"
|
|
208
|
+
swanlab:
|
|
209
|
+
project: "rm-dev"
|
|
210
|
+
name: "rm-dev-${data.train.dataset_name}"
|
|
211
|
+
tensorboard:
|
|
212
|
+
log_dir: "tb_logs-rm-dev-${data.train.dataset_name}"
|
|
213
|
+
mlflow:
|
|
214
|
+
experiment_name: "rm-dev"
|
|
215
|
+
run_name: "rm-dev-${data.train.dataset_name}"
|
|
216
|
+
tracking_uri: "http://localhost:5000"
|
|
217
|
+
gpu_monitoring:
|
|
218
|
+
collection_interval: 10 # How often to collect GPU usage metrics (in seconds)
|
|
219
|
+
flush_interval: 10 # How often to flush GPU usage metrics to the loggers (in seconds)
|
|
220
|
+
|
|
221
|
+
cluster:
|
|
222
|
+
gpus_per_node: 1
|
|
223
|
+
num_nodes: 1
|
|
224
|
+
segment_size: null # Nodes per NVLink domain segment for topology-aware alignment; null to disable
|