Anomyous Author For ICLR commited on
Commit
619fd72
·
verified ·
1 Parent(s): 40dbc47

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. 8B-Final/added_tokens.json +34 -0
  3. 8B-Final/config.json +30 -0
  4. 8B-Final/generation_config.json +13 -0
  5. 8B-Final/merges.txt +0 -0
  6. 8B-Final/model-00001-of-00004.safetensors +3 -0
  7. 8B-Final/model-00002-of-00004.safetensors +3 -0
  8. 8B-Final/model-00003-of-00004.safetensors +3 -0
  9. 8B-Final/model-00004-of-00004.safetensors +3 -0
  10. 8B-Final/model.safetensors.index.json +406 -0
  11. 8B-Final/special_tokens_map.json +22 -0
  12. 8B-Final/tokenizer.json +3 -0
  13. 8B-Final/tokenizer_config.json +279 -0
  14. 8B-Final/vocab.json +0 -0
  15. README.md +211 -1
  16. e2c/config/__init__.py +19 -0
  17. e2c/config/_generated_ppo_megatron_trainer.yaml +541 -0
  18. e2c/config/_generated_ppo_trainer.yaml +523 -0
  19. e2c/config/actor/actor.yaml +216 -0
  20. e2c/config/actor/dp_actor.yaml +42 -0
  21. e2c/config/actor/megatron_actor.yaml +20 -0
  22. e2c/config/algorithm.py +87 -0
  23. e2c/config/config.py +77 -0
  24. e2c/config/critic/critic.yaml +176 -0
  25. e2c/config/critic/dp_critic.yaml +65 -0
  26. e2c/config/critic/megatron_critic.yaml +43 -0
  27. e2c/config/data/legacy_data.yaml +112 -0
  28. e2c/config/engine/fsdp.yaml +53 -0
  29. e2c/config/engine/megatron.yaml +78 -0
  30. e2c/config/evaluation.yaml +15 -0
  31. e2c/config/generation.yaml +57 -0
  32. e2c/config/model/hf_model.yaml +64 -0
  33. e2c/config/npu_profile/npu_profile.yaml +34 -0
  34. e2c/config/optim/fsdp.yaml +33 -0
  35. e2c/config/optim/megatron.yaml +49 -0
  36. e2c/config/ppo_megatron_trainer.yaml +173 -0
  37. e2c/config/ppo_trainer.yaml +308 -0
  38. e2c/config/ref/dp_ref.yaml +26 -0
  39. e2c/config/ref/megatron_ref.yaml +19 -0
  40. e2c/config/ref/ref.yaml +99 -0
  41. e2c/config/reward_model/dp_reward_model.yaml +55 -0
  42. e2c/config/reward_model/megatron_reward_model.yaml +65 -0
  43. e2c/config/reward_model/reward_model.yaml +97 -0
  44. e2c/config/rollout/rollout.yaml +291 -0
  45. e2c/config/sft_trainer.yaml +83 -0
  46. e2c/config/sft_trainer_engine.yaml +71 -0
  47. e2c/data/README.md +6 -0
  48. e2c/rl/e2c_rl.sh +78 -0
  49. e2c/sft/e2c_sft.sh +18 -0
  50. e2c/sft/ef-sft.sh +18 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ 8B-Final/tokenizer.json filter=lfs diff=lfs merge=lfs -text
8B-Final/added_tokens.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</EXECUTION>": 151674,
3
+ "</EXPLORATION>": 151672,
4
+ "</think>": 151668,
5
+ "</tool_call>": 151658,
6
+ "</tool_response>": 151666,
7
+ "<EXECUTION>": 151673,
8
+ "<EXPLORATION>": 151671,
9
+ "<deterministic>": 151670,
10
+ "<think>": 151667,
11
+ "<thinking>": 151669,
12
+ "<tool_call>": 151657,
13
+ "<tool_response>": 151665,
14
+ "<|box_end|>": 151649,
15
+ "<|box_start|>": 151648,
16
+ "<|endoftext|>": 151643,
17
+ "<|file_sep|>": 151664,
18
+ "<|fim_middle|>": 151660,
19
+ "<|fim_pad|>": 151662,
20
+ "<|fim_prefix|>": 151659,
21
+ "<|fim_suffix|>": 151661,
22
+ "<|im_end|>": 151645,
23
+ "<|im_start|>": 151644,
24
+ "<|image_pad|>": 151655,
25
+ "<|object_ref_end|>": 151647,
26
+ "<|object_ref_start|>": 151646,
27
+ "<|quad_end|>": 151651,
28
+ "<|quad_start|>": 151650,
29
+ "<|repo_name|>": 151663,
30
+ "<|video_pad|>": 151656,
31
+ "<|vision_end|>": 151653,
32
+ "<|vision_pad|>": 151654,
33
+ "<|vision_start|>": 151652
34
+ }
8B-Final/config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 151643,
8
+ "eos_token_id": 151645,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 4096,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 12288,
14
+ "max_position_embeddings": 40960,
15
+ "max_window_layers": 36,
16
+ "model_type": "qwen3",
17
+ "num_attention_heads": 32,
18
+ "num_hidden_layers": 36,
19
+ "num_key_value_heads": 8,
20
+ "rms_norm_eps": 1e-06,
21
+ "rope_scaling": null,
22
+ "rope_theta": 1000000,
23
+ "sliding_window": null,
24
+ "tie_word_embeddings": false,
25
+ "torch_dtype": "bfloat16",
26
+ "transformers_version": "4.51.1",
27
+ "use_cache": true,
28
+ "use_sliding_window": false,
29
+ "vocab_size": 151675
30
+ }
8B-Final/generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 151645,
6
+ 151643
7
+ ],
8
+ "pad_token_id": 151643,
9
+ "temperature": 0.6,
10
+ "top_k": 20,
11
+ "top_p": 0.95,
12
+ "transformers_version": "4.51.1"
13
+ }
8B-Final/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
8B-Final/model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b4d685dada41f95f4819c7379aa9a8b972fd289bbb7852f7b07404e825bb146
3
+ size 4900119584
8B-Final/model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a64dca24aa2621614d2e8bf5aad957e03a1ecd1bcf255d3d48284306f1a12e5
3
+ size 4915960368
8B-Final/model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6faad15cdd550c7128bd5fcdb7924f4837ea0d5788e4578d0768290048d4a6e7
3
+ size 4983068496
8B-Final/model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67f6f7e76048838f33aeff339bebf445e37251ae818825cb42e79d0bf244ff59
3
+ size 1578092152
8B-Final/model.safetensors.index.json ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 16377194496
4
+ },
5
+ "weight_map": {
6
+ "lm_head.weight": "model-00004-of-00004.safetensors",
7
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
8
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
9
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
10
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
11
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
12
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
13
+ "model.layers.0.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
14
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
15
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
16
+ "model.layers.0.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
17
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
18
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
19
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
20
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
21
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
22
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
23
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
24
+ "model.layers.1.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
25
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
26
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
27
+ "model.layers.1.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
28
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
29
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
30
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
31
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
32
+ "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
33
+ "model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
34
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
35
+ "model.layers.10.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
36
+ "model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
37
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
38
+ "model.layers.10.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
39
+ "model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
40
+ "model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
41
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
42
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
43
+ "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
44
+ "model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
45
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
46
+ "model.layers.11.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
47
+ "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
48
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
49
+ "model.layers.11.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
50
+ "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
51
+ "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
52
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
53
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
54
+ "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
55
+ "model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
56
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
57
+ "model.layers.12.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
58
+ "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
59
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
60
+ "model.layers.12.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
61
+ "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
62
+ "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
63
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
64
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
65
+ "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
66
+ "model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
67
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
68
+ "model.layers.13.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
69
+ "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
70
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
71
+ "model.layers.13.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
72
+ "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
73
+ "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
74
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
75
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
76
+ "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
77
+ "model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
78
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
79
+ "model.layers.14.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
80
+ "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
81
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.14.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
86
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
87
+ "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
88
+ "model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
89
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
90
+ "model.layers.15.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
91
+ "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.15.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
98
+ "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
101
+ "model.layers.16.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
103
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
104
+ "model.layers.16.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
105
+ "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
106
+ "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
107
+ "model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
108
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
109
+ "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
110
+ "model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
111
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
112
+ "model.layers.17.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
113
+ "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
114
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
115
+ "model.layers.17.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
117
+ "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
118
+ "model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
119
+ "model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
120
+ "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
121
+ "model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
122
+ "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
123
+ "model.layers.18.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
124
+ "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
125
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
126
+ "model.layers.18.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
127
+ "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
128
+ "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
129
+ "model.layers.19.input_layernorm.weight": "model-00002-of-00004.safetensors",
130
+ "model.layers.19.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
131
+ "model.layers.19.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
132
+ "model.layers.19.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
133
+ "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
134
+ "model.layers.19.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
135
+ "model.layers.19.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
136
+ "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
137
+ "model.layers.19.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
138
+ "model.layers.19.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
139
+ "model.layers.19.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
140
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
141
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
142
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
143
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
144
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
145
+ "model.layers.2.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
146
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
147
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
148
+ "model.layers.2.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
149
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
150
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
151
+ "model.layers.20.input_layernorm.weight": "model-00002-of-00004.safetensors",
152
+ "model.layers.20.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
153
+ "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
154
+ "model.layers.20.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
155
+ "model.layers.20.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
156
+ "model.layers.20.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
157
+ "model.layers.20.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
158
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
159
+ "model.layers.20.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
160
+ "model.layers.20.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
161
+ "model.layers.20.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
162
+ "model.layers.21.input_layernorm.weight": "model-00002-of-00004.safetensors",
163
+ "model.layers.21.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
164
+ "model.layers.21.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
165
+ "model.layers.21.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
166
+ "model.layers.21.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
167
+ "model.layers.21.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
168
+ "model.layers.21.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
169
+ "model.layers.21.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
170
+ "model.layers.21.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
171
+ "model.layers.21.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
172
+ "model.layers.21.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
173
+ "model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
174
+ "model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
175
+ "model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
176
+ "model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
177
+ "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
178
+ "model.layers.22.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
179
+ "model.layers.22.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
180
+ "model.layers.22.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
181
+ "model.layers.22.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
182
+ "model.layers.22.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
183
+ "model.layers.22.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
184
+ "model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
185
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
186
+ "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
187
+ "model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
188
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
189
+ "model.layers.23.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
190
+ "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
191
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
192
+ "model.layers.23.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
193
+ "model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
194
+ "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
195
+ "model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
196
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
197
+ "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
198
+ "model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
199
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
200
+ "model.layers.24.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
201
+ "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
202
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
203
+ "model.layers.24.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
204
+ "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
205
+ "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
206
+ "model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
207
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
208
+ "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
209
+ "model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
210
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
211
+ "model.layers.25.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
212
+ "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
213
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
214
+ "model.layers.25.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
215
+ "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
216
+ "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
217
+ "model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
218
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
219
+ "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
220
+ "model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
221
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
222
+ "model.layers.26.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
223
+ "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
224
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
225
+ "model.layers.26.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
226
+ "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
227
+ "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
228
+ "model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
229
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
230
+ "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
231
+ "model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
232
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
233
+ "model.layers.27.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
234
+ "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
235
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
236
+ "model.layers.27.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
237
+ "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
238
+ "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
239
+ "model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
240
+ "model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
241
+ "model.layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
242
+ "model.layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
243
+ "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
244
+ "model.layers.28.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
245
+ "model.layers.28.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
246
+ "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
247
+ "model.layers.28.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
248
+ "model.layers.28.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
249
+ "model.layers.28.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
250
+ "model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
251
+ "model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
252
+ "model.layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
253
+ "model.layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
254
+ "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
255
+ "model.layers.29.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
256
+ "model.layers.29.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
257
+ "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
258
+ "model.layers.29.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
259
+ "model.layers.29.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
260
+ "model.layers.29.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
261
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
262
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
263
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
264
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
265
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
266
+ "model.layers.3.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
267
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
268
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
269
+ "model.layers.3.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
270
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
271
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
272
+ "model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
273
+ "model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
274
+ "model.layers.30.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
275
+ "model.layers.30.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
276
+ "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
277
+ "model.layers.30.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
278
+ "model.layers.30.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
279
+ "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
280
+ "model.layers.30.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
281
+ "model.layers.30.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
282
+ "model.layers.30.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
283
+ "model.layers.31.input_layernorm.weight": "model-00003-of-00004.safetensors",
284
+ "model.layers.31.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
285
+ "model.layers.31.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
286
+ "model.layers.31.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
287
+ "model.layers.31.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
288
+ "model.layers.31.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
289
+ "model.layers.31.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
290
+ "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
291
+ "model.layers.31.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
292
+ "model.layers.31.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
293
+ "model.layers.31.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
294
+ "model.layers.32.input_layernorm.weight": "model-00003-of-00004.safetensors",
295
+ "model.layers.32.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
296
+ "model.layers.32.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
297
+ "model.layers.32.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
298
+ "model.layers.32.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
299
+ "model.layers.32.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
300
+ "model.layers.32.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
301
+ "model.layers.32.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
302
+ "model.layers.32.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
303
+ "model.layers.32.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
304
+ "model.layers.32.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
305
+ "model.layers.33.input_layernorm.weight": "model-00003-of-00004.safetensors",
306
+ "model.layers.33.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
307
+ "model.layers.33.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
308
+ "model.layers.33.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
309
+ "model.layers.33.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
310
+ "model.layers.33.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
311
+ "model.layers.33.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
312
+ "model.layers.33.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
313
+ "model.layers.33.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
314
+ "model.layers.33.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
315
+ "model.layers.33.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
316
+ "model.layers.34.input_layernorm.weight": "model-00003-of-00004.safetensors",
317
+ "model.layers.34.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
318
+ "model.layers.34.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
319
+ "model.layers.34.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
320
+ "model.layers.34.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
321
+ "model.layers.34.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
322
+ "model.layers.34.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
323
+ "model.layers.34.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
324
+ "model.layers.34.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
325
+ "model.layers.34.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
326
+ "model.layers.34.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
327
+ "model.layers.35.input_layernorm.weight": "model-00004-of-00004.safetensors",
328
+ "model.layers.35.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
329
+ "model.layers.35.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
330
+ "model.layers.35.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
331
+ "model.layers.35.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
332
+ "model.layers.35.self_attn.k_norm.weight": "model-00004-of-00004.safetensors",
333
+ "model.layers.35.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
334
+ "model.layers.35.self_attn.o_proj.weight": "model-00004-of-00004.safetensors",
335
+ "model.layers.35.self_attn.q_norm.weight": "model-00004-of-00004.safetensors",
336
+ "model.layers.35.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
337
+ "model.layers.35.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
338
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
339
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
340
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
341
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
342
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
343
+ "model.layers.4.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
344
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
345
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
346
+ "model.layers.4.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
347
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
348
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
349
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
350
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
351
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
352
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
353
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
354
+ "model.layers.5.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
355
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
356
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
357
+ "model.layers.5.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
358
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
359
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
360
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
361
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
362
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
363
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
364
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
365
+ "model.layers.6.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
366
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
367
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
368
+ "model.layers.6.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
369
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
370
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
371
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
372
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
373
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
374
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
375
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
376
+ "model.layers.7.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
377
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
378
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
379
+ "model.layers.7.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
380
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
381
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
382
+ "model.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
383
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
384
+ "model.layers.8.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
385
+ "model.layers.8.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
386
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
387
+ "model.layers.8.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
388
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
389
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
390
+ "model.layers.8.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
391
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
392
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
393
+ "model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
394
+ "model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
395
+ "model.layers.9.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
396
+ "model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
397
+ "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
398
+ "model.layers.9.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
399
+ "model.layers.9.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
400
+ "model.layers.9.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
401
+ "model.layers.9.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
402
+ "model.layers.9.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
403
+ "model.layers.9.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
404
+ "model.norm.weight": "model-00004-of-00004.safetensors"
405
+ }
406
+ }
8B-Final/special_tokens_map.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<EXPLORATION>",
4
+ "</EXPLORATION>",
5
+ "<EXECUTION>",
6
+ "</EXECUTION>"
7
+ ],
8
+ "eos_token": {
9
+ "content": "<|im_end|>",
10
+ "lstrip": false,
11
+ "normalized": false,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ },
15
+ "pad_token": {
16
+ "content": "<|endoftext|>",
17
+ "lstrip": false,
18
+ "normalized": false,
19
+ "rstrip": false,
20
+ "single_word": false
21
+ }
22
+ }
8B-Final/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e0a5c807e135eba1d85b949b0dce8afd1e8906430f41670602df72c30b2379d
3
+ size 11423791
8B-Final/tokenizer_config.json ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ },
213
+ "151669": {
214
+ "content": "<thinking>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "151670": {
222
+ "content": "<deterministic>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "151671": {
230
+ "content": "<EXPLORATION>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ },
237
+ "151672": {
238
+ "content": "</EXPLORATION>",
239
+ "lstrip": false,
240
+ "normalized": false,
241
+ "rstrip": false,
242
+ "single_word": false,
243
+ "special": true
244
+ },
245
+ "151673": {
246
+ "content": "<EXECUTION>",
247
+ "lstrip": false,
248
+ "normalized": false,
249
+ "rstrip": false,
250
+ "single_word": false,
251
+ "special": true
252
+ },
253
+ "151674": {
254
+ "content": "</EXECUTION>",
255
+ "lstrip": false,
256
+ "normalized": false,
257
+ "rstrip": false,
258
+ "single_word": false,
259
+ "special": true
260
+ }
261
+ },
262
+ "additional_special_tokens": [
263
+ "<EXPLORATION>",
264
+ "</EXPLORATION>",
265
+ "<EXECUTION>",
266
+ "</EXECUTION>"
267
+ ],
268
+ "bos_token": null,
269
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n<think>\\n\\n</think>\\n\\n<EXPLORATION>' }}\n{%- endif %}",
270
+ "clean_up_tokenization_spaces": false,
271
+ "eos_token": "<|im_end|>",
272
+ "errors": "replace",
273
+ "extra_special_tokens": {},
274
+ "model_max_length": 131072,
275
+ "pad_token": "<|endoftext|>",
276
+ "split_special_tokens": false,
277
+ "tokenizer_class": "Qwen2Tokenizer",
278
+ "unk_token": null
279
+ }
8B-Final/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -1,3 +1,213 @@
 
 
 
 
 
 
 
 
1
  ---
2
- license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Explore–Execute Chain (E2C)
2
+
3
+ This repository provides the implementation of our paper:
4
+ **Explore–Execute Chain: Towards an Efficient Structured Reasoning Paradigm**
5
+ *Kaisen Yang, Lixuan He, Rushi Shah, Kaicheng Yang, Qinwei Ma, Dianbo Liu, Alex Lamb*
6
+
7
+ > *Under review at ICLR 2026*
8
+
9
  ---
10
+
11
+ ## 📖 Overview
12
+
13
+ Large Language Models (LLMs) often intertwine high-level planning with low-level execution, limiting both efficiency and interpretability.
14
+ The **Explore–Execute Chain (E2C)** framework addresses this challenge by **decoupling reasoning into two distinct stages**:
15
+
16
+ 1. **Exploration** — Generate lightweight reasoning sketches (plans).
17
+ 2. **Execution** — Select one or a few promising plans and execute them faithfully.
18
+
19
+ This separation offers multiple benefits:
20
+
21
+ * **Efficiency** — Short explorations reduce computation while preserving reasoning coverage.
22
+ * **Interpretability** — Exploration traces are explicit and auditable.
23
+ * **Adaptability** — Exploration can be domain-adapted with minimal supervision.
24
+
25
  ---
26
+
27
+ ## 📝 Current Progress
28
+
29
+ **Released**
30
+
31
+ * ✅ Public release of **datasets** and **pretrained models**
32
+
33
+ **Ongoing**
34
+
35
+ * 🔄 Exploring more diverse **exploration strategies** and more reliable **execution mechanisms**
36
+ * 🔄 Cleaning and organizing **experimental code** for broader reproducibility
37
+
38
+ Stay tuned for further updates as we expand features and experiments.
39
+
40
+ ---
41
+
42
+ ## 🚀 Key Features
43
+
44
+ * **Two-stage training pipeline**:
45
+
46
+ * **E2C-SFT** — Supervised fine-tuning on synthetic exploration–execution pairs.
47
+ * **E2C-RL** — Reinforcement learning with token-level weighting tailored to exploration.
48
+
49
+ * **Efficient domain adaptation (EF-SFT)** — Adapt models with exploration-only data at minimal cost.
50
+
51
+ * **Test-time scaling** — Sample multiple explorations and aggregate them via clustering or LLM-based fusion.
52
+
53
+ * **Extensive benchmarks**:
54
+
55
+ * **Mathematical reasoning**: AIME’24/25, MATH500, Olympiad, Minerva.
56
+ * **Medical reasoning**: MedQA, MedMCQA, MMLU medical subsets.
57
+
58
+ ---
59
+
60
+ ## 📂 Repository Structure
61
+
62
+ ```
63
+ .
64
+ ├── data/ # Dataset preparation scripts and instructions
65
+ ├── e2c/ # Core E2C framework
66
+ │ ├── sft/ # Supervised fine-tuning (E2C-SFT, EF-SFT)
67
+ │ ├── rl/ # Reinforcement learning (E2C-RL, GRPO baseline)
68
+ │ └── inference/ # Test-time scaling and evaluation
69
+ ├── prompts/ # Prompt templates
70
+ ├── scripts/ # Training / evaluation entrypoints
71
+ └── README.md
72
+ ```
73
+
74
+ ---
75
+
76
+ ## ⚙️ Setup
77
+
78
+ ### Requirements
79
+
80
+ See `e2c/verl/README.md` for details.
81
+
82
+ * Python 3.9+
83
+ * PyTorch ≥ 2.0
84
+ * HuggingFace Transformers
85
+ * sentence-transformers
86
+ * Additional packages in `requirements.txt`
87
+
88
+ Install dependencies via:
89
+
90
+ ```bash
91
+ pip install -r requirements.txt
92
+ ```
93
+
94
+ ---
95
+
96
+ ## 📥 Model Download
97
+
98
+ Pretrained and fine-tuned E2C models are available on Hugging Face.
99
+
100
+ ```python
101
+ from transformers import AutoModelForCausalLM, AutoTokenizer
102
+
103
+ model_name = "your-org/e2c-model"
104
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
105
+ model = AutoModelForCausalLM.from_pretrained(model_name)
106
+ ```
107
+
108
+ Or via CLI:
109
+
110
+ ```bash
111
+ huggingface-cli download your-org/e2c-model
112
+ ```
113
+
114
+ Replace `your-org/e2c-model` with the actual repository name.
115
+
116
+ ---
117
+
118
+ ## 🏋️ Training
119
+
120
+ ### Stage 1: Supervised Fine-Tuning (E2C-SFT)
121
+
122
+ ```bash
123
+ bash e2c/sft/train_sft.sh
124
+ ```
125
+
126
+ ### Stage 2: Reinforcement Learning (E2C-RL)
127
+
128
+ ```bash
129
+ bash e2c/rl/train_rl.sh
130
+ ```
131
+
132
+ ### Efficient Adaptation (EF-SFT)
133
+
134
+ ```bash
135
+ bash e2c/sft/train_ef_sft.sh
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 🔍 Evaluation
141
+
142
+ Run evaluation and test-time scaling:
143
+
144
+ ```bash
145
+ bash e2c/inference/evaluate.sh
146
+ ```
147
+
148
+ Supported strategies include:
149
+
150
+ * **E2C-Select (Self LM-Judge)**
151
+ * **E2C-Select (Semantic Cluster)**
152
+ * **E2C-SC (Self-Consistency)**
153
+ * **E2C-RP (Random Plan)**
154
+
155
+ ---
156
+
157
+ ## 📊 Results
158
+
159
+ E2C consistently improves over GRPO baselines with reduced cost.
160
+
161
+ * On **AIME’24**, Qwen3-4B + E2C-(SFT+RL) yields **+8.7% accuracy gain** over GRPO.
162
+ * On **medical reasoning**, EF-SFT adapts with only **3.5% of training tokens**, surpassing standard SFT.
163
+
164
+ See the paper for detailed results and ablations.
165
+
166
+ ---
167
+
168
+ ## 🙏 Credits
169
+
170
+ This work builds upon the **VERL** framework, which has been instrumental for training and experimentation.
171
+ We thank the authors for releasing such a powerful and flexible platform.
172
+
173
+ ---
174
+
175
+ ## 📌 Notes
176
+
177
+ * This repository is **work in progress**; some datasets and scripts are placeholders.
178
+ * Full reproduction may require additional setup.
179
+ * Hyperparameters and prompt templates are provided in the paper appendices.
180
+ * We are still improving the training process and codebase for better usability.
181
+
182
+ ---
183
+
184
+ ## 📜 Citation
185
+
186
+ If you use this work, please cite:
187
+
188
+ **BibTeX**
189
+
190
+ ```bibtex
191
+ @inproceedings{yang2026explore,
192
+ title={Explore--Execute Chain: Towards an Efficient Structured Reasoning Paradigm},
193
+ author={Yang, Kaisen and He, Lixuan and Shah, Rushi and Yang, Kaicheng and Ma, Qinwei and Liu, Dianbo and Lamb, Alex},
194
+ booktitle={International Conference on Learning Representations (ICLR)},
195
+ year={2026},
196
+ note={under review}
197
+ }
198
+ ```
199
+
200
+ **APA**
201
+
202
+ > Yang, K., He, L., Shah, R., Yang, K., Ma, Q., Liu, D., & Lamb, A. (2026). *Explore–Execute Chain: Towards an Efficient Structured Reasoning Paradigm*. International Conference on Learning Representations (ICLR). (Under review)
203
+
204
+ **MLA**
205
+
206
+ > Yang, Kaisen, et al. "Explore–Execute Chain: Towards an Efficient Structured Reasoning Paradigm." *International Conference on Learning Representations (ICLR)*, 2026. Under review.
207
+
208
+ ---
209
+
210
+ ## 🧾 License
211
+
212
+ This project is licensed under the **MIT License**.
213
+ See the [LICENSE](LICENSE) file for details.
e2c/config/__init__.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2024 Bytedance Ltd. and/or its affiliates
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from .algorithm import * # noqa
16
+ from .config import * # noqa
17
+ from . import config, algorithm
18
+
19
+ __all__ = config.__all__ + algorithm.__all__
e2c/config/_generated_ppo_megatron_trainer.yaml ADDED
@@ -0,0 +1,541 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This reference configration yaml is automatically generated via 'scripts/generate_trainer_config.sh'
2
+ # in which it invokes 'python3 scripts/print_cfg.py --cfg job --config-name=ppo_megatron_trainer.yaml' to flatten the 'verl/trainer/config/ppo_megatron_trainer.yaml' config fields into a single file.
3
+ # Do not modify this file directly.
4
+ # The file is usually only for reference and never used.
5
+
6
+ actor_rollout_ref:
7
+ actor:
8
+ optim:
9
+ _target_: verl.workers.config.McoreOptimizerConfig
10
+ lr: 1.0e-06
11
+ lr_warmup_steps_ratio: 0.0
12
+ total_training_steps: -1
13
+ weight_decay: 0.01
14
+ lr_warmup_steps: -1
15
+ betas:
16
+ - 0.9
17
+ - 0.999
18
+ clip_grad: 1.0
19
+ optimizer: adam
20
+ lr_warmup_init: 0.0
21
+ lr_decay_steps: null
22
+ lr_decay_style: constant
23
+ min_lr: 0.0
24
+ weight_decay_incr_style: constant
25
+ lr_wsd_decay_style: exponential
26
+ lr_wsd_decay_steps: null
27
+ use_checkpoint_opt_param_scheduler: false
28
+ override_optimizer_config: {}
29
+ megatron:
30
+ _target_: verl.workers.config.McoreEngineConfig
31
+ param_offload: false
32
+ grad_offload: false
33
+ optimizer_offload: false
34
+ tensor_model_parallel_size: 1
35
+ expert_model_parallel_size: 1
36
+ expert_tensor_parallel_size: 1
37
+ pipeline_model_parallel_size: 1
38
+ virtual_pipeline_model_parallel_size: null
39
+ context_parallel_size: 1
40
+ sequence_parallel: true
41
+ use_distributed_optimizer: true
42
+ use_dist_checkpointing: false
43
+ dist_checkpointing_path: null
44
+ seed: 42
45
+ override_ddp_config: {}
46
+ override_transformer_config:
47
+ recompute_granularity: null
48
+ recompute_modules:
49
+ - core_attn
50
+ recompute_method: null
51
+ recompute_num_layers: null
52
+ attention_backend: flash
53
+ override_mcore_model_config: {}
54
+ use_mbridge: false
55
+ forward_only: false
56
+ _target_: verl.workers.config.McoreActorConfig
57
+ strategy: megatron
58
+ ppo_mini_batch_size: 256
59
+ ppo_micro_batch_size: null
60
+ ppo_micro_batch_size_per_gpu: null
61
+ use_dynamic_bsz: false
62
+ ppo_max_token_len_per_gpu: 16384
63
+ clip_ratio: 0.2
64
+ clip_ratio_low: 0.2
65
+ clip_ratio_high: 0.2
66
+ freeze_vision_tower: false
67
+ policy_loss:
68
+ _target_: verl.workers.config.PolicyLossConfig
69
+ loss_mode: vanilla
70
+ clip_cov_ratio: 0.0002
71
+ clip_cov_lb: 1.0
72
+ clip_cov_ub: 5.0
73
+ kl_cov_ratio: 0.0002
74
+ ppo_kl_coef: 0.1
75
+ clip_ratio_c: 3.0
76
+ loss_agg_mode: token-mean
77
+ entropy_coeff: 0
78
+ tis_imp_ratio_cap: -1
79
+ use_kl_loss: false
80
+ use_torch_compile: true
81
+ kl_loss_coef: 0.001
82
+ kl_loss_type: low_var_kl
83
+ ppo_epochs: 1
84
+ shuffle: false
85
+ checkpoint:
86
+ _target_: verl.trainer.config.CheckpointConfig
87
+ save_contents:
88
+ - model
89
+ - optimizer
90
+ - extra
91
+ load_contents: ${.save_contents}
92
+ async_save: false
93
+ use_fused_kernels: ${oc.select:actor_rollout_ref.model.use_fused_kernels,false}
94
+ profiler:
95
+ _target_: verl.utils.profiler.ProfilerConfig
96
+ tool: ${oc.select:global_profiler.tool,null}
97
+ enable: false
98
+ all_ranks: false
99
+ ranks: []
100
+ save_path: ${oc.select:global_profiler.save_path,null}
101
+ tool_config:
102
+ nsys:
103
+ _target_: verl.utils.profiler.config.NsightToolConfig
104
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
105
+ npu:
106
+ _target_: verl.utils.profiler.config.NPUToolConfig
107
+ contents: []
108
+ level: level1
109
+ analysis: true
110
+ discrete: false
111
+ torch:
112
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
113
+ step_start: 0
114
+ step_end: null
115
+ torch_memory:
116
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
117
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
118
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
119
+ data_loader_seed: null
120
+ load_weight: true
121
+ ref:
122
+ strategy: megatron
123
+ use_torch_compile: ${oc.select:actor_rollout_ref.actor.use_torch_compile,true}
124
+ log_prob_micro_batch_size: null
125
+ log_prob_micro_batch_size_per_gpu: null
126
+ log_prob_use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
127
+ log_prob_max_token_len_per_gpu: ${oc.select:actor_rollout_ref.actor.ppo_max_token_len_per_gpu,16384}
128
+ profiler:
129
+ _target_: verl.utils.profiler.ProfilerConfig
130
+ tool: ${oc.select:global_profiler.tool,null}
131
+ enable: false
132
+ all_ranks: false
133
+ ranks: []
134
+ save_path: ${oc.select:global_profiler.save_path,null}
135
+ tool_config:
136
+ nsys:
137
+ _target_: verl.utils.profiler.config.NsightToolConfig
138
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
139
+ npu:
140
+ _target_: verl.utils.profiler.config.NPUToolConfig
141
+ contents: []
142
+ level: level1
143
+ analysis: true
144
+ discrete: false
145
+ torch:
146
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
147
+ step_start: 0
148
+ step_end: null
149
+ torch_memory:
150
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
151
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
152
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
153
+ megatron:
154
+ _target_: verl.workers.config.MegatronEngineConfig
155
+ param_offload: false
156
+ grad_offload: false
157
+ optimizer_offload: false
158
+ tensor_model_parallel_size: 1
159
+ expert_model_parallel_size: 1
160
+ expert_tensor_parallel_size: 1
161
+ pipeline_model_parallel_size: 1
162
+ virtual_pipeline_model_parallel_size: null
163
+ context_parallel_size: 1
164
+ sequence_parallel: true
165
+ use_distributed_optimizer: true
166
+ use_dist_checkpointing: false
167
+ dist_checkpointing_path: null
168
+ seed: ${oc.select:actor_rollout_ref.actor.megatron.seed,42}
169
+ override_ddp_config: {}
170
+ override_transformer_config: ${oc.select:actor_rollout_ref.actor.megatron.override_transformer_config,{}}
171
+ override_mcore_model_config: {}
172
+ use_mbridge: ${oc.select:actor_rollout_ref.actor.megatron.use_mbridge,False}
173
+ forward_only: false
174
+ load_weight: true
175
+ rollout:
176
+ _target_: verl.workers.config.RolloutConfig
177
+ name: ???
178
+ mode: sync
179
+ temperature: 1.0
180
+ top_k: -1
181
+ top_p: 1
182
+ prompt_length: ${oc.select:data.max_prompt_length,512}
183
+ response_length: ${oc.select:data.max_response_length,512}
184
+ dtype: bfloat16
185
+ gpu_memory_utilization: 0.5
186
+ ignore_eos: false
187
+ enforce_eager: false
188
+ cudagraph_capture_sizes: null
189
+ free_cache_engine: true
190
+ tensor_model_parallel_size: 2
191
+ data_parallel_size: 1
192
+ expert_parallel_size: 1
193
+ max_num_batched_tokens: 8192
194
+ max_model_len: null
195
+ max_num_seqs: 1024
196
+ enable_chunked_prefill: true
197
+ enable_prefix_caching: true
198
+ load_format: dummy
199
+ log_prob_micro_batch_size: null
200
+ log_prob_micro_batch_size_per_gpu: null
201
+ log_prob_use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
202
+ log_prob_max_token_len_per_gpu: ${oc.select:actor_rollout_ref.actor.ppo_max_token_len_per_gpu,16384}
203
+ disable_log_stats: true
204
+ do_sample: true
205
+ 'n': 1
206
+ over_sample_rate: 0
207
+ multi_stage_wake_up: false
208
+ engine_kwargs:
209
+ vllm: {}
210
+ sglang: {}
211
+ val_kwargs:
212
+ _target_: verl.workers.config.SamplingConfig
213
+ top_k: -1
214
+ top_p: 1.0
215
+ temperature: 0
216
+ 'n': 1
217
+ do_sample: false
218
+ multi_turn:
219
+ _target_: verl.workers.config.MultiTurnConfig
220
+ enable: false
221
+ max_assistant_turns: null
222
+ tool_config_path: null
223
+ max_user_turns: null
224
+ max_parallel_calls: 1
225
+ max_tool_response_length: 256
226
+ tool_response_truncate_side: middle
227
+ interaction_config_path: null
228
+ use_inference_chat_template: false
229
+ tokenization_sanity_check_mode: strict
230
+ format: hermes
231
+ num_repeat_rollouts: null
232
+ calculate_log_probs: false
233
+ agent:
234
+ _target_: verl.workers.config.AgentLoopConfig
235
+ num_workers: 8
236
+ agent_loop_config_path: null
237
+ custom_async_server:
238
+ _target_: verl.workers.config.CustomAsyncServerConfig
239
+ path: null
240
+ name: null
241
+ update_weights_bucket_megabytes: 512
242
+ trace:
243
+ _target_: verl.workers.config.TraceConfig
244
+ backend: null
245
+ token2text: false
246
+ skip_rollout: false
247
+ skip_dump_dir: /tmp/rollout_dump
248
+ skip_tokenizer_init: true
249
+ profiler:
250
+ _target_: verl.utils.profiler.ProfilerConfig
251
+ tool: ${oc.select:global_profiler.tool,null}
252
+ enable: ${oc.select:actor_rollout_ref.actor.profiler.enable,false}
253
+ all_ranks: ${oc.select:actor_rollout_ref.actor.profiler.all_ranks,false}
254
+ ranks: ${oc.select:actor_rollout_ref.actor.profiler.ranks,[]}
255
+ save_path: ${oc.select:global_profiler.save_path,null}
256
+ tool_config: ${oc.select:actor_rollout_ref.actor.profiler.tool_config,null}
257
+ layer_name_map:
258
+ qkv_layer_name: qkv
259
+ gate_proj_layer_name: gate_up
260
+ hybrid_engine: true
261
+ nccl_timeout: 600
262
+ model:
263
+ path: ~/models/deepseek-llm-7b-chat
264
+ custom_chat_template: null
265
+ external_lib: null
266
+ override_config:
267
+ model_config: {}
268
+ moe_config:
269
+ freeze_moe_router: false
270
+ use_fused_kernels: false
271
+ trust_remote_code: false
272
+ use_remove_padding: false
273
+ data:
274
+ tokenizer: null
275
+ use_shm: false
276
+ train_files: ~/data/rlhf/gsm8k/train.parquet
277
+ val_files: ~/data/rlhf/gsm8k/test.parquet
278
+ prompt_key: prompt
279
+ reward_fn_key: data_source
280
+ max_prompt_length: 512
281
+ max_response_length: 512
282
+ train_batch_size: 1024
283
+ val_batch_size: null
284
+ return_raw_input_ids: false
285
+ return_raw_chat: false
286
+ return_full_prompt: false
287
+ shuffle: true
288
+ dataloader_num_workers: 8
289
+ validation_shuffle: false
290
+ filter_overlong_prompts: false
291
+ filter_overlong_prompts_workers: 1
292
+ truncation: error
293
+ image_key: images
294
+ video_key: videos
295
+ trust_remote_code: false
296
+ custom_cls:
297
+ path: null
298
+ name: null
299
+ return_multi_modal_inputs: true
300
+ sampler:
301
+ class_path: null
302
+ class_name: null
303
+ datagen:
304
+ path: null
305
+ name: null
306
+ apply_chat_template_kwargs: {}
307
+ critic:
308
+ optim:
309
+ _target_: verl.workers.config.McoreOptimizerConfig
310
+ lr: 1.0e-05
311
+ lr_warmup_steps_ratio: 0.0
312
+ total_training_steps: -1
313
+ weight_decay: 0.01
314
+ lr_warmup_steps: -1
315
+ betas:
316
+ - 0.9
317
+ - 0.999
318
+ clip_grad: 1.0
319
+ optimizer: adam
320
+ lr_warmup_init: 0.0
321
+ lr_decay_steps: null
322
+ lr_decay_style: constant
323
+ min_lr: 0.0
324
+ weight_decay_incr_style: constant
325
+ lr_wsd_decay_style: exponential
326
+ lr_wsd_decay_steps: null
327
+ use_checkpoint_opt_param_scheduler: false
328
+ override_optimizer_config: {}
329
+ megatron:
330
+ _target_: verl.workers.config.McoreEngineConfig
331
+ param_offload: false
332
+ grad_offload: false
333
+ optimizer_offload: false
334
+ tensor_model_parallel_size: 1
335
+ expert_model_parallel_size: 1
336
+ expert_tensor_parallel_size: 1
337
+ pipeline_model_parallel_size: 1
338
+ virtual_pipeline_model_parallel_size: null
339
+ context_parallel_size: 1
340
+ sequence_parallel: true
341
+ use_distributed_optimizer: true
342
+ use_dist_checkpointing: false
343
+ dist_checkpointing_path: null
344
+ seed: 42
345
+ override_ddp_config: {}
346
+ override_transformer_config:
347
+ recompute_granularity: null
348
+ recompute_modules:
349
+ - core_attn
350
+ recompute_method: null
351
+ recompute_num_layers: null
352
+ attention_backend: flash
353
+ override_mcore_model_config: {}
354
+ use_mbridge: false
355
+ forward_only: false
356
+ _target_: verl.workers.config.McoreCriticConfig
357
+ rollout_n: ${oc.select:actor_rollout_ref.rollout.n,1}
358
+ strategy: megatron
359
+ enable: null
360
+ model:
361
+ path: ~/models/deepseek-llm-7b-chat
362
+ tokenizer_path: ${oc.select:actor_rollout_ref.model.path,"~/models/deepseek-llm-7b-chat"}
363
+ override_config:
364
+ model_config: {}
365
+ moe_config:
366
+ freeze_moe_router: false
367
+ external_lib: ${oc.select:actor_rollout_ref.model.external_lib,null}
368
+ trust_remote_code: ${oc.select:actor_rollout_ref.model.trust_remote_code,false}
369
+ _target_: verl.trainer.config.BaseModelConfig
370
+ ppo_mini_batch_size: ${oc.select:actor_rollout_ref.actor.ppo_mini_batch_size,256}
371
+ ppo_micro_batch_size: null
372
+ ppo_micro_batch_size_per_gpu: ${oc.select:.ppo_micro_batch_size,null}
373
+ use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
374
+ ppo_max_token_len_per_gpu: 32768
375
+ forward_max_token_len_per_gpu: ${.ppo_max_token_len_per_gpu}
376
+ ppo_epochs: ${oc.select:actor_rollout_ref.actor.ppo_epochs,1}
377
+ shuffle: ${oc.select:actor_rollout_ref.actor.shuffle,false}
378
+ cliprange_value: 0.5
379
+ loss_agg_mode: ${oc.select:actor_rollout_ref.actor.loss_agg_mode,token-mean}
380
+ checkpoint:
381
+ _target_: verl.trainer.config.CheckpointConfig
382
+ save_contents:
383
+ - model
384
+ - optimizer
385
+ - extra
386
+ load_contents: ${.save_contents}
387
+ async_save: false
388
+ profiler:
389
+ _target_: verl.utils.profiler.ProfilerConfig
390
+ tool: ${oc.select:global_profiler.tool,null}
391
+ enable: false
392
+ all_ranks: false
393
+ ranks: []
394
+ save_path: ${oc.select:global_profiler.save_path,null}
395
+ tool_config:
396
+ nsys:
397
+ _target_: verl.utils.profiler.config.NsightToolConfig
398
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
399
+ npu:
400
+ _target_: verl.utils.profiler.config.NPUToolConfig
401
+ contents: []
402
+ level: level1
403
+ analysis: true
404
+ discrete: false
405
+ torch:
406
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
407
+ step_start: 0
408
+ step_end: null
409
+ torch_memory:
410
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
411
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
412
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
413
+ nccl_timeout: 600
414
+ load_weight: true
415
+ data_loader_seed: ${oc.select:actor_rollout_ref.actor.data_loader_seed,null}
416
+ reward_model:
417
+ enable: false
418
+ enable_resource_pool: false
419
+ n_gpus_per_node: 0
420
+ nnodes: 0
421
+ strategy: megatron
422
+ model:
423
+ input_tokenizer: ${actor_rollout_ref.model.path}
424
+ path: ~/models/FsfairX-LLaMA3-RM-v0.1
425
+ external_lib: ${actor_rollout_ref.model.external_lib}
426
+ trust_remote_code: false
427
+ micro_batch_size: null
428
+ micro_batch_size_per_gpu: null
429
+ max_length: null
430
+ use_dynamic_bsz: ${critic.use_dynamic_bsz}
431
+ forward_max_token_len_per_gpu: ${critic.forward_max_token_len_per_gpu}
432
+ reward_manager: naive
433
+ launch_reward_fn_async: false
434
+ sandbox_fusion:
435
+ url: null
436
+ max_concurrent: 64
437
+ memory_limit_mb: 1024
438
+ profiler:
439
+ _target_: verl.utils.profiler.ProfilerConfig
440
+ tool: ${oc.select:global_profiler.tool,null}
441
+ enable: false
442
+ all_ranks: false
443
+ ranks: []
444
+ save_path: ${oc.select:global_profiler.save_path,null}
445
+ tool_config: ${oc.select:actor_rollout_ref.actor.profiler.tool_config,null}
446
+ nccl_timeout: 600
447
+ megatron:
448
+ _target_: verl.workers.config.MegatronEngineConfig
449
+ param_offload: false
450
+ tensor_model_parallel_size: 1
451
+ expert_model_parallel_size: 1
452
+ expert_tensor_parallel_size: 1
453
+ pipeline_model_parallel_size: 1
454
+ virtual_pipeline_model_parallel_size: null
455
+ context_parallel_size: 1
456
+ sequence_parallel: true
457
+ use_distributed_optimizer: false
458
+ use_dist_checkpointing: false
459
+ dist_checkpointing_path: null
460
+ seed: ${oc.select:actor_rollout_ref.actor.megatron.seed,42}
461
+ override_transformer_config: ${oc.select:actor_rollout_ref.actor.megatron.override_transformer_config,{}}
462
+ use_mbridge: ${oc.select:actor_rollout_ref.actor.megatron.use_mbridge,False}
463
+ load_weight: true
464
+ custom_reward_function:
465
+ path: null
466
+ name: compute_score
467
+ algorithm:
468
+ _target_: verl.trainer.config.AlgoConfig
469
+ gamma: 1.0
470
+ lam: 1.0
471
+ adv_estimator: gae
472
+ norm_adv_by_std_in_grpo: true
473
+ use_kl_in_reward: false
474
+ kl_penalty: kl
475
+ kl_ctrl:
476
+ _target_: verl.trainer.config.KLControlConfig
477
+ type: fixed
478
+ kl_coef: 0.001
479
+ horizon: 10000
480
+ target_kl: 0.1
481
+ use_pf_ppo: false
482
+ pf_ppo:
483
+ reweight_method: pow
484
+ weight_pow: 2.0
485
+ trainer:
486
+ balance_batch: true
487
+ total_epochs: 30
488
+ total_training_steps: null
489
+ project_name: verl_examples
490
+ experiment_name: gsm8k
491
+ logger:
492
+ - console
493
+ - wandb
494
+ log_val_generations: 0
495
+ nnodes: 1
496
+ n_gpus_per_node: 8
497
+ save_freq: -1
498
+ esi_redundant_time: 0
499
+ resume_mode: auto
500
+ resume_from_path: null
501
+ del_local_ckpt_after_load: false
502
+ val_before_train: true
503
+ test_freq: -1
504
+ critic_warmup: 0
505
+ default_hdfs_dir: null
506
+ default_local_dir: checkpoints/${trainer.project_name}/${trainer.experiment_name}
507
+ max_actor_ckpt_to_keep: null
508
+ max_critic_ckpt_to_keep: null
509
+ ray_wait_register_center_timeout: 300
510
+ device: cuda
511
+ rollout_data_dir: null
512
+ global_profiler:
513
+ _target_: verl.utils.profiler.ProfilerConfig
514
+ tool: null
515
+ steps: null
516
+ profile_continuous_steps: false
517
+ save_path: outputs/profile
518
+ global_tool_config:
519
+ nsys:
520
+ discrete: false
521
+ controller_nsight_options:
522
+ trace: cuda,nvtx,cublas,ucx
523
+ cuda-memory-usage: 'true'
524
+ cuda-graph-trace: graph
525
+ worker_nsight_options:
526
+ trace: cuda,nvtx,cublas,ucx
527
+ cuda-memory-usage: 'true'
528
+ cuda-graph-trace: graph
529
+ capture-range: cudaProfilerApi
530
+ capture-range-end: null
531
+ kill: none
532
+ torch_memory:
533
+ trace_alloc_max_entries: 100000
534
+ stack_depth: 32
535
+ context: all
536
+ stacks: all
537
+ kw_args: {}
538
+ ray_kwargs:
539
+ ray_init:
540
+ num_cpus: null
541
+ timeline_json_file: null
e2c/config/_generated_ppo_trainer.yaml ADDED
@@ -0,0 +1,523 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This reference configration yaml is automatically generated via 'scripts/generate_trainer_config.sh'
2
+ # in which it invokes 'python3 scripts/print_cfg.py --cfg job ' to flatten the 'verl/trainer/config/ppo_trainer.yaml' config fields into a single file.
3
+ # Do not modify this file directly.
4
+ # The file is usually only for reference and never used.
5
+
6
+ actor_rollout_ref:
7
+ actor:
8
+ optim:
9
+ _target_: verl.workers.config.FSDPOptimizerConfig
10
+ lr: 1.0e-06
11
+ lr_warmup_steps_ratio: 0.0
12
+ total_training_steps: -1
13
+ weight_decay: 0.01
14
+ lr_warmup_steps: -1
15
+ betas:
16
+ - 0.9
17
+ - 0.999
18
+ clip_grad: 1.0
19
+ min_lr_ratio: 0.0
20
+ num_cycles: 0.5
21
+ warmup_style: constant
22
+ fsdp_config:
23
+ _target_: verl.workers.config.FSDPEngineConfig
24
+ wrap_policy:
25
+ min_num_params: 0
26
+ param_offload: false
27
+ optimizer_offload: false
28
+ offload_policy: false
29
+ reshard_after_forward: true
30
+ fsdp_size: -1
31
+ forward_prefetch: false
32
+ model_dtype: fp32
33
+ use_orig_params: false
34
+ ulysses_sequence_parallel_size: 1
35
+ entropy_from_logits_with_chunking: false
36
+ use_torch_compile: true
37
+ entropy_checkpointing: false
38
+ forward_only: false
39
+ strategy: fsdp
40
+ _target_: verl.workers.config.FSDPActorConfig
41
+ strategy: fsdp
42
+ ppo_mini_batch_size: 256
43
+ ppo_micro_batch_size: null
44
+ ppo_micro_batch_size_per_gpu: null
45
+ use_dynamic_bsz: false
46
+ ppo_max_token_len_per_gpu: 16384
47
+ clip_ratio: 0.2
48
+ clip_ratio_low: 0.2
49
+ clip_ratio_high: 0.2
50
+ freeze_vision_tower: false
51
+ policy_loss:
52
+ _target_: verl.workers.config.PolicyLossConfig
53
+ loss_mode: vanilla
54
+ clip_cov_ratio: 0.0002
55
+ clip_cov_lb: 1.0
56
+ clip_cov_ub: 5.0
57
+ kl_cov_ratio: 0.0002
58
+ ppo_kl_coef: 0.1
59
+ clip_ratio_c: 3.0
60
+ loss_agg_mode: token-mean
61
+ entropy_coeff: 0
62
+ tis_imp_ratio_cap: -1
63
+ use_kl_loss: false
64
+ use_torch_compile: true
65
+ kl_loss_coef: 0.001
66
+ kl_loss_type: low_var_kl
67
+ ppo_epochs: 1
68
+ shuffle: false
69
+ checkpoint:
70
+ _target_: verl.trainer.config.CheckpointConfig
71
+ save_contents:
72
+ - model
73
+ - optimizer
74
+ - extra
75
+ load_contents: ${.save_contents}
76
+ async_save: false
77
+ use_fused_kernels: ${oc.select:actor_rollout_ref.model.use_fused_kernels,false}
78
+ profiler:
79
+ _target_: verl.utils.profiler.ProfilerConfig
80
+ tool: ${oc.select:global_profiler.tool,null}
81
+ enable: false
82
+ all_ranks: false
83
+ ranks: []
84
+ save_path: ${oc.select:global_profiler.save_path,null}
85
+ tool_config:
86
+ nsys:
87
+ _target_: verl.utils.profiler.config.NsightToolConfig
88
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
89
+ npu:
90
+ _target_: verl.utils.profiler.config.NPUToolConfig
91
+ contents: []
92
+ level: level1
93
+ analysis: true
94
+ discrete: false
95
+ torch:
96
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
97
+ step_start: 0
98
+ step_end: null
99
+ torch_memory:
100
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
101
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
102
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
103
+ grad_clip: 1.0
104
+ ulysses_sequence_parallel_size: 1
105
+ entropy_from_logits_with_chunking: false
106
+ entropy_checkpointing: false
107
+ use_remove_padding: ${oc.select:actor_rollout_ref.model.use_remove_padding,false}
108
+ ref:
109
+ strategy: ${actor_rollout_ref.actor.strategy}
110
+ use_torch_compile: ${oc.select:actor_rollout_ref.actor.use_torch_compile,true}
111
+ log_prob_micro_batch_size: null
112
+ log_prob_micro_batch_size_per_gpu: null
113
+ log_prob_use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
114
+ log_prob_max_token_len_per_gpu: ${oc.select:actor_rollout_ref.actor.ppo_max_token_len_per_gpu,16384}
115
+ profiler:
116
+ _target_: verl.utils.profiler.ProfilerConfig
117
+ tool: ${oc.select:global_profiler.tool,null}
118
+ enable: false
119
+ all_ranks: false
120
+ ranks: []
121
+ save_path: ${oc.select:global_profiler.save_path,null}
122
+ tool_config:
123
+ nsys:
124
+ _target_: verl.utils.profiler.config.NsightToolConfig
125
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
126
+ npu:
127
+ _target_: verl.utils.profiler.config.NPUToolConfig
128
+ contents: []
129
+ level: level1
130
+ analysis: true
131
+ discrete: false
132
+ torch:
133
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
134
+ step_start: 0
135
+ step_end: null
136
+ torch_memory:
137
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
138
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
139
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
140
+ fsdp_config:
141
+ _target_: verl.workers.config.FSDPEngineConfig
142
+ wrap_policy:
143
+ min_num_params: 0
144
+ param_offload: false
145
+ optimizer_offload: false
146
+ offload_policy: false
147
+ reshard_after_forward: true
148
+ fsdp_size: -1
149
+ forward_prefetch: false
150
+ model_dtype: fp32
151
+ use_orig_params: false
152
+ ulysses_sequence_parallel_size: 1
153
+ entropy_from_logits_with_chunking: false
154
+ use_torch_compile: true
155
+ entropy_checkpointing: false
156
+ forward_only: false
157
+ strategy: fsdp
158
+ model: null
159
+ ulysses_sequence_parallel_size: ${oc.select:actor_rollout_ref.actor.ulysses_sequence_parallel_size,1}
160
+ entropy_from_logits_with_chunking: false
161
+ entropy_checkpointing: false
162
+ rollout:
163
+ _target_: verl.workers.config.RolloutConfig
164
+ name: ???
165
+ mode: sync
166
+ temperature: 1.0
167
+ top_k: -1
168
+ top_p: 1
169
+ prompt_length: ${oc.select:data.max_prompt_length,512}
170
+ response_length: ${oc.select:data.max_response_length,512}
171
+ dtype: bfloat16
172
+ gpu_memory_utilization: 0.5
173
+ ignore_eos: false
174
+ enforce_eager: false
175
+ cudagraph_capture_sizes: null
176
+ free_cache_engine: true
177
+ tensor_model_parallel_size: 2
178
+ data_parallel_size: 1
179
+ expert_parallel_size: 1
180
+ max_num_batched_tokens: 8192
181
+ max_model_len: null
182
+ max_num_seqs: 1024
183
+ enable_chunked_prefill: true
184
+ enable_prefix_caching: true
185
+ load_format: dummy
186
+ log_prob_micro_batch_size: null
187
+ log_prob_micro_batch_size_per_gpu: null
188
+ log_prob_use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
189
+ log_prob_max_token_len_per_gpu: ${oc.select:actor_rollout_ref.actor.ppo_max_token_len_per_gpu,16384}
190
+ disable_log_stats: true
191
+ do_sample: true
192
+ 'n': 1
193
+ over_sample_rate: 0
194
+ multi_stage_wake_up: false
195
+ engine_kwargs:
196
+ vllm: {}
197
+ sglang: {}
198
+ val_kwargs:
199
+ _target_: verl.workers.config.SamplingConfig
200
+ top_k: -1
201
+ top_p: 1.0
202
+ temperature: 0
203
+ 'n': 1
204
+ do_sample: false
205
+ multi_turn:
206
+ _target_: verl.workers.config.MultiTurnConfig
207
+ enable: false
208
+ max_assistant_turns: null
209
+ tool_config_path: null
210
+ max_user_turns: null
211
+ max_parallel_calls: 1
212
+ max_tool_response_length: 256
213
+ tool_response_truncate_side: middle
214
+ interaction_config_path: null
215
+ use_inference_chat_template: false
216
+ tokenization_sanity_check_mode: strict
217
+ format: hermes
218
+ num_repeat_rollouts: null
219
+ calculate_log_probs: false
220
+ agent:
221
+ _target_: verl.workers.config.AgentLoopConfig
222
+ num_workers: 8
223
+ agent_loop_config_path: null
224
+ custom_async_server:
225
+ _target_: verl.workers.config.CustomAsyncServerConfig
226
+ path: null
227
+ name: null
228
+ update_weights_bucket_megabytes: 512
229
+ trace:
230
+ _target_: verl.workers.config.TraceConfig
231
+ backend: null
232
+ token2text: false
233
+ skip_rollout: false
234
+ skip_dump_dir: /tmp/rollout_dump
235
+ skip_tokenizer_init: true
236
+ profiler:
237
+ _target_: verl.utils.profiler.ProfilerConfig
238
+ tool: ${oc.select:global_profiler.tool,null}
239
+ enable: ${oc.select:actor_rollout_ref.actor.profiler.enable,false}
240
+ all_ranks: ${oc.select:actor_rollout_ref.actor.profiler.all_ranks,false}
241
+ ranks: ${oc.select:actor_rollout_ref.actor.profiler.ranks,[]}
242
+ save_path: ${oc.select:global_profiler.save_path,null}
243
+ tool_config: ${oc.select:actor_rollout_ref.actor.profiler.tool_config,null}
244
+ layered_summon: false
245
+ model:
246
+ _target_: verl.workers.config.HFModelConfig
247
+ path: ~/models/deepseek-llm-7b-chat
248
+ hf_config_path: null
249
+ tokenizer_path: null
250
+ use_shm: false
251
+ trust_remote_code: false
252
+ custom_chat_template: null
253
+ external_lib: null
254
+ override_config: {}
255
+ enable_gradient_checkpointing: true
256
+ enable_activation_offload: false
257
+ use_remove_padding: false
258
+ lora_rank: 0
259
+ lora_alpha: 16
260
+ target_modules: all-linear
261
+ exclude_modules: null
262
+ use_liger: false
263
+ use_fused_kernels: false
264
+ fused_kernel_options:
265
+ impl_backend: torch
266
+ hybrid_engine: true
267
+ nccl_timeout: 600
268
+ data:
269
+ tokenizer: null
270
+ use_shm: false
271
+ train_files: ~/data/rlhf/gsm8k/train.parquet
272
+ val_files: ~/data/rlhf/gsm8k/test.parquet
273
+ prompt_key: prompt
274
+ reward_fn_key: data_source
275
+ max_prompt_length: 512
276
+ max_response_length: 512
277
+ train_batch_size: 1024
278
+ val_batch_size: null
279
+ return_raw_input_ids: false
280
+ return_raw_chat: false
281
+ return_full_prompt: false
282
+ shuffle: true
283
+ dataloader_num_workers: 8
284
+ validation_shuffle: false
285
+ filter_overlong_prompts: false
286
+ filter_overlong_prompts_workers: 1
287
+ truncation: error
288
+ image_key: images
289
+ video_key: videos
290
+ trust_remote_code: false
291
+ custom_cls:
292
+ path: null
293
+ name: null
294
+ return_multi_modal_inputs: true
295
+ sampler:
296
+ class_path: null
297
+ class_name: null
298
+ datagen:
299
+ path: null
300
+ name: null
301
+ apply_chat_template_kwargs: {}
302
+ critic:
303
+ optim:
304
+ _target_: verl.workers.config.FSDPOptimizerConfig
305
+ lr: 1.0e-05
306
+ lr_warmup_steps_ratio: 0.0
307
+ total_training_steps: -1
308
+ weight_decay: 0.01
309
+ lr_warmup_steps: -1
310
+ betas:
311
+ - 0.9
312
+ - 0.999
313
+ clip_grad: 1.0
314
+ min_lr_ratio: 0.0
315
+ num_cycles: 0.5
316
+ warmup_style: constant
317
+ model:
318
+ fsdp_config:
319
+ _target_: verl.workers.config.FSDPEngineConfig
320
+ wrap_policy:
321
+ min_num_params: 0
322
+ param_offload: false
323
+ optimizer_offload: false
324
+ offload_policy: false
325
+ reshard_after_forward: true
326
+ fsdp_size: -1
327
+ forward_prefetch: false
328
+ model_dtype: fp32
329
+ use_orig_params: false
330
+ ulysses_sequence_parallel_size: 1
331
+ entropy_from_logits_with_chunking: false
332
+ use_torch_compile: true
333
+ entropy_checkpointing: false
334
+ forward_only: false
335
+ strategy: fsdp
336
+ path: ~/models/deepseek-llm-7b-chat
337
+ tokenizer_path: ${oc.select:actor_rollout_ref.model.path,"~/models/deepseek-llm-7b-chat"}
338
+ override_config: {}
339
+ external_lib: ${oc.select:actor_rollout_ref.model.external_lib,null}
340
+ trust_remote_code: ${oc.select:actor_rollout_ref.model.trust_remote_code,false}
341
+ _target_: verl.workers.config.FSDPCriticModelCfg
342
+ use_shm: false
343
+ enable_gradient_checkpointing: true
344
+ enable_activation_offload: false
345
+ use_remove_padding: false
346
+ lora_rank: 0
347
+ lora_alpha: 16
348
+ target_modules: all-linear
349
+ _target_: verl.workers.config.FSDPCriticConfig
350
+ rollout_n: ${oc.select:actor_rollout_ref.rollout.n,1}
351
+ strategy: fsdp
352
+ enable: null
353
+ ppo_mini_batch_size: ${oc.select:actor_rollout_ref.actor.ppo_mini_batch_size,256}
354
+ ppo_micro_batch_size: null
355
+ ppo_micro_batch_size_per_gpu: ${oc.select:.ppo_micro_batch_size,null}
356
+ use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
357
+ ppo_max_token_len_per_gpu: 32768
358
+ forward_max_token_len_per_gpu: ${.ppo_max_token_len_per_gpu}
359
+ ppo_epochs: ${oc.select:actor_rollout_ref.actor.ppo_epochs,1}
360
+ shuffle: ${oc.select:actor_rollout_ref.actor.shuffle,false}
361
+ cliprange_value: 0.5
362
+ loss_agg_mode: ${oc.select:actor_rollout_ref.actor.loss_agg_mode,token-mean}
363
+ checkpoint:
364
+ _target_: verl.trainer.config.CheckpointConfig
365
+ save_contents:
366
+ - model
367
+ - optimizer
368
+ - extra
369
+ load_contents: ${.save_contents}
370
+ async_save: false
371
+ profiler:
372
+ _target_: verl.utils.profiler.ProfilerConfig
373
+ tool: ${oc.select:global_profiler.tool,null}
374
+ enable: false
375
+ all_ranks: false
376
+ ranks: []
377
+ save_path: ${oc.select:global_profiler.save_path,null}
378
+ tool_config:
379
+ nsys:
380
+ _target_: verl.utils.profiler.config.NsightToolConfig
381
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
382
+ npu:
383
+ _target_: verl.utils.profiler.config.NPUToolConfig
384
+ contents: []
385
+ level: level1
386
+ analysis: true
387
+ discrete: false
388
+ torch:
389
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
390
+ step_start: 0
391
+ step_end: null
392
+ torch_memory:
393
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
394
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
395
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
396
+ forward_micro_batch_size: ${oc.select:.ppo_micro_batch_size,null}
397
+ forward_micro_batch_size_per_gpu: ${oc.select:.ppo_micro_batch_size_per_gpu,null}
398
+ ulysses_sequence_parallel_size: 1
399
+ grad_clip: 1.0
400
+ reward_model:
401
+ enable: false
402
+ enable_resource_pool: false
403
+ n_gpus_per_node: 0
404
+ nnodes: 0
405
+ strategy: fsdp
406
+ model:
407
+ input_tokenizer: ${actor_rollout_ref.model.path}
408
+ path: ~/models/FsfairX-LLaMA3-RM-v0.1
409
+ external_lib: ${actor_rollout_ref.model.external_lib}
410
+ trust_remote_code: false
411
+ use_shm: false
412
+ use_remove_padding: false
413
+ use_fused_kernels: ${actor_rollout_ref.model.use_fused_kernels}
414
+ fsdp_config:
415
+ _target_: verl.workers.config.FSDPEngineConfig
416
+ wrap_policy:
417
+ min_num_params: 0
418
+ param_offload: false
419
+ reshard_after_forward: true
420
+ fsdp_size: -1
421
+ forward_prefetch: false
422
+ micro_batch_size: null
423
+ micro_batch_size_per_gpu: null
424
+ max_length: null
425
+ use_dynamic_bsz: ${critic.use_dynamic_bsz}
426
+ forward_max_token_len_per_gpu: ${critic.forward_max_token_len_per_gpu}
427
+ reward_manager: naive
428
+ launch_reward_fn_async: false
429
+ sandbox_fusion:
430
+ url: null
431
+ max_concurrent: 64
432
+ memory_limit_mb: 1024
433
+ profiler:
434
+ _target_: verl.utils.profiler.ProfilerConfig
435
+ tool: ${oc.select:global_profiler.tool,null}
436
+ enable: false
437
+ all_ranks: false
438
+ ranks: []
439
+ save_path: ${oc.select:global_profiler.save_path,null}
440
+ tool_config: ${oc.select:actor_rollout_ref.actor.profiler.tool_config,null}
441
+ ulysses_sequence_parallel_size: 1
442
+ custom_reward_function:
443
+ path: null
444
+ name: compute_score
445
+ algorithm:
446
+ _target_: verl.trainer.config.AlgoConfig
447
+ gamma: 1.0
448
+ lam: 1.0
449
+ adv_estimator: gae
450
+ norm_adv_by_std_in_grpo: true
451
+ use_kl_in_reward: false
452
+ kl_penalty: kl
453
+ kl_ctrl:
454
+ _target_: verl.trainer.config.KLControlConfig
455
+ type: fixed
456
+ kl_coef: 0.001
457
+ horizon: 10000
458
+ target_kl: 0.1
459
+ use_pf_ppo: false
460
+ pf_ppo:
461
+ reweight_method: pow
462
+ weight_pow: 2.0
463
+ trainer:
464
+ balance_batch: true
465
+ total_epochs: 30
466
+ total_training_steps: null
467
+ project_name: verl_examples
468
+ experiment_name: gsm8k
469
+ logger:
470
+ - console
471
+ - wandb
472
+ log_val_generations: 0
473
+ rollout_data_dir: null
474
+ validation_data_dir: null
475
+ nnodes: 1
476
+ n_gpus_per_node: 8
477
+ save_freq: -1
478
+ esi_redundant_time: 0
479
+ resume_mode: auto
480
+ resume_from_path: null
481
+ val_before_train: true
482
+ val_only: false
483
+ test_freq: -1
484
+ critic_warmup: 0
485
+ default_hdfs_dir: null
486
+ del_local_ckpt_after_load: false
487
+ default_local_dir: checkpoints/${trainer.project_name}/${trainer.experiment_name}
488
+ max_actor_ckpt_to_keep: null
489
+ max_critic_ckpt_to_keep: null
490
+ ray_wait_register_center_timeout: 300
491
+ device: cuda
492
+ use_legacy_worker_impl: auto
493
+ global_profiler:
494
+ _target_: verl.utils.profiler.ProfilerConfig
495
+ tool: null
496
+ steps: null
497
+ profile_continuous_steps: false
498
+ save_path: outputs/profile
499
+ global_tool_config:
500
+ nsys:
501
+ _target_: verl.utils.profiler.config.NsightToolConfig
502
+ discrete: false
503
+ controller_nsight_options:
504
+ trace: cuda,nvtx,cublas,ucx
505
+ cuda-memory-usage: 'true'
506
+ cuda-graph-trace: graph
507
+ worker_nsight_options:
508
+ trace: cuda,nvtx,cublas,ucx
509
+ cuda-memory-usage: 'true'
510
+ cuda-graph-trace: graph
511
+ capture-range: cudaProfilerApi
512
+ capture-range-end: null
513
+ kill: none
514
+ torch_memory:
515
+ trace_alloc_max_entries: 100000
516
+ stack_depth: 32
517
+ context: all
518
+ stacks: all
519
+ kw_args: {}
520
+ ray_kwargs:
521
+ ray_init:
522
+ num_cpus: null
523
+ timeline_json_file: null
e2c/config/actor/actor.yaml ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ # Target class for this configuration
8
+ _target_: verl.workers.config.ActorConfig
9
+
10
+ # the abstract actor configs
11
+ # fsdp, fsdp2 or megatron. must be set.
12
+ strategy: ???
13
+
14
+ # Split each sample into sub-batches of this size for PPO
15
+ ppo_mini_batch_size: 256
16
+
17
+ # [Deprecated] Global micro batch size
18
+ ppo_micro_batch_size: null
19
+
20
+ # Local per-GPU micro batch size
21
+ ppo_micro_batch_size_per_gpu: null
22
+
23
+ # Whether to automatically adjust batch size at runtime
24
+ # oc.select: the default val for ref.log_prob_use_dynamic_bsz
25
+ use_dynamic_bsz: false
26
+
27
+ # Max tokens per GPU in one PPO batch; affects gradient accumulation
28
+ # Typically it should be: n * ${data.max_prompt_length} + ${data.max_response_length}
29
+ # oc.select: the default val for ref.log_prob_max_token_len_per_gpu
30
+ ppo_max_token_len_per_gpu: 16384
31
+
32
+ # PPO clip ratio
33
+ clip_ratio: 0.2
34
+
35
+ # Lower bound for asymmetric clipping (used in dual-clip PPO)
36
+ clip_ratio_low: 0.2
37
+
38
+ # Upper bound for asymmetric clipping (used in dual-clip PPO)
39
+ clip_ratio_high: 0.2
40
+
41
+ # Whether to freeze vision model, if set true, it will be freeze vision model
42
+ freeze_vision_tower: false
43
+
44
+ # policy loss config
45
+ policy_loss:
46
+
47
+ # # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
48
+ _target_: verl.workers.config.PolicyLossConfig
49
+
50
+ # Loss function mode: vanilla / clip-cov / kl-cov /gpg from https://arxiv.org/abs/2505.22617
51
+ loss_mode: "vanilla"
52
+
53
+ # Ratio of tokens to be clipped for clip-cov loss
54
+ clip_cov_ratio: 0.0002
55
+
56
+ # Lower bound for clip-cov loss
57
+ clip_cov_lb: 1.0
58
+
59
+ # Upper bound for clip-cov loss
60
+ clip_cov_ub: 5.0
61
+
62
+ # Ratio of tokens to be applied kl penalty for kl-cov loss
63
+ kl_cov_ratio: 0.0002
64
+
65
+ # KL divergence penalty coefficient
66
+ ppo_kl_coef: 0.1
67
+
68
+ # Constant C in Dual-clip PPO; clips when advantage < 0 and ratio > C
69
+ clip_ratio_c: 3.0
70
+
71
+ # Loss aggregation mode: "token-mean", "seq-mean-token-sum", or "seq-mean-token-mean"
72
+ loss_agg_mode: token-mean
73
+
74
+ # Entropy regularization coefficient in PPO loss
75
+ entropy_coeff: 0
76
+
77
+ # Truncated Importance Sampling (TIS): https://fengyao.notion.site/off-policy-rl
78
+ # the truncation value C of truncated Importance Sampling (-1 for disable TIS)
79
+ tis_imp_ratio_cap: -1
80
+
81
+ # Whether to use KL loss instead of KL reward penalty. True for GRPO
82
+ use_kl_loss: false
83
+
84
+ # Whether to use torch.compile()
85
+ # oc.select: the default val for ref.use_torch_compile
86
+ use_torch_compile: true
87
+
88
+ # KL loss coefficient when use_kl_loss is enabled. For GRPO
89
+ kl_loss_coef: 0.001
90
+
91
+ # Type of KL divergence loss. Options: "kl"(k1), "abs", "mse"(k2), "low_var_kl"(k3), "full"
92
+ kl_loss_type: low_var_kl
93
+
94
+ # Number of PPO epochs per batch
95
+ ppo_epochs: 1
96
+
97
+ # Shuffle training data across PPO epochs
98
+ shuffle: false
99
+
100
+ # checkpoint configs
101
+ checkpoint:
102
+
103
+ # Target dataclass for this configuration
104
+ _target_: verl.trainer.config.CheckpointConfig
105
+
106
+ # What to include in saved checkpoints
107
+ # with 'hf_model' you can save whole model as hf format, now only use sharded model checkpoint to save space
108
+ save_contents: ['model', 'optimizer', 'extra']
109
+
110
+ # For more flexibility, you can specify the contents to load from the checkpoint.
111
+ # .xxx refers to the local variable xxx from the same level of hierarchy similar to python pkg
112
+ load_contents: ${.save_contents}
113
+
114
+ # Whether to save checkpoints asynchronously. Only effective for Megatron as of now.
115
+ async_save: False
116
+
117
+ # optimizer configs
118
+ optim:
119
+
120
+ # Learning rate
121
+ lr: 1e-6
122
+
123
+ # Warmup steps ratio (used if lr_warmup_steps is 0 or negative)
124
+ lr_warmup_steps_ratio: 0.0
125
+
126
+ # Total training steps (must be overridden at runtime)
127
+ total_training_steps: -1
128
+
129
+ # Weight decay
130
+ weight_decay: 0.01
131
+
132
+ # Prioritized. None, 0 or Negative values mean delegating to lr_warmup_steps_ratio.
133
+ lr_warmup_steps: -1
134
+
135
+
136
+ # Whether to use custom fused kernels (e.g., FlashAttention, fused MLP)
137
+ use_fused_kernels: ${oc.select:actor_rollout_ref.model.use_fused_kernels,false}
138
+
139
+ # profile the actor model in `update_policy`
140
+ profiler:
141
+
142
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
143
+ _target_: verl.utils.profiler.ProfilerConfig
144
+
145
+ # profiler tool, default same as profiler.tool in global config
146
+ # choices: nsys, npu, torch
147
+ tool: ${oc.select:global_profiler.tool,null}
148
+
149
+ # whether enable profile on Actor
150
+ enable: False
151
+
152
+ # Whether to profile all ranks.
153
+ all_ranks: False
154
+
155
+ # The ranks that will be profiled. [] or [0,1,...]
156
+ ranks: []
157
+
158
+ # profile results saving path
159
+ save_path: ${oc.select:global_profiler.save_path,null}
160
+
161
+ # specific tool config which only related to the role
162
+ tool_config:
163
+
164
+ # nsys tool config
165
+ nsys:
166
+
167
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
168
+ _target_: verl.utils.profiler.config.NsightToolConfig
169
+
170
+ # True for each task has its own database, False for all tasks in one training step share one database.
171
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
172
+
173
+ # npu config
174
+ npu:
175
+
176
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
177
+ _target_: verl.utils.profiler.config.NPUToolConfig
178
+
179
+ # Contents to profile, can be empty
180
+ # options: npu, cpu, memory, shapes, module, stack
181
+ contents: []
182
+
183
+ # Collection level, optional values: level_none, level0, level1, level2.
184
+ level: "level1"
185
+
186
+ # Whether to automatically parse the data.
187
+ analysis: True
188
+
189
+ # True for each task has its own database, False for all tasks in one training step share one database.
190
+ discrete: False
191
+
192
+ # torch profiler config
193
+ torch:
194
+
195
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
196
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
197
+
198
+ # start profile mini-batch in training
199
+ # NOTICE: different with global steps config which refers to iteration
200
+ # This field only related with mini-batch
201
+ step_start: 0
202
+
203
+ # stop profile mini-batch in training
204
+ step_end: null
205
+
206
+ # torch memory profiler config
207
+ torch_memory:
208
+
209
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
210
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
211
+
212
+ # Maximum number of memory allocation entries to track
213
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
214
+
215
+ # Stack trace depth for memory allocations
216
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
e2c/config/actor/dp_actor.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ # defaults specify the default config from each component
8
+ defaults:
9
+
10
+ # fsdp optimizer config
11
+ - ../optim@optim: fsdp
12
+
13
+ # fsdp engine config
14
+ - ../engine@fsdp_config: fsdp
15
+
16
+ # dp actor config, inheriting from trainer/config/actor/actor.yaml
17
+ - actor
18
+
19
+ # load the reference default config, then apply the fields in the current yaml
20
+ - _self_
21
+
22
+ # Target class for this configuration
23
+ _target_: verl.workers.config.FSDPActorConfig
24
+
25
+ # TODO(haibin.lin): switch to fsdp2
26
+ strategy: fsdp
27
+
28
+ # Gradient clipping for actor updates, specific to the strategy.
29
+ grad_clip: 1.0
30
+
31
+ # Sequence parallelism size for Ulysses-style model parallelism
32
+ # oc.select: the default val for ref.ulysses_sequence_parallel_size
33
+ ulysses_sequence_parallel_size: 1
34
+
35
+ # calculate entropy with chunking to reduce memory peak
36
+ entropy_from_logits_with_chunking: False
37
+
38
+ # recompute entropy
39
+ entropy_checkpointing: False
40
+
41
+ # Whether to remove padding tokens in inputs during training
42
+ use_remove_padding: ${oc.select:actor_rollout_ref.model.use_remove_padding,false}
e2c/config/actor/megatron_actor.yaml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # megatron actor config, inheriting from trainer/config/actor/actor.yaml
2
+ defaults:
3
+ # megatron optimizer config
4
+ - ../optim@optim: megatron
5
+
6
+ # megatron engine config
7
+ - ../engine@megatron: megatron
8
+
9
+ - actor
10
+
11
+ # load the reference default config, then apply the fields in the current yaml
12
+ - _self_
13
+
14
+ _target_: verl.workers.config.McoreActorConfig
15
+
16
+ strategy: megatron
17
+
18
+ data_loader_seed: null
19
+
20
+ load_weight: True
e2c/config/algorithm.py ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2024 Bytedance Ltd. and/or its affiliates
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from dataclasses import dataclass, field
16
+ from typing import Any, Optional
17
+
18
+ from verl.base_config import BaseConfig
19
+
20
+ __all__ = ["AlgoConfig", "FilterGroupsConfig", "KLControlConfig"]
21
+
22
+
23
+ @dataclass
24
+ class KLControlConfig(BaseConfig):
25
+ """Configuration for KL control.
26
+
27
+ The inheritance from BaseConfig provides omegaconf.DictConfig-like interface for a dataclass config.
28
+
29
+ Args:
30
+ type (str): Type of KL control. Can be "fixed" or "adaptive".
31
+ kl_coef (float): Initial coefficient for KL penalty.
32
+ horizon (int): Horizon value for adaptive controller.
33
+ target_kl (float): Target KL divergence for adaptive controller.
34
+ """
35
+
36
+ type: str = "fixed"
37
+ kl_coef: float = 0.001
38
+ horizon: int = 10000
39
+ target_kl: float = 0.1
40
+
41
+
42
+ @dataclass
43
+ class FilterGroupsConfig(BaseConfig):
44
+ """Configuration for filter groups (used in DAPO and Entropy).
45
+
46
+ The inheritance from BaseConfig provides omegaconf.DictConfig-like interface for a dataclass config.
47
+
48
+ Args:
49
+ enable (bool): Whether to enable filter groups.
50
+ metric (Optional[str]): Metric to use for filtering: "acc", "score", "seq_reward", "seq_final_reward", etc.
51
+ max_num_gen_batches (int): Non-positive values mean no upper limit.
52
+ """
53
+
54
+ enable: bool = False
55
+ metric: Optional[str] = None
56
+ max_num_gen_batches: int = 0
57
+
58
+
59
+ @dataclass
60
+ class AlgoConfig(BaseConfig):
61
+ """Configuration for the algorithm.
62
+
63
+ The inheritance from BaseConfig provides omegaconf.DictConfig-like interface for a dataclass config.
64
+
65
+ Args:
66
+ gamma (float): Discount factor for future rewards.
67
+ lam (float): Trade-off between bias and variance in the GAE estimator.
68
+ adv_estimator (str): Advantage estimator type: "gae", "grpo", "reinforce_plus_plus", etc.
69
+ norm_adv_by_std_in_grpo (bool): Whether to normalize advantages by std (specific to GRPO).
70
+ use_kl_in_reward (bool): Whether to enable in-reward KL penalty.
71
+ kl_penalty (str): How to estimate KL divergence: "kl", "abs", "mse", "low_var_kl", or "full".
72
+ kl_ctrl (KLControlConfig): KL control configuration.
73
+ use_pf_ppo (bool): Whether to enable preference feedback PPO.
74
+ pf_ppo (dict[str, Any]): Preference feedback PPO settings.
75
+ filter_groups (Optional[FilterGroupsConfig]): Filter groups configuration, used in DAPO and Entropy
76
+ """
77
+
78
+ gamma: float = 1.0
79
+ lam: float = 1.0
80
+ adv_estimator: str = "gae"
81
+ norm_adv_by_std_in_grpo: bool = True
82
+ use_kl_in_reward: bool = False
83
+ kl_penalty: str = "kl"
84
+ kl_ctrl: KLControlConfig = field(default_factory=KLControlConfig)
85
+ use_pf_ppo: bool = False
86
+ pf_ppo: dict[str, Any] = field(default_factory=dict)
87
+ filter_groups: Optional[FilterGroupsConfig] = None
e2c/config/config.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2024 Bytedance Ltd. and/or its affiliates
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from dataclasses import dataclass, field
16
+ from typing import Any, Optional
17
+
18
+ from verl.base_config import BaseConfig
19
+
20
+ __all__ = ["CheckpointConfig", "ProfileConfig", "BaseModelConfig"]
21
+
22
+
23
+ @dataclass
24
+ class CheckpointConfig(BaseConfig):
25
+ """Configuration for model checkpointing.
26
+
27
+ The inheritance from BaseConfig provides omegaconf.DictConfig-like interface for a dataclass config.
28
+
29
+ Args:
30
+ save_contents (list[str]): What to include in saved checkpoints.
31
+ Options: 'model', 'optimizer', 'extra', 'hf_model'.
32
+ load_contents (list[str]): Contents to load from checkpoint. Defaults to same as save_contents.
33
+ async_save (bool): Whether to save checkpoints asynchronously. Only implemented for Megatron as of now.
34
+ """
35
+
36
+ save_contents: list[str] = field(default_factory=lambda: ["model", "optimizer", "extra"])
37
+ load_contents: list[str] = field(default_factory=lambda: ["model", "optimizer", "extra"])
38
+ async_save: bool = False
39
+
40
+
41
+ @dataclass
42
+ class ProfileConfig(BaseConfig):
43
+ """Configuration for profiling.
44
+
45
+ The inheritance from BaseConfig provides omegaconf.DictConfig-like interface for a dataclass config.
46
+
47
+ Args:
48
+ profile_ranks (Optional[list[int]]): List of ranks to profile. None means all ranks.
49
+ step_start (int): Starting step for profiling.
50
+ step_end (int): Ending step for profiling.
51
+ save_path (Optional[str]): Path to save profiling results.
52
+ """
53
+
54
+ profile_ranks: Optional[list[int]] = None
55
+ step_start: int = -1
56
+ step_end: int = -1
57
+ save_path: Optional[str] = None
58
+
59
+
60
+ @dataclass
61
+ class BaseModelConfig(BaseConfig):
62
+ """Base configuration for a model.
63
+ Contains core settings for loading and initializing a pretrained model checkpoint.
64
+
65
+ Args:
66
+ path (str): Path to pretrained model weights.
67
+ tokenizer_path (Optional[str]): Tokenizer path (defaults to actor's model path if not set).
68
+ override_config (dict): Hugging Face config override.
69
+ external_lib (Optional[str]): External model implementation (optional).
70
+ trust_remote_code (bool): Whether to trust remote code from Hugging Face models.
71
+ """
72
+
73
+ path: str = "~/models/deepseek-llm-7b-chat"
74
+ tokenizer_path: Optional[str] = None
75
+ override_config: dict[str, Any] = field(default_factory=dict)
76
+ external_lib: Optional[str] = None
77
+ trust_remote_code: bool = False
e2c/config/critic/critic.yaml ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
2
+ _target_: verl.workers.config.CriticConfig
3
+
4
+ # Number of rollouts per update (mirrors actor rollout_n)
5
+ rollout_n: ${oc.select:actor_rollout_ref.rollout.n,1}
6
+
7
+ # fsdp or fsdp2 strategy used for critic model training
8
+ strategy: ???
9
+
10
+ # whether to enable the critic worker.
11
+ # by default it is only enabled if advantage estimator is gae
12
+ # set it to True manually if you always want to enable critic worker
13
+ enable: null
14
+
15
+ # optimizer configs
16
+ optim:
17
+
18
+ # Learning rate
19
+ lr: 1e-5
20
+
21
+ # Warmup steps ratio; total steps will be injected at runtime
22
+ lr_warmup_steps_ratio: 0.0
23
+
24
+ # Total training steps (must be overridden at runtime)
25
+ total_training_steps: -1
26
+
27
+ # Weight decay
28
+ weight_decay: 0.01
29
+
30
+ # Prioritized. None, 0 or Negative values mean delegating to lr_warmup_steps_ratio.
31
+ lr_warmup_steps: -1
32
+
33
+
34
+ # model config for the critic
35
+ model:
36
+
37
+ # Path to pretrained model weights
38
+ path: ~/models/deepseek-llm-7b-chat
39
+
40
+ # Tokenizer path (defaults to actor's model path)
41
+ tokenizer_path: ${oc.select:actor_rollout_ref.model.path,"~/models/deepseek-llm-7b-chat"}
42
+
43
+ # Hugging Face config override
44
+ override_config: {}
45
+
46
+ # External model implementation (optional)
47
+ external_lib: ${oc.select:actor_rollout_ref.model.external_lib,null}
48
+
49
+ # Whether to trust remote code from Hugging Face models
50
+ trust_remote_code: ${oc.select:actor_rollout_ref.model.trust_remote_code,false}
51
+
52
+ # PPO mini-batch size per update
53
+ ppo_mini_batch_size: ${oc.select:actor_rollout_ref.actor.ppo_mini_batch_size,256}
54
+
55
+ # [Deprecated] Global micro batch size
56
+ ppo_micro_batch_size: null
57
+
58
+ # Local per-GPU micro batch size
59
+ ppo_micro_batch_size_per_gpu: ${oc.select:.ppo_micro_batch_size,null}
60
+
61
+ # Whether to automatically adjust batch size at runtime
62
+ use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
63
+
64
+ # Max tokens per GPU in one PPO batch (doubled for critic)
65
+ ppo_max_token_len_per_gpu: 32768
66
+
67
+ # Max token length per GPU in forward pass
68
+ forward_max_token_len_per_gpu: ${.ppo_max_token_len_per_gpu}
69
+
70
+ # Number of PPO epochs per batch
71
+ ppo_epochs: ${oc.select:actor_rollout_ref.actor.ppo_epochs,1}
72
+
73
+ # Shuffle training data across PPO epochs
74
+ shuffle: ${oc.select:actor_rollout_ref.actor.shuffle,false}
75
+
76
+ # PPO value function clipping range
77
+ cliprange_value: 0.5
78
+
79
+ # Loss aggregation mode: "token-mean", "seq-mean-token-sum", or "seq-mean-token-mean"
80
+ loss_agg_mode: ${oc.select:actor_rollout_ref.actor.loss_agg_mode,token-mean}
81
+
82
+ # checkpoint configs
83
+ checkpoint:
84
+
85
+ # Target dataclass for this configuration
86
+ _target_: verl.trainer.config.CheckpointConfig
87
+
88
+ # What to include in saved checkpoints
89
+ # with 'hf_model' you can save whole model as hf format, now only use sharded model checkpoint to save space
90
+ save_contents: ['model', 'optimizer', 'extra']
91
+
92
+ # What to include when loading checkpoints
93
+ load_contents: ${.save_contents}
94
+
95
+ # Whether to save checkpoints asynchronously. Only effective for Megatron as of now.
96
+ async_save: False
97
+
98
+ # profile the critic model in `update_critic`
99
+ profiler:
100
+
101
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
102
+ _target_: verl.utils.profiler.ProfilerConfig
103
+
104
+ # profiler tool, default same as profiler.tool in global config
105
+ # choices: nsys, npu, torch, torch_memory
106
+ tool: ${oc.select:global_profiler.tool,null}
107
+
108
+ # whether enable profile on Critic
109
+ enable: False
110
+
111
+ # Whether to profile all ranks.
112
+ all_ranks: False
113
+
114
+ # The ranks that will be profiled. [] or [0,1,...]
115
+ ranks: []
116
+
117
+ # profile results saving path
118
+ save_path: ${oc.select:global_profiler.save_path,null}
119
+
120
+ # specific tool config which only related to the role
121
+ tool_config:
122
+
123
+ # nsys tool config
124
+ nsys:
125
+
126
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
127
+ _target_: verl.utils.profiler.config.NsightToolConfig
128
+
129
+ # True for each task has its own database, False for all tasks in one training step share one database.
130
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
131
+
132
+ # npu config
133
+ npu:
134
+
135
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
136
+ _target_: verl.utils.profiler.config.NPUToolConfig
137
+
138
+ # Contents to profile, can be empty
139
+ # options: npu, cpu, memory, shapes, module, stack
140
+ contents: []
141
+
142
+ # Collection level, optional values: level_none, level0, level1, level2.
143
+ level: "level1"
144
+
145
+ # Whether to automatically parse the data.
146
+ analysis: True
147
+
148
+ # True for each task has its own database, False for all tasks in one training step share one database.
149
+ discrete: False
150
+
151
+ # torch profiler config
152
+ torch:
153
+
154
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
155
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
156
+
157
+ # start profile mini-batch in training
158
+ # NOTICE: different with global steps config which refers to iteration
159
+ # This field only related with mini-batch
160
+ step_start: 0
161
+
162
+ # stop profile mini-batch in training
163
+ step_end: null
164
+
165
+ # torch memory profiler config
166
+ torch_memory:
167
+
168
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
169
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
170
+
171
+ # Maximum number of memory allocation entries to track
172
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
173
+
174
+ # Stack trace depth for memory allocations
175
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
176
+
e2c/config/critic/dp_critic.yaml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ # defaults specify the default config from each component
8
+ defaults:
9
+
10
+ # fsdp optimizer config
11
+ - ../optim@optim: fsdp
12
+
13
+ # fsdp engine config
14
+ - ../engine@model.fsdp_config: fsdp
15
+
16
+ # dp actor config, inheriting from trainer/config/critic/critic.yaml
17
+ - critic
18
+
19
+ # load the reference default config, then apply the fields in the current yaml
20
+ - _self_
21
+
22
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
23
+ _target_: verl.workers.config.FSDPCriticConfig
24
+
25
+ # distribution strategy. Options: fsdp (deprecating), fsdp2
26
+ strategy: fsdp
27
+
28
+ # model config for the critic
29
+ model:
30
+
31
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
32
+ _target_: verl.workers.config.FSDPCriticModelCfg
33
+
34
+ # Whether to use shared memory for loading the model
35
+ use_shm: False
36
+
37
+ # Enable gradient checkpointing to save memory
38
+ enable_gradient_checkpointing: True
39
+
40
+ # Offload activations to CPU to reduce GPU memory usage
41
+ enable_activation_offload: False
42
+
43
+ # Use remove padding optimization (saves compute)
44
+ use_remove_padding: False
45
+
46
+ # Set to positive value to enable LoRA (e.g., 32)
47
+ lora_rank: 0
48
+
49
+ # LoRA scaling factor
50
+ lora_alpha: 16
51
+
52
+ # LoRA target modules: "all-linear" or list of linear projection layers
53
+ target_modules: all-linear
54
+
55
+ # Forward-only batch size during inference (global)
56
+ forward_micro_batch_size: ${oc.select:.ppo_micro_batch_size,null}
57
+
58
+ # Forward-only batch size during inference (per GPU)
59
+ forward_micro_batch_size_per_gpu: ${oc.select:.ppo_micro_batch_size_per_gpu,null}
60
+
61
+ # Sequence parallelism size for Ulysses-style model parallelism
62
+ ulysses_sequence_parallel_size: 1
63
+
64
+ # Gradient clipping for critic updates
65
+ grad_clip: 1.0
e2c/config/critic/megatron_critic.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # defaults specify the default config from each component
2
+ defaults:
3
+
4
+ # megatron optimizer config
5
+ - ../optim@optim: megatron
6
+
7
+ # megatron engine config
8
+ - ../engine@megatron: megatron
9
+
10
+ # dp actor config, inheriting from trainer/config/critic/critic.yaml
11
+ - critic
12
+
13
+ # load the reference default config, then apply the fields in the current yaml
14
+ - _self_
15
+
16
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
17
+ _target_: verl.workers.config.McoreCriticConfig
18
+
19
+ strategy: megatron
20
+
21
+ # seconds, default is 10 minutes for torch, you can set it to a larger value if you have long-running operations like 32B or 72B model using megatron
22
+ nccl_timeout: 600
23
+
24
+ # model config for the critic
25
+ model:
26
+
27
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
28
+ _target_: verl.trainer.config.BaseModelConfig
29
+
30
+ # override default empty mapping
31
+ override_config:
32
+
33
+ model_config: {}
34
+
35
+ moe_config:
36
+
37
+ freeze_moe_router: False
38
+
39
+ # Whether to load initial weights
40
+ load_weight: True
41
+
42
+ # seed for data loader
43
+ data_loader_seed: ${oc.select:actor_rollout_ref.actor.data_loader_seed,null}
e2c/config/data/legacy_data.yaml ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Tokenizer class or path. If null, it will be inferred from the model.
2
+ tokenizer: null
3
+
4
+ # Whether to use shared memory for data loading.
5
+ use_shm: False
6
+
7
+ # Training set parquet. Can be a list or a single file.
8
+ # The program will read all files into memory, so it can't be too large (< 100GB).
9
+ # The path can be either a local path or an HDFS path.
10
+ # For HDFS path, we provide utils to download it to DRAM and convert it to a local path.
11
+ train_files: ~/data/rlhf/gsm8k/train.parquet
12
+
13
+ # Validation parquet. Can be a list or a single file.
14
+ val_files: ~/data/rlhf/gsm8k/test.parquet
15
+
16
+ # The field in the dataset where the prompt is located. Default is 'prompt'.
17
+ prompt_key: prompt
18
+
19
+ # The field used to select the reward function (if using different ones per example).
20
+ reward_fn_key: data_source
21
+
22
+ # Maximum prompt length. All prompts will be left-padded to this length.
23
+ # An error will be reported if the length is too long.
24
+ # oc.select: default val for rollout.prompt_length
25
+ max_prompt_length: 512
26
+
27
+ # Maximum response length. Rollout in RL algorithms (e.g. PPO) generates up to this length.
28
+ # oc.select: default val for rollout.response_length
29
+ max_response_length: 512
30
+
31
+ # Batch size sampled for one training iteration of different RL algorithms.
32
+ train_batch_size: 1024
33
+
34
+ # Batch size used during validation. Can be null.
35
+ val_batch_size: null
36
+
37
+ # Whether to return the original input_ids without adding chat template.
38
+ # This is used when the reward model's chat template differs from the policy.
39
+ # If using a model-based RM with different templates, this should be True.
40
+ return_raw_input_ids: False
41
+
42
+ # Whether to return the original chat (prompt) without applying chat template.
43
+ return_raw_chat: False
44
+
45
+ # Whether to return the full prompt with chat template.
46
+ return_full_prompt: False
47
+
48
+ # Whether to shuffle the data in the dataloader.
49
+ shuffle: True
50
+
51
+ # num dataloader workers
52
+ dataloader_num_workers: 8
53
+
54
+ # Whether to shuffle the validation set.
55
+ validation_shuffle: False
56
+
57
+ # Whether to filter overlong prompts.
58
+ filter_overlong_prompts: False
59
+
60
+ # Number of workers for filtering overlong prompts.
61
+ # For large-scale datasets, filtering can be time-consuming.
62
+ # Use multiprocessing to speed up. Default is 1.
63
+ filter_overlong_prompts_workers: 1
64
+
65
+ # Truncate the input_ids or prompt if they exceed max_prompt_length.
66
+ # Options: 'error', 'left', 'right', 'middle'. Default is 'error'.
67
+ truncation: error
68
+
69
+ # The field in the multi-modal dataset where the image is located. Default is 'images'.
70
+ image_key: images
71
+
72
+ # The field in the multi-modal dataset where the video is located.
73
+ video_key: videos
74
+
75
+ # If the remote tokenizer has a Python file, this flag determines whether to allow using it.
76
+ trust_remote_code: False
77
+
78
+ # Optional: specify a custom dataset class path and name if overriding default loading behavior.
79
+ custom_cls:
80
+
81
+ # The path to the file containing your customized dataset class. If not specified, pre-implemented dataset will be used.
82
+ path: null
83
+
84
+ # The name of the dataset class within the specified file.
85
+ name: null
86
+
87
+ # Whether to return multi-modal inputs in the dataset. Set to False if rollout generates new multi-modal inputs.
88
+ return_multi_modal_inputs: True
89
+
90
+ # settings related to data sampler
91
+ sampler:
92
+
93
+ # the path to the module containing a curriculum class which implements the
94
+ # AbstractSampler interface
95
+ class_path: null
96
+
97
+ # the name of the curriculum class like `MySampler`
98
+ class_name: null
99
+
100
+ # Data generation configuration for augmenting the dataset.
101
+ datagen:
102
+
103
+ # The path to the file containing your customized data generation class.
104
+ # E.g. 'pkg://verl.experimental.dynamic_dataset.dynamicgen_dataset'
105
+ path: null
106
+
107
+ # The class name of the data generation class within the specified file.
108
+ # E.g. 'MockDataGenerator'
109
+ name: null
110
+
111
+ # Additional kwargs when calling tokenizer.apply_chat_template
112
+ apply_chat_template_kwargs: {}
e2c/config/engine/fsdp.yaml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Target class for this configuration
2
+ _target_: verl.workers.config.FSDPEngineConfig
3
+
4
+ # policy for wrapping the model
5
+ wrap_policy:
6
+
7
+ # Minimum number of parameters to trigger wrapping a layer with FSDP
8
+ min_num_params: 0
9
+
10
+ # Whether to offload model parameters to CPU (trades speed for memory)
11
+ # Note that this differs from the offload_policy in FSDP
12
+ param_offload: false
13
+
14
+ # Whether to offload optimizer state to CPU
15
+ # Note that this differs from the offload_policy in FSDP
16
+ optimizer_offload: false
17
+
18
+ # Only for FSDP2: offload param/grad/optimizer during train
19
+ offload_policy: false
20
+
21
+ # Only for FSDP2: Reshard after forward pass to reduce memory footprint
22
+ reshard_after_forward: true
23
+
24
+ # Number of GPUs in each FSDP shard group; -1 means auto
25
+ fsdp_size: -1
26
+
27
+ # Only for FSDP1: FSDP1 configuration, prefetch the next forward-pass all-gather
28
+ # before the current forward computation.
29
+ forward_prefetch: False
30
+
31
+ # model dtype of fsdp
32
+ model_dtype: fp32
33
+
34
+ # Whether to use original parameters in fsdp. Only avaiable in fsdp1
35
+ use_orig_params: false
36
+
37
+ # ulysses sequence parallel size
38
+ ulysses_sequence_parallel_size: 1
39
+
40
+ # Whether to use entropy_from_logits_with_chunking in fsdp.
41
+ entropy_from_logits_with_chunking: false
42
+
43
+ # Whether to use torch compile in fsdp.
44
+ use_torch_compile: true
45
+
46
+ # Whether to use entropy checkpointing in fsdp.
47
+ entropy_checkpointing: false
48
+
49
+ # Whether to use forward only in fsdp.
50
+ forward_only: false
51
+
52
+ # fsdp or fsdp2
53
+ strategy: fsdp
e2c/config/engine/megatron.yaml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
2
+ _target_: verl.workers.config.McoreEngineConfig
3
+
4
+ # Whether to offload model parameters to CPU
5
+ param_offload: False
6
+
7
+ # Whether to offload gradients to CPU
8
+ grad_offload: False
9
+
10
+ # Whether to offload optimizer state to CPU
11
+ optimizer_offload: False
12
+
13
+ # tensor model parallel size
14
+ tensor_model_parallel_size: 1
15
+
16
+ # expert model parallel size
17
+ expert_model_parallel_size: 1
18
+
19
+ # expert tensor parallel size
20
+ expert_tensor_parallel_size: 1
21
+
22
+ # pipeline model parallel size
23
+ pipeline_model_parallel_size: 1
24
+
25
+ # virtual pipeline model parallel size
26
+ virtual_pipeline_model_parallel_size: null
27
+
28
+ # context parallel size
29
+ context_parallel_size: 1
30
+
31
+ # sequence parallel
32
+ sequence_parallel: True
33
+
34
+ # Whether to use distributed optimizer
35
+ use_distributed_optimizer: True
36
+
37
+ # Whether to use distributed checkpointing
38
+ use_dist_checkpointing: False
39
+
40
+ # distributed checkpointing path
41
+ dist_checkpointing_path: null
42
+
43
+ # oc.select: default val for ref.megatron.seed
44
+ seed: 42
45
+
46
+ # Allow to override Distributed Data Parallel (DDP) config
47
+ override_ddp_config: {}
48
+
49
+ # additional transformer config like: num_layers_in_first(/last)_pipeline_stage
50
+ # oc.select: default val for ref.megatron.override_transformer_config
51
+ override_transformer_config:
52
+ # Recompute configuration, same as in megatron.training.arguments
53
+ # default use minimal performance-interference recompute methods
54
+ # Recompute granualarity, choices: ["full", "selective"]
55
+ recompute_granularity: null
56
+
57
+ # Recompute modules, multiple choices: ["core_attn", "moe_act", "layernorm", "mla_up_proj", "mlp", "moe"]
58
+ # Please use correct module in matched model
59
+ recompute_modules: ["core_attn"]
60
+
61
+ # 'uniform', 'block'
62
+ # 'uniform' divides the total number of transformer layers and checkpoints the input activation of each chunk
63
+ # 'block' checkpoints the specified number of layers per pipeline stage at the specified granularity
64
+ recompute_method: null
65
+
66
+ # 'full' will checkpoint the entire transformer layer and 'selective' only checkpoints memory intensive part of attention
67
+ recompute_num_layers: null
68
+
69
+ # Attention backend to use (flash,fused,unfused,local,auto). Defaults to auto in mcore, flash in verl
70
+ attention_backend: flash
71
+
72
+ override_mcore_model_config: {}
73
+
74
+ # oc.select: default val for ref.megatron.use_mbridge
75
+ use_mbridge: False
76
+
77
+ # whether to use forward only
78
+ forward_only: False
e2c/config/evaluation.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ data:
2
+ path: /tmp/math_Qwen2-7B-Instruct.parquet
3
+ prompt_key: prompt
4
+ response_key: responses
5
+ data_source_key: data_source
6
+ reward_model_key: reward_model
7
+
8
+ custom_reward_function:
9
+ path: null
10
+ name: compute_score
11
+
12
+ ray_kwargs:
13
+ ray_init:
14
+ num_cpus: null # `None` means using all CPUs, which might cause hang if limited in systems like SLURM. Please set to a number allowed then.
15
+ timeline_json_file: null
e2c/config/generation.yaml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ trainer:
2
+ nnodes: 1
3
+ n_gpus_per_node: 8
4
+ device: cuda
5
+
6
+ data:
7
+ path: ~/data/rlhf/math/test.parquet
8
+ prompt_key: prompt
9
+ n_samples: 5
10
+ output_path: /opt/tiger/math_Qwen2-7B-Instruct.parquet
11
+ batch_size: 128
12
+
13
+ model:
14
+ path: ~/models/Qwen2-7B-Instruct
15
+ external_lib: null
16
+ rollout:
17
+ _target_: verl.workers.config.RolloutConfig
18
+ name: vllm
19
+ mode: sync # sync: LLM, async: AsyncLLM
20
+ temperature: 1.0
21
+ top_k: 50 # 0 for hf rollout, -1 for vllm rollout
22
+ top_p: 0.7
23
+ prompt_length: 1536
24
+ response_length: 512
25
+ # for vllm rollout
26
+ dtype: bfloat16 # should align with FSDP
27
+ gpu_memory_utilization: 0.5
28
+ ignore_eos: False
29
+ enforce_eager: True
30
+ free_cache_engine: True
31
+ load_format: auto
32
+ tensor_model_parallel_size: 1
33
+ max_num_batched_tokens: 8192
34
+ max_model_len: null
35
+ max_num_seqs: 1024
36
+ log_prob_micro_batch_size: null # will be deprecated, use log_prob_micro_batch_size_per_gpu
37
+ log_prob_micro_batch_size_per_gpu: 8
38
+ # for hf rollout
39
+ do_sample: True
40
+ disable_log_stats: True
41
+ enable_chunked_prefill: True
42
+ n: 1
43
+ # support logging rollout prob for debugging purpose
44
+ calculate_log_probs: False
45
+ actor:
46
+ strategy: fsdp # This is for backward-compatibility
47
+ ulysses_sequence_parallel_size: 1 # sp size
48
+ entropy_from_logits_with_chunking: False # calculate entropy with chunking to reduce memory peak
49
+ entropy_checkpointing: False # recompute entropy
50
+ fsdp_config:
51
+ fsdp_size: -1
52
+ forward_prefetch: False # FSDP1 forward_prefetch configuration
53
+
54
+ ray_kwargs:
55
+ ray_init:
56
+ num_cpus: null # `None` means using all CPUs, which might cause hang if limited in systems like SLURM. Please set to a number allowed then.
57
+ timeline_json_file: null
e2c/config/model/hf_model.yaml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ _target_: verl.workers.config.HFModelConfig
8
+
9
+ # path to the huggingface model
10
+ path: ~/models/deepseek-llm-7b-chat
11
+
12
+ # config to the huggingface config. In case it is not the same as path
13
+ hf_config_path: null
14
+
15
+ # path to the huggingface tokenizer. In case it is not the same as path
16
+ tokenizer_path: null
17
+
18
+ # whether to use shared memory for model loading
19
+ use_shm: False
20
+
21
+ # whether to trust remote code.
22
+ trust_remote_code: False
23
+
24
+ # custom chat template for the model
25
+ custom_chat_template: null
26
+
27
+ # whether to use external libs for the model
28
+ external_lib: null
29
+
30
+ # override hf config
31
+ override_config: {}
32
+
33
+ # whether to enable gradient checkpointing. Only valid when we use hf model definition
34
+ enable_gradient_checkpointing: True
35
+
36
+ # whether to enable activation offload. Only valid when we use hf model definition
37
+ enable_activation_offload: False
38
+
39
+ # whether to use remove padding. Only valid when we use hf model definition
40
+ use_remove_padding: False
41
+
42
+ # Set to positive value to enable LoRA (e.g., 32)
43
+ lora_rank: 0
44
+
45
+ # LoRA scaling factor
46
+ lora_alpha: 16
47
+
48
+ # Target modules for LoRA adaptation
49
+ target_modules: all-linear
50
+
51
+ # Exclude modules from LoRA adaptation
52
+ exclude_modules: null
53
+
54
+ # whether to use liger. Only valid when we use hf model definition
55
+ use_liger: False
56
+
57
+ # whether to use fused kernels.
58
+ use_fused_kernels: False
59
+
60
+ # fused kernel options.
61
+ fused_kernel_options:
62
+
63
+ # the implementation backend for fused kernels.
64
+ impl_backend: torch
e2c/config/npu_profile/npu_profile.yaml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Options for the npu profiler
2
+ options:
3
+
4
+ # Storage path of collected data.
5
+ save_path: ./profiler_data
6
+
7
+ # The roles that will be profiled. Only takes effect in discrete mode.
8
+ # optional values: all, rollout_generate, actor_compute_log_prob, actor_update and ref_compute_log_prob.
9
+ # "all" means all roles will be profiled.
10
+ roles: ["all"]
11
+
12
+ # Collection level, optional values: level_none, level0, level1, level2.
13
+ level: level1
14
+
15
+ # Whether to enable memory analysis.
16
+ with_memory: False
17
+
18
+ # Whether to record tensor shape.
19
+ record_shapes: False
20
+
21
+ # Whether to record Device-side performance data.
22
+ with_npu: True
23
+
24
+ # Whether to record Host-side performance data.
25
+ with_cpu: True
26
+
27
+ # Whether to record Python call stack information.
28
+ with_module: False
29
+
30
+ # Whether to record operator call stack information.
31
+ with_stack: False
32
+
33
+ # Whether to automatically parse the data.
34
+ analysis: True
e2c/config/optim/fsdp.yaml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Target class for this configuration
2
+ _target_: verl.workers.config.FSDPOptimizerConfig
3
+
4
+ # Learning rate
5
+ lr: 1e-3
6
+
7
+ # LR warmup steps ratio
8
+ lr_warmup_steps_ratio: 0.0
9
+
10
+ # Total training steps
11
+ total_training_steps: -1
12
+
13
+ # Weight decay
14
+ weight_decay: 0.01
15
+
16
+ # LR warmup steps
17
+ lr_warmup_steps: -1
18
+
19
+ # Betas for Adam optimizer
20
+ betas: [0.9, 0.999]
21
+
22
+ # Clip gradient
23
+ clip_grad: 1.0
24
+
25
+ # Minimum LR ratio for cosine schedule
26
+ min_lr_ratio: 0.0
27
+
28
+ # Number of cosine cycles in LR schedule
29
+ num_cycles: 0.5
30
+
31
+ # LR warmup style: "constant" or "cosine"
32
+ warmup_style: constant
33
+
e2c/config/optim/megatron.yaml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _target_: verl.workers.config.McoreOptimizerConfig
2
+
3
+ # Learning rate
4
+ lr: 1e-3
5
+
6
+ # LR warmup steps ratio
7
+ lr_warmup_steps_ratio: 0.0
8
+
9
+ # Total training steps
10
+ total_training_steps: -1
11
+
12
+ # Weight decay
13
+ weight_decay: 0.01
14
+
15
+ # LR warmup steps
16
+ lr_warmup_steps: -1
17
+
18
+ # Betas for Adam optimizer
19
+ betas: [0.9, 0.999]
20
+
21
+ # Clip gradient
22
+ clip_grad: 1.0
23
+
24
+ # optimizer type
25
+ optimizer: adam
26
+
27
+ # initial learning rate for warmup, default to 0.0
28
+ lr_warmup_init: 0.0
29
+
30
+ lr_decay_steps: null
31
+
32
+ # select from constant/linear/cosine/inverse_square_root
33
+ lr_decay_style: constant
34
+
35
+ # minimum learning rate, default to 0.0
36
+ min_lr: 0.0
37
+
38
+ # select from constant/linear/cosine
39
+ weight_decay_incr_style: constant
40
+
41
+ # select from constant/exponential/cosine
42
+ lr_wsd_decay_style: exponential
43
+
44
+ lr_wsd_decay_steps: null
45
+
46
+ # use checkpoint optimizer parameter scheduler
47
+ use_checkpoint_opt_param_scheduler: False
48
+
49
+ override_optimizer_config: {}
e2c/config/ppo_megatron_trainer.yaml ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # specify the default per-component configs
2
+ defaults:
3
+ # <folder_name>@<field_name>.<field_name>: <yaml_file_name>
4
+ # actor_rollout_ref.actor: trainer/config/actor/megatron_actor.yaml
5
+ - actor@actor_rollout_ref.actor: megatron_actor
6
+ # data: trainer/config/data/legacy_data.yaml
7
+ - data@data: legacy_data
8
+ # load the reference default config, then apply the fields in the current yaml
9
+ # Reference model config.
10
+ # Reference model will be enabled when actor.use_kl_loss or/and algorithm.use_kl_in_reward is/are True.
11
+ - ref@actor_rollout_ref.ref: megatron_ref
12
+ # Rollout model config.
13
+ - rollout@actor_rollout_ref.rollout: rollout
14
+ # Critic model config.
15
+ - critic@critic: megatron_critic
16
+ # Reward model config.
17
+ - reward_model@reward_model: megatron_reward_model
18
+ - _self_
19
+
20
+ actor_rollout_ref:
21
+ hybrid_engine: True
22
+
23
+ nccl_timeout: 600 # seconds, default is 10 minutes for torch, you can set it to a larger value if you have long-running operations like 32B or 72B model using megatron
24
+
25
+ model:
26
+
27
+ path: ~/models/deepseek-llm-7b-chat
28
+
29
+ custom_chat_template: null
30
+
31
+ external_lib: null
32
+
33
+ override_config:
34
+ model_config: {}
35
+
36
+ moe_config:
37
+ freeze_moe_router: False
38
+
39
+ use_fused_kernels: False # Whether to use custom fused kernels (PostProcessing, for memory efficiency)
40
+
41
+ trust_remote_code: False
42
+
43
+ # Whether to remove padding tokens in inputs during training
44
+ use_remove_padding: false
45
+
46
+ rollout:
47
+ layer_name_map:
48
+ qkv_layer_name: qkv
49
+ gate_proj_layer_name: gate_up
50
+
51
+ custom_reward_function:
52
+ path: null
53
+ name: compute_score
54
+
55
+ algorithm:
56
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
57
+ _target_: verl.trainer.config.AlgoConfig
58
+ gamma: 1.0
59
+ lam: 1.0
60
+ adv_estimator: gae
61
+ norm_adv_by_std_in_grpo: True
62
+ use_kl_in_reward: False
63
+ kl_penalty: kl # how to estimate kl divergence
64
+ kl_ctrl:
65
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
66
+ _target_: verl.trainer.config.KLControlConfig
67
+ type: fixed
68
+ kl_coef: 0.001
69
+ horizon: 10000
70
+ target_kl: 0.1
71
+ use_pf_ppo: False
72
+ pf_ppo:
73
+ reweight_method: pow # ["pow", "max_min", "max_random"]
74
+ weight_pow: 2.0
75
+
76
+ trainer:
77
+ balance_batch: True
78
+ total_epochs: 30
79
+ total_training_steps: null
80
+ project_name: verl_examples
81
+ experiment_name: gsm8k
82
+ logger: ["console", "wandb"]
83
+ log_val_generations: 0
84
+ nnodes: 1
85
+ n_gpus_per_node: 8
86
+ save_freq: -1
87
+ esi_redundant_time: 0
88
+
89
+ # auto: find the last ckpt to resume. If can't find, start from scratch
90
+ resume_mode: auto # or disable or resume_path if resume_from_path is set
91
+ resume_from_path: null
92
+ del_local_ckpt_after_load: False
93
+ val_before_train: True
94
+ test_freq: -1
95
+ critic_warmup: 0
96
+ default_hdfs_dir: null
97
+ default_local_dir: checkpoints/${trainer.project_name}/${trainer.experiment_name}
98
+ max_actor_ckpt_to_keep: null
99
+ max_critic_ckpt_to_keep: null
100
+ # The timeout for ray worker group to wait for the register center to be ready
101
+ ray_wait_register_center_timeout: 300
102
+ device: cuda
103
+ # Directory for logging rollout data; no dump if null
104
+ rollout_data_dir: null
105
+
106
+ global_profiler:
107
+ _target_: verl.utils.profiler.ProfilerConfig
108
+ tool: null # choose between nsys, npu, torch, torch_memory
109
+ steps: null # profile steps
110
+ profile_continuous_steps: False
111
+ save_path: "outputs/profile" # profiler saving path
112
+ # Specific tool configs, can use +profiler.tool_config.[tool].xxx to config
113
+ global_tool_config:
114
+ # nsys config
115
+ nsys:
116
+ # True for each task has its own database, False for all tasks in one training step share one database.
117
+ discrete: False
118
+
119
+ # controller Nvidia Nsight Systems Options. Must set when profile_steps is not None.
120
+ ## reference https://docs.nvidia.com/nsight-systems/UserGuide/index.html
121
+ ## reference https://docs.ray.io/en/latest/ray-observability/user-guides/profiling.html
122
+ controller_nsight_options:
123
+ # Select the API(s) to be traced.
124
+ trace: "cuda,nvtx,cublas,ucx"
125
+
126
+ # Track the GPU memory usage by CUDA kernels. Must be string type "true" or "false".
127
+ cuda-memory-usage: "true"
128
+
129
+ # CUDA graphs will be traced as a whole
130
+ cuda-graph-trace: "graph"
131
+
132
+ # worker Nvidia Nsight Systems Options. Must set when profile_steps is not None.
133
+ worker_nsight_options:
134
+ # Select the API(s) to be traced.
135
+ trace: "cuda,nvtx,cublas,ucx"
136
+
137
+ # Track the GPU memory usage by CUDA kernels. Must be string type "true" or "false".
138
+ cuda-memory-usage: "true"
139
+
140
+ # CUDA graphs will be traced as a whole
141
+ cuda-graph-trace: "graph"
142
+
143
+ # Profiling only in a range of torch.cuda.profiler.start and stop. Do not change this config.
144
+ capture-range: "cudaProfilerApi"
145
+
146
+ # Specify the desired behavior when a capture range ends.
147
+ # In verl we need the torch.cuda.profiler.start/stop pair to repeats n times.
148
+ # valid values are "repeat-shutdown:n" or null.
149
+ # For normal whole step profiling, n = len(profile_steps);
150
+ # but for discrete profiling, n = len(profile_steps) * Number(subtasks).
151
+ # Or you can just leave it null and the program will use n = len(profile_steps) * 6;
152
+ capture-range-end: null
153
+
154
+ # Send signal to the target application's process group. We let the program to exit by itself.
155
+ kill: none
156
+
157
+ # enable memory visualization for debugging memory usage
158
+ torch_memory:
159
+ # Maximum number of allocation entries to record
160
+ trace_alloc_max_entries: 100_000
161
+ # The depth of the call stack to capture for each allocation
162
+ stack_depth: 32
163
+ # 'alloc': records only allocation events || 'state': records memory state changes || 'all': records both.
164
+ context: "all"
165
+ # 'python': records Python stacks || 'cpp': records C++ stacks (available in some versions) || 'all': records both.
166
+ stacks: "all"
167
+ # devices, record_context etc.
168
+ kw_args: {}
169
+
170
+ ray_kwargs:
171
+ ray_init:
172
+ num_cpus: null # `None` means using all CPUs, which might cause hang if limited in systems like SLURM. Please set to a number allowed then.
173
+ timeline_json_file: null
e2c/config/ppo_trainer.yaml ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ # specify the default per-component configs
8
+ defaults:
9
+
10
+ # <folder_name>@<field_name>.<field_name>: <yaml_file_name>
11
+ # actor_rollout_ref.actor: trainer/config/actor/dp_actor.yaml
12
+ - actor@actor_rollout_ref.actor: dp_actor
13
+
14
+ # data: trainer/config/data/legacy_data.yaml
15
+ - data@data: legacy_data
16
+
17
+ # Reference model config.
18
+ # Reference model will be enabled when actor.use_kl_loss or/and algorithm.use_kl_in_reward is/are True.
19
+ - ref@actor_rollout_ref.ref: dp_ref
20
+
21
+ # Rollout model config.
22
+ - rollout@actor_rollout_ref.rollout: rollout
23
+
24
+ # Model config.
25
+ - model@actor_rollout_ref.model: hf_model
26
+
27
+ # Critic model config.
28
+ - critic@critic: dp_critic
29
+
30
+ # Reward model config.
31
+ - reward_model@reward_model: dp_reward_model
32
+
33
+ # load the reference default config, then apply the fields in the current yaml
34
+ # self config override anything above
35
+ - _self_
36
+
37
+ # config for actor, rollout and reference model
38
+ actor_rollout_ref:
39
+
40
+ # Whether it's a hybrid engine, currently only supports hybrid engine
41
+ hybrid_engine: true
42
+
43
+ # Timeout for operations executed against the process group
44
+ nccl_timeout: 600
45
+
46
+ # Rollout model config.
47
+ rollout:
48
+
49
+ # for huge model, layered summon can save memory (prevent OOM) but make it slower
50
+ layered_summon: False
51
+
52
+ # custom reward function definition
53
+ custom_reward_function:
54
+
55
+ # The path to the file containing your customized reward function.
56
+ # If not specified, pre-implemented reward functions will be used.
57
+ path: null
58
+
59
+ # The name of the reward function within the specified file. Default is 'compute_score'.
60
+ name: compute_score
61
+
62
+ # config for the algorithm
63
+ algorithm:
64
+
65
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
66
+ _target_: verl.trainer.config.AlgoConfig
67
+
68
+ # Discount factor for future rewards
69
+ gamma: 1.0
70
+
71
+ # Trade-off between bias and variance in the GAE estimator
72
+ lam: 1.0
73
+
74
+ # Advantage estimator type: "gae", "grpo", "reinforce_plus_plus", etc.
75
+ adv_estimator: gae
76
+
77
+ # Whether to normalize advantages by std (specific to GRPO)
78
+ norm_adv_by_std_in_grpo: True
79
+
80
+ # Whether to enable in-reward KL penalty
81
+ use_kl_in_reward: False
82
+
83
+ # How to estimate KL divergence: "kl", "abs", "mse", "low_var_kl", or "full"
84
+ kl_penalty: kl
85
+
86
+ # KL control configuration
87
+ kl_ctrl:
88
+
89
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
90
+ _target_: verl.trainer.config.KLControlConfig
91
+
92
+ # KL control type: "fixed" or "adaptive"
93
+ type: fixed
94
+
95
+ # Initial coefficient for KL penalty
96
+ kl_coef: 0.001
97
+
98
+ # Horizon value for adaptive controller (if enabled)
99
+ horizon: 10000
100
+
101
+ # Target KL divergence (used for adaptive controller)
102
+ target_kl: 0.1
103
+
104
+ # Whether to enable preference feedback PPO
105
+ use_pf_ppo: False
106
+
107
+ # Preference feedback PPO settings
108
+ pf_ppo:
109
+
110
+ # Method for reweighting samples: "pow", "max_min", or "max_random"
111
+ reweight_method: pow
112
+
113
+ # Power used for weight scaling in "pow" method
114
+ weight_pow: 2.0
115
+
116
+ # config for the trainer
117
+ trainer:
118
+
119
+ # Whether to balance batch sizes across distributed workers
120
+ balance_batch: True
121
+
122
+ # Number of epochs in training
123
+ total_epochs: 30
124
+
125
+ # Total training steps (can be set explicitly or derived from epochs)
126
+ total_training_steps: null
127
+
128
+ # Project name for experiment tracking (e.g., wandb)
129
+ project_name: verl_examples
130
+
131
+ # Experiment name for run identification in tracking tools
132
+ experiment_name: gsm8k
133
+
134
+ # Logging backends to use: "console", "wandb", etc.
135
+ logger: ["console", "wandb"]
136
+
137
+ # Number of generations to log during validation
138
+ log_val_generations: 0
139
+
140
+ # Directory for logging rollout data; no dump if null
141
+ rollout_data_dir: null
142
+
143
+ # Directory for logging validation data; no dump if null
144
+ validation_data_dir: null
145
+
146
+ # Number of nodes used in the training
147
+ nnodes: 1
148
+
149
+ # Number of GPUs per node
150
+ n_gpus_per_node: 8
151
+
152
+ # Save frequency (by iteration) for model checkpoints
153
+ save_freq: -1
154
+
155
+ # ESI refers to the elastic server instance used during training, similar to the training plan. For example,
156
+ # if you purchase 10 hours of computing power, the ESI will automatically shut down after 10 hours of training.
157
+ # To ensure a checkpoint is saved before ESI shuts down, the system will start saving a checkpoint in advance.
158
+ # The advance time is calculated as: Advance Time = Longest historical step duration + Checkpoint save duration + esi_redundant_time.
159
+ # Here, esi_redundant_time is a user-defined value that further extends the advance time for added safety.
160
+ esi_redundant_time: 0
161
+
162
+ # Resume mode: "auto", "disable", or "resume_path"
163
+ # "auto": resume from last checkpoint if available
164
+ # "disable": start from scratch
165
+ # "resume_path": resume from a user-defined path
166
+ resume_mode: auto
167
+
168
+ # Path to resume training from (only used when resume_mode is "resume_path")
169
+ resume_from_path: null
170
+
171
+ # Whether to run validation before training begins
172
+ val_before_train: True
173
+
174
+ # Whether to run validation only
175
+ val_only: False
176
+
177
+ # Validation frequency (in training iterations)
178
+ test_freq: -1
179
+
180
+ # Number of iterations to warm up the critic before updating policy
181
+ critic_warmup: 0
182
+
183
+ # Default path to distributed filesystem for saving checkpoints
184
+ default_hdfs_dir: null
185
+
186
+ # Whether to delete local checkpoints after loading
187
+ del_local_ckpt_after_load: False
188
+
189
+ # Default local directory for saving checkpoints
190
+ default_local_dir: checkpoints/${trainer.project_name}/${trainer.experiment_name}
191
+
192
+ # Maximum number of actor checkpoints to keep
193
+ max_actor_ckpt_to_keep: null
194
+
195
+ # Maximum number of critic checkpoints to keep
196
+ max_critic_ckpt_to_keep: null
197
+
198
+ # Timeout (in seconds) for Ray worker to wait for registration
199
+ ray_wait_register_center_timeout: 300
200
+
201
+ # Device to run training on (e.g., "cuda", "cpu")
202
+ device: cuda
203
+
204
+ # whether to use legacy worker implementation
205
+ # mode: "auto", "enable", or "disable"
206
+ use_legacy_worker_impl: auto
207
+
208
+ # profiler configs
209
+ global_profiler:
210
+
211
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
212
+ _target_: verl.utils.profiler.ProfilerConfig
213
+
214
+ # Profiling tool: choose between nsys, npu, torch, torch_memory
215
+ tool: null
216
+
217
+ # profile steps
218
+ steps: null
219
+
220
+ # Whether to combine continuous steps into one database.
221
+ ## If True, worker.profiler.discrete must be False, [1,2] in one, [5] in another.
222
+ ## If False, [1] in one, [2] in another, [5] in another.
223
+ profile_continuous_steps: False
224
+
225
+ # Path to save profiling contents
226
+ save_path: "outputs/profile"
227
+
228
+ # Specific tool configs, can use +profiler.tool_config.[tool].xxx to config
229
+ global_tool_config:
230
+
231
+ # nsys config
232
+ nsys:
233
+
234
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
235
+ _target_: verl.utils.profiler.config.NsightToolConfig
236
+
237
+ # True for each task has its own database, False for all tasks in one training step share one database.
238
+ discrete: False
239
+
240
+ # controller Nvidia Nsight Systems Options. Must set when profile_steps is not None.
241
+ ## reference https://docs.nvidia.com/nsight-systems/UserGuide/index.html
242
+ ## reference https://docs.ray.io/en/latest/ray-observability/user-guides/profiling.html
243
+ controller_nsight_options:
244
+
245
+ # Select the API(s) to be traced.
246
+ trace: "cuda,nvtx,cublas,ucx"
247
+
248
+ # Track the GPU memory usage by CUDA kernels. Must be string type "true" or "false".
249
+ cuda-memory-usage: "true"
250
+
251
+ # CUDA graphs will be traced as a whole
252
+ cuda-graph-trace: "graph"
253
+
254
+ # worker Nvidia Nsight Systems Options. Must set when profile_steps is not None.
255
+ worker_nsight_options:
256
+
257
+ # Select the API(s) to be traced.
258
+ trace: "cuda,nvtx,cublas,ucx"
259
+
260
+ # Track the GPU memory usage by CUDA kernels. Must be string type "true" or "false".
261
+ cuda-memory-usage: "true"
262
+
263
+ # CUDA graphs will be traced as a whole
264
+ cuda-graph-trace: "graph"
265
+
266
+ # Profiling only in a range of torch.cuda.profiler.start and stop. Do not change this config.
267
+ capture-range: "cudaProfilerApi"
268
+
269
+ # Specify the desired behavior when a capture range ends.
270
+ # In verl we need the torch.cuda.profiler.start/stop pair to repeats n times.
271
+ # valid values are "repeat-shutdown:n" or null.
272
+ # For normal whole step profiling, n = len(profile_steps);
273
+ # but for discrete profiling, n = len(profile_steps) * Number(subtasks).
274
+ # Or you can just leave it null and the program will use n = len(profile_steps) * 6;
275
+ capture-range-end: null
276
+
277
+ # Send signal to the target application's process group. We let the program to exit by itself.
278
+ kill: none
279
+
280
+ # enable memory visualization for debugging memory usage
281
+ torch_memory:
282
+
283
+ # Maximum number of allocation entries to record
284
+ trace_alloc_max_entries: 100_000
285
+
286
+ # The depth of the call stack to capture for each allocation
287
+ stack_depth: 32
288
+
289
+ # 'alloc': records only allocation events || 'state': records memory state changes || 'all': records both.
290
+ context: "all"
291
+
292
+ # 'python': records Python stacks || 'cpp': records C++ stacks (available in some versions) || 'all': records both.
293
+ stacks: "all"
294
+
295
+ # devices, record_context etc.
296
+ kw_args: {}
297
+
298
+ # configs related to ray
299
+ ray_kwargs:
300
+
301
+ # configs related to ray initialization
302
+ ray_init:
303
+
304
+ # Number of CPUs for Ray. Use a fixed number instead of null when using SLURM.
305
+ num_cpus: null
306
+
307
+ # Path to save Ray timeline JSON for performance profiling
308
+ timeline_json_file: null
e2c/config/ref/dp_ref.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # defaults specify the default config from each component
2
+ defaults:
3
+
4
+ # dp ref config, inheriting from trainer/config/ref/ref.yaml
5
+ - ref
6
+
7
+ # fsdp engine config
8
+ - ../engine@fsdp_config: fsdp
9
+
10
+ # load the reference default config, then apply the fields in the current yaml
11
+ - _self_
12
+
13
+ # ref model is assumed to be identical to actor model. Specify model.path for using a different ref model.
14
+ # Potential use case involves on policy distillation where we calculate KL divergence between student actor
15
+ # and teacher ref
16
+ model: null
17
+
18
+ # sequence parallel size
19
+ # same as actor_rollout_ref.actor.ulysses_sequence_parallel_size if it exists, otherwise 1
20
+ ulysses_sequence_parallel_size: ${oc.select:actor_rollout_ref.actor.ulysses_sequence_parallel_size,1}
21
+
22
+ # calculate entropy with chunking to reduce memory peak
23
+ entropy_from_logits_with_chunking: False
24
+
25
+ # recompute entropy
26
+ entropy_checkpointing: False
e2c/config/ref/megatron_ref.yaml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # megatron ref config, inheriting from trainer/config/ref/ref.yaml
2
+ defaults:
3
+ - ref
4
+
5
+ # megatron engine config
6
+ - ../engine@megatron: megatron
7
+
8
+ # load the reference default config, then apply the fields in the current yaml
9
+ - _self_
10
+
11
+ strategy: megatron
12
+
13
+ megatron:
14
+ _target_: verl.workers.config.MegatronEngineConfig
15
+ seed: ${oc.select:actor_rollout_ref.actor.megatron.seed,42}
16
+ override_transformer_config: ${oc.select:actor_rollout_ref.actor.megatron.override_transformer_config,{}}
17
+ use_mbridge: ${oc.select:actor_rollout_ref.actor.megatron.use_mbridge,False}
18
+
19
+ load_weight: True
e2c/config/ref/ref.yaml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # actor_rollout_ref.ref: FSDP config same as actor. For models larger than 7B, it’s recommended to turn on offload for ref by default
2
+ strategy: ${actor_rollout_ref.actor.strategy}
3
+
4
+ # whether to enable torch.compile
5
+ # same as actor_rollout_ref.actor.use_torch_compile if it exists, otherwise 1
6
+ use_torch_compile: ${oc.select:actor_rollout_ref.actor.use_torch_compile,true}
7
+
8
+ # [Will be deprecated, use log_prob_micro_batch_size_per_gpu]
9
+ # The batch size for one forward pass in the computation of log_prob. Global batch size.
10
+ log_prob_micro_batch_size: null
11
+
12
+ # The batch size for one forward pass in the computation of log_prob. Local batch size per GPU.
13
+ log_prob_micro_batch_size_per_gpu: null
14
+
15
+ # enable dynamic batch size (sequence packing) for log_prob computation
16
+ # same as actor_rollout_ref.actor.use_dynamic_bsz if it exists, otherwise false
17
+ log_prob_use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
18
+
19
+ # the max token length per GPU
20
+ # same as actor_rollout_ref.actor.ppo_max_token_len_per_gpu if it exists, otherwise 16384
21
+ log_prob_max_token_len_per_gpu: ${oc.select:actor_rollout_ref.actor.ppo_max_token_len_per_gpu,16384}
22
+
23
+ # profile the ref model in `compute_log_prob`
24
+ profiler:
25
+
26
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
27
+ _target_: verl.utils.profiler.ProfilerConfig
28
+
29
+ # choices: nsys, npu, torch, torch_memory
30
+ tool: ${oc.select:global_profiler.tool,null}
31
+
32
+ # whether enable profile on Ref
33
+ enable: False
34
+
35
+ # Whether to profile all ranks.
36
+ all_ranks: False
37
+
38
+ # The ranks that will be profiled. [] or [0,1,...]
39
+ ranks: []
40
+
41
+ # profile results saving path
42
+ save_path: ${oc.select:global_profiler.save_path,null}
43
+
44
+ # specific tool config which only related to the role
45
+ tool_config:
46
+
47
+ # nsys tool config
48
+ nsys:
49
+
50
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
51
+ _target_: verl.utils.profiler.config.NsightToolConfig
52
+
53
+ # True for each task has its own database, False for all tasks in one training step share one database.
54
+ discrete: ${oc.select:global_profiler.global_tool_config.nsys.discrete}
55
+
56
+ # npu config
57
+ npu:
58
+
59
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
60
+ _target_: verl.utils.profiler.config.NPUToolConfig
61
+
62
+ # Contents to profile, can be empty
63
+ # options: npu, cpu, memory, shapes, module, stack
64
+ contents: []
65
+
66
+ # Collection level, optional values: level_none, level0, level1, level2.
67
+ level: "level1"
68
+
69
+ # Whether to automatically parse the data.
70
+ analysis: True
71
+
72
+ # True for each task has its own database, False for all tasks in one training step share one database.
73
+ discrete: False
74
+
75
+ # torch profiler config
76
+ torch:
77
+
78
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
79
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
80
+
81
+ # start profile mini-batch in training
82
+ # NOTICE: different with global steps config which refers to iteration
83
+ # This field only related with mini-batch
84
+ step_start: 0
85
+
86
+ # stop profile mini-batch in training
87
+ step_end: null
88
+
89
+ # torch memory profiler config
90
+ torch_memory:
91
+
92
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
93
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
94
+
95
+ # Maximum number of memory allocation entries to track
96
+ trace_alloc_max_entries: ${oc.select:global_profiler.global_tool_config.torch_memory.trace_alloc_max_entries,100000}
97
+
98
+ # Stack trace depth for memory allocations
99
+ stack_depth: ${oc.select:global_profiler.global_tool_config.torch_memory.stack_depth,32}
e2c/config/reward_model/dp_reward_model.yaml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ # defaults specify the default config from each component
8
+ defaults:
9
+
10
+ # dp actor config, inheriting from trainer/config/reward_model/reward_model.yaml
11
+ - reward_model
12
+
13
+ # load the reference default config, then apply the fields in the current yaml
14
+ - _self_
15
+
16
+ strategy: fsdp
17
+
18
+ model:
19
+
20
+ # Whether to use shared memory for loading the model
21
+ use_shm: False
22
+
23
+ # Use remove padding optimization (saves compute)
24
+ use_remove_padding: False
25
+
26
+ # Whether to use fused reward kernels for speedup
27
+ use_fused_kernels: ${actor_rollout_ref.model.use_fused_kernels}
28
+
29
+ # FSDP-specific config
30
+ fsdp_config:
31
+
32
+ # Target configuration dataclass
33
+ _target_: verl.workers.config.FSDPEngineConfig
34
+
35
+ # Policy for wrapping layers with FSDP
36
+ wrap_policy:
37
+
38
+ # Minimum number of parameters to trigger wrapping
39
+ min_num_params: 0
40
+
41
+ # Whether to offload model parameters to CPU
42
+ param_offload: False
43
+
44
+ # Only for FSDP2: Reshard after forward pass to reduce memory footprint
45
+ reshard_after_forward: True
46
+
47
+ # Number of GPUs in each FSDP shard group; -1 means auto
48
+ fsdp_size: -1
49
+
50
+ # Only for FSDP1: FSDP1 configuration, prefetch the next forward-pass all-gather
51
+ # before the current forward computation.
52
+ forward_prefetch: False
53
+
54
+ # Sequence parallelism size for Ulysses-style model parallelism
55
+ ulysses_sequence_parallel_size: 1
e2c/config/reward_model/megatron_reward_model.yaml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # defaults specify the default config from each component
2
+ defaults:
3
+
4
+ # dp actor config, inheriting from trainer/config/reward_model/reward_model.yaml
5
+ - reward_model
6
+
7
+ # load the reference default config, then apply the fields in the current yaml
8
+ - _self_
9
+
10
+ strategy: megatron
11
+
12
+ # seconds, default is 10 minutes for torch, you can set it to a larger value
13
+ # if you have long-running operations like 32B or 72B model using megatron
14
+ nccl_timeout: 600
15
+
16
+ # Megatron parallelism & checkpointing config
17
+ megatron:
18
+
19
+ # Target configuration dataclass
20
+ _target_: verl.workers.config.MegatronEngineConfig
21
+
22
+ # Whether to offload model parameters to CPU
23
+ param_offload: False
24
+
25
+ # Number of GPUs in tensor model parallel group
26
+ tensor_model_parallel_size: 1
27
+
28
+ # Number of GPUs in expert model parallel group
29
+ expert_model_parallel_size: 1
30
+
31
+ # Expert tensor parallel size
32
+ expert_tensor_parallel_size: 1
33
+
34
+ # Number of pipeline model parallel stages
35
+ pipeline_model_parallel_size: 1
36
+
37
+ # change VPP interface for parallelism tests
38
+ virtual_pipeline_model_parallel_size: null
39
+
40
+ # Context parallel size
41
+ context_parallel_size: 1
42
+
43
+ # Whether to use sequence parallelism
44
+ sequence_parallel: True
45
+
46
+ # Whether to use distributed optimizer
47
+ use_distributed_optimizer: False
48
+
49
+ # Whether to enable distributed checkpointing
50
+ use_dist_checkpointing: False
51
+
52
+ # Path for distributed checkpoints
53
+ dist_checkpointing_path: null
54
+
55
+ # RNG seed for megatron
56
+ seed: ${oc.select:actor_rollout_ref.actor.megatron.seed,42}
57
+
58
+ # Any overrides to transformer config
59
+ override_transformer_config: ${oc.select:actor_rollout_ref.actor.megatron.override_transformer_config,{}}
60
+
61
+ # Whether to use mbridge for faster comms
62
+ use_mbridge: ${oc.select:actor_rollout_ref.actor.megatron.use_mbridge,False}
63
+
64
+ # Whether to load weights (default True)
65
+ load_weight: True
e2c/config/reward_model/reward_model.yaml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # configs for the reward model
2
+
3
+ # Whether to enable reward model. If False, we compute the reward only with the user-defined reward functions.
4
+ # In GSM8K and Math examples, we disable reward model.
5
+ # For RLHF alignment example using full_hh_rlhf, we utilize reward model to assess the responses.
6
+ # If False, the following parameters are not effective
7
+ enable: False
8
+
9
+ # Whether to deploy the model to a separate resource pool.
10
+ # If true, n_gpus_per_node & nnodes will be used to determine the resource node.
11
+ enable_resource_pool: False
12
+ n_gpus_per_node: 0
13
+ nnodes: 0
14
+
15
+ # FSDP strategy: "fsdp" or "fsdp2"
16
+ strategy: ???
17
+
18
+ # model config for reward scoring
19
+ model:
20
+
21
+ # Input tokenizer. If the reward model's chat template is inconsistent with the policy,
22
+ # we need to first decode to plaintext, then apply the rm's chat_template.
23
+ # Then score with RM. If chat_templates are consistent, it can be set to null.
24
+ # set this to null if the chat template is identical
25
+ input_tokenizer: ${actor_rollout_ref.model.path}
26
+
27
+ # RM’s HDFS path or local path. Note that RM only supports AutoModelForSequenceClassification.
28
+ # Other model types need to define their own RewardModelWorker and pass it from the code.
29
+ path: ~/models/FsfairX-LLaMA3-RM-v0.1
30
+
31
+ # External model implementation (optional)
32
+ external_lib: ${actor_rollout_ref.model.external_lib}
33
+
34
+ # Whether to enable loading a remote code model, default to False
35
+ trust_remote_code: False
36
+
37
+ # [Deprecated] Global micro batch size
38
+ # will be deprecated, use micro_batch_size_per_gpu
39
+ micro_batch_size: null
40
+
41
+ # Local per-GPU micro batch size
42
+ micro_batch_size_per_gpu: null
43
+
44
+ # Maximum sequence length to process for scoring
45
+ max_length: null
46
+
47
+ # Whether to dynamically adjust batch size at runtime
48
+ use_dynamic_bsz: ${critic.use_dynamic_bsz}
49
+
50
+ # Maximum number of tokens per GPU in one forward pass
51
+ forward_max_token_len_per_gpu: ${critic.forward_max_token_len_per_gpu}
52
+
53
+ # Reward Manager. This defines the mechanism of computing rule-based reward and handling different reward sources.
54
+ # Default is naive. If all verification functions are multiprocessing-safe,
55
+ # the reward manager can be set to prime for parallel verification.
56
+ reward_manager: naive
57
+
58
+ # Whether to launch custom reward function asynchronously during log_prob
59
+ # custom reward function executed async on CPU, during log_prob
60
+ launch_reward_fn_async: False
61
+
62
+ # Cloud/local sandbox fusion configuration for custom reward logic
63
+ sandbox_fusion:
64
+
65
+ # Cloud /local function URL for sandbox execution
66
+ url: null
67
+
68
+ # Max concurrent requests allowed to sandbox
69
+ max_concurrent: 64
70
+
71
+ # Max memory limit for each sandbox process in MB
72
+ memory_limit_mb: 1024
73
+
74
+ # profile the reward model in `compute_reward`
75
+ profiler:
76
+
77
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
78
+ _target_: verl.utils.profiler.ProfilerConfig
79
+
80
+ # profiler tool, default same as profiler.tool in global config
81
+ # choices: nsys, npu, torch
82
+ tool: ${oc.select:global_profiler.tool,null}
83
+
84
+ # whether enable profile on ref
85
+ enable: False
86
+
87
+ # Whether to profile all ranks.
88
+ all_ranks: False
89
+
90
+ # The ranks that will be profiled. [] or [0,1,...]
91
+ ranks: []
92
+
93
+ # profile results saving path
94
+ save_path: ${oc.select:global_profiler.save_path,null}
95
+
96
+ # specific tool config
97
+ tool_config: ${oc.select:actor_rollout_ref.actor.profiler.tool_config,null}
e2c/config/rollout/rollout.yaml ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Target class for this configuration
2
+ _target_: verl.workers.config.RolloutConfig
3
+
4
+ # actor_rollout_ref.rollout.name: hf/vllm/sglang. The default value will be removed in the future
5
+ name: ???
6
+
7
+ # sync: LLM, async: AsyncLLM
8
+ mode: sync
9
+
10
+ # Sampling temperature for rollout.
11
+ temperature: 1.0
12
+
13
+ # Top-k sampling parameter. -1 for vLLM rollout, 0 for HF rollout.
14
+ top_k: -1
15
+
16
+ # Top-p sampling parameter. Default 1.0.
17
+ top_p: 1
18
+
19
+ # typically the same as data max prompt length
20
+ # same as data.max_prompt_length if it exists
21
+ prompt_length: ${oc.select:data.max_prompt_length,512}
22
+
23
+ # typically the same as data max response length
24
+ # same as data.max_response_length if it exists
25
+ response_length: ${oc.select:data.max_response_length,512}
26
+
27
+ # for vllm rollout
28
+ # Rollout model parameters type. Align with actor model's FSDP/Megatron type.
29
+ dtype: bfloat16
30
+
31
+ # Fraction of GPU memory used by vLLM/SGLang for KV cache.
32
+ gpu_memory_utilization: 0.5
33
+
34
+ # Whether to ignore EOS and continue generating after EOS is hit.
35
+ ignore_eos: False
36
+
37
+ # Whether to disable CUDA graph. Default False to best performance.
38
+ enforce_eager: False
39
+
40
+ # batch size of cudagraph to capture. Require enforce_eager: False to use this option
41
+ # Since cudagraph in inference engine can not be offloaded during update policy,
42
+ # you can use smaller batch size to save memory used in cuda graph, eg: [1 ,2, 4, 8, 16, 32]
43
+ # supported engines: vllm
44
+ cudagraph_capture_sizes: null
45
+
46
+ # Whether to free engine KVCache after generation.
47
+ free_cache_engine: True
48
+
49
+ # TP size for rollout. Not effective for hf
50
+ tensor_model_parallel_size: 2
51
+
52
+ # DP size for rollout
53
+ data_parallel_size: 1
54
+
55
+ # EP size for rollout
56
+ expert_parallel_size: 1
57
+
58
+ # max number of tokens in a batch
59
+ max_num_batched_tokens: 8192
60
+
61
+ # max length for rollout
62
+ max_model_len: null
63
+
64
+ # max length of sequences
65
+ max_num_seqs: 1024
66
+
67
+ # may get higher throughput when set to True. When activated, Please increase max_num_batched_tokens or decrease max_model_len.
68
+ enable_chunked_prefill: True
69
+
70
+ # Prefix caching kv-cache blocks is a popular optimization in LLM inference to avoid redundant prompt computations.
71
+ enable_prefix_caching: True
72
+
73
+ # Which loader to use for rollout model weights: dummy, hf, megatron, etc.
74
+ # safetensors (for huge model, and set use_shm=True); dummy: randomly init model weight
75
+ load_format: dummy
76
+
77
+ # [Will be deprecated, use log_prob_micro_batch_size_per_gpu] The batch size for one forward pass in the computation of log_prob. Global batch size.
78
+ log_prob_micro_batch_size: null
79
+
80
+ # The batch size for one forward pass in the computation of log_prob. Local batch size per GPU.
81
+ log_prob_micro_batch_size_per_gpu: null
82
+
83
+ # enable dynamic batch size (sequence packing) for log_prob computation
84
+ # same as actor_rollout_ref.actor.use_dynamic_bsz if it exists, otherwise false
85
+ log_prob_use_dynamic_bsz: ${oc.select:actor_rollout_ref.actor.use_dynamic_bsz,false}
86
+
87
+ # max token length for log_prob computation
88
+ # same as actor_rollout_ref.actor.ppo_max_token_len_per_gpu if it exists, otherwise 16384
89
+ log_prob_max_token_len_per_gpu: ${oc.select:actor_rollout_ref.actor.ppo_max_token_len_per_gpu,16384}
90
+
91
+ # disable logging statistics
92
+ disable_log_stats: True
93
+
94
+ # for hf rollout
95
+ # Whether to sample during training rollout. False uses greedy sampling.
96
+ do_sample: True
97
+
98
+ # number of responses (i.e. num sample times). > 1 for grpo
99
+ n: 1
100
+
101
+ # The over_sample_rate parameter controls the early termination threshold for training rollouts,
102
+ # where the system will abort remaining requests when (1 - over_sample_rate) * total_requests completions are reached.
103
+ over_sample_rate: 0
104
+
105
+ # Whether to wake up inference engine in multi-stage for SGLang
106
+ # to reduce peak memory during training-rollout transition.
107
+ # This is only effective for SGLang rollout.
108
+ multi_stage_wake_up: false
109
+
110
+ # Extra inference engine arguments (vllm, sglang), please refer vllm/sglang official doc for detail
111
+ engine_kwargs:
112
+
113
+ # vllm engine config
114
+ vllm: {}
115
+
116
+ # sglang engine config
117
+ sglang: {}
118
+
119
+ # Sampling parameters used during validation.
120
+ val_kwargs:
121
+
122
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
123
+ _target_: verl.workers.config.SamplingConfig
124
+
125
+ # sampling parameters for validation
126
+ # Top-k sampling parameter. -1 for vLLM rollout, 0 for HF rollout.
127
+ top_k: -1
128
+
129
+ # Top-p sampling parameter. Default 1.0.
130
+ top_p: 1.0
131
+
132
+ # Sampling temperature for rollout.
133
+ temperature: 0
134
+
135
+ # whether to repeat n times for validation
136
+ n: 1
137
+
138
+ # Whether to sample during training rollout. False uses greedy sampling.
139
+ do_sample: False
140
+
141
+ # Multi-turn interaction config for tools or chat.
142
+ multi_turn:
143
+
144
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
145
+ _target_: verl.workers.config.MultiTurnConfig
146
+
147
+ # set to True for multi-turn tool interaction tasks; should set rollout.name to sglang as well
148
+ enable: False
149
+
150
+ # null for no limit (default max_length // 3)
151
+ max_assistant_turns: null
152
+
153
+ # null for no tool
154
+ tool_config_path: null
155
+
156
+ # null for no limit (default max_length // 3)
157
+ max_user_turns: null
158
+
159
+ # max parallel call for tools in single turn
160
+ max_parallel_calls: 1
161
+
162
+ # max length of tool response
163
+ max_tool_response_length: 256
164
+
165
+ # truncate side of tool response: left, middle, right
166
+ tool_response_truncate_side: middle
167
+
168
+ # null for no interaction
169
+ interaction_config_path: null
170
+
171
+ # - When set to True, the model's default chat template is used for multi-turn rollout, which typically matches production behavior.
172
+ # - When set to False, the token ids recorded for training are used instead; unlike the default chat template, these always include the model's full output,
173
+ # which may contain additional content such as reasoning content. This maintains the consistency between training and rollout, but it will lead to longer prompts.
174
+ use_inference_chat_template: False
175
+
176
+ # Tokenization is performed turn by turn and the resulting token ids are concatenated to form the full conversation.
177
+ # To ensure this matches the result of tokenizing the entire conversation at once, a sanity check is run at the end of each multi-turn rollout to compare the two sets of token ids.
178
+ # Some models are known to produce different tokenization results when tokenizing turn by turn vs. all at once. aThis behavior has already been validated for them.
179
+ # To reduce excessive warnings, you can turn off the sanity check for these models if you are using their default chat template:
180
+ # Qwen/QwQ-32B, Qwen/Qwen3-xxB
181
+ # - disable: disable tokenization sanity check
182
+ # - strict: enable strict tokenization sanity check (default)
183
+ # - ignore_strippable: ignore strippable tokens when checking tokenization sanity
184
+ tokenization_sanity_check_mode: strict
185
+
186
+ # Format of the multi-turn interaction. Options: hermes, llama3_json, ...
187
+ format: hermes
188
+
189
+ # Number of repeat rollouts for each interaction
190
+ num_repeat_rollouts: null
191
+
192
+ # support logging rollout prob for debugging purpose
193
+ # "Truncated importance sampling" requires rollout log probs, set to True when turning on Truncated importance sampling
194
+ calculate_log_probs: False
195
+
196
+ # [Experimental] agent loop based rollout configs
197
+ agent:
198
+
199
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
200
+ _target_: verl.workers.config.AgentLoopConfig
201
+
202
+ # Number of agent loop workers
203
+ num_workers: 8
204
+
205
+ # custom agent loop config path, which should contain list of configs to intialize AgentLoop instances.
206
+ # https://hydra.cc/docs/advanced/instantiate_objects/overview/
207
+ #
208
+ # - name: react_agent
209
+ # _target_: recipe.langgraph_agent.react_agent_loop.ReactAgentLoop
210
+ # tools: ["get_current_temperature"]
211
+ # - name: math_expression
212
+ # _target_: recipe.langgraph_agent.example.math_expression.MathExpressionReactAgentLoop
213
+ # min_terms: 2
214
+ # max_terms: 6
215
+ agent_loop_config_path: null
216
+
217
+ # custom async server configs
218
+ custom_async_server:
219
+
220
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
221
+ _target_: verl.workers.config.CustomAsyncServerConfig
222
+
223
+ # Path to the custom async server implementation
224
+ path: null
225
+
226
+ # Class name of the custom async server class (e.g. AsyncvLLMServer)
227
+ name: null
228
+
229
+ # Specifies the tensor bucket size (in megabytes) for batch weight updates during rollout operations.
230
+ # This parameter controls the maximum payload size for a single weight update request.
231
+ # Reference: https://github.com/volcengine/verl/pull/2418
232
+ # Currently only supported in SGLang rollout implementations
233
+ # Larger values may improve throughput but increase memory overhead
234
+ # Detailed performance comparison:
235
+ # https://github.com/zhaochenyang20/Awesome-ML-SYS-Tutorial/issues/169#issuecomment-3070686720
236
+ # Default value (512MB) is optimized for typical GPU memory configurations
237
+ # For the best performance of `rebuild_cuda_tensor`, it is recommended to:
238
+ # 1. Enable `RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES`
239
+ # 2. Manually set `CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7`
240
+ # when using Tensor Parallelism (TP) >= 8.
241
+ update_weights_bucket_megabytes: 512
242
+
243
+ # trace rollout data
244
+ trace:
245
+
246
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
247
+ _target_: verl.workers.config.TraceConfig
248
+
249
+ # trace backend, support mlflow, weave
250
+ backend: null
251
+
252
+ # whether translate token id to text in output
253
+ token2text: False
254
+
255
+ # When enabled (True), the trainer will attempt to load previously generated rollout data from the specified directory instead of computing new rollouts.
256
+ # If no cached data is found or loading fails, new rollouts will be generated and automatically saved.
257
+ # This feature is useful for debugging or when you want to reuse computation results across multiple runs.
258
+ skip_rollout: False
259
+
260
+ # Specifies the filesystem path where rollout data should be cached when skip_rollout is enabled.
261
+ # Note: Giving path under /tmp/ray/session* is not recommended as these are temporary Ray cluster directories.
262
+ skip_dump_dir: /tmp/rollout_dump
263
+
264
+ # Whether to skip tokenizer initialization for rollout engine
265
+ # When enabled (True), the rollout assume token in token out for generation
266
+ skip_tokenizer_init: True
267
+
268
+ # profile the rollout model in `generate_sequence`
269
+ profiler:
270
+
271
+ # Required when using verl.utils.omega_conf_to_dataclass to instantiate dataclass configs
272
+ _target_: verl.utils.profiler.ProfilerConfig
273
+
274
+ # profiler tool, default same as profiler.tool in global config
275
+ # choices: nsys, npu, torch
276
+ tool: ${oc.select:global_profiler.tool,null}
277
+
278
+ # whether enable profile on ref
279
+ enable: ${oc.select:actor_rollout_ref.actor.profiler.enable,false}
280
+
281
+ # Whether to profile all ranks.
282
+ all_ranks: ${oc.select:actor_rollout_ref.actor.profiler.all_ranks,false}
283
+
284
+ # The ranks that will be profiled. [] or [0,1,...]
285
+ ranks: ${oc.select:actor_rollout_ref.actor.profiler.ranks,[]}
286
+
287
+ # profile results saving path
288
+ save_path: ${oc.select:global_profiler.save_path,null}
289
+
290
+ # specific tool config
291
+ tool_config: ${oc.select:actor_rollout_ref.actor.profiler.tool_config,null}
e2c/config/sft_trainer.yaml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ data:
2
+ train_batch_size: 160
3
+ micro_batch_size: null
4
+ micro_batch_size_per_gpu: 20
5
+ train_files: ./data/e2c-sft-train.parquet
6
+ val_files: ./data/e2c-sft-val.parquet
7
+ prompt_key: question
8
+ response_key: solution
9
+ prompt_dict_keys: null
10
+ response_dict_keys: null
11
+ multiturn:
12
+ enable: false
13
+ messages_key: messages
14
+ tools_key: tools
15
+ enable_thinking_key: enable_thinking
16
+ max_length: 1000
17
+ truncation: right
18
+ balance_dp_token: false
19
+ chat_template: null
20
+ custom_cls:
21
+ path: null
22
+ name: null
23
+ use_shm: false
24
+ apply_chat_template_kwargs: {}
25
+ model:
26
+ partial_pretrain: "Path to the pretrained model"
27
+ use_shm: false
28
+ fsdp_config:
29
+ model_dtype: bf16
30
+ wrap_policy:
31
+ min_num_params: 0
32
+ cpu_offload: false
33
+ offload_params: false
34
+ external_lib: null
35
+ enable_gradient_checkpointing: true
36
+ trust_remote_code: false
37
+ lora_rank: -1
38
+ lora_alpha: 16
39
+ target_modules: all-linear
40
+ use_liger: false
41
+ strategy: fsdp2
42
+ optim:
43
+ lr: 1.0e-05
44
+ betas:
45
+ - 0.9
46
+ - 0.95
47
+ weight_decay: 0.01
48
+ warmup_steps_ratio: 0.1
49
+ clip_grad: 1.0
50
+ lr_scheduler: cosine
51
+ ulysses_sequence_parallel_size: 1
52
+ use_remove_padding: false
53
+ trainer:
54
+ base_dir: ./training
55
+ default_local_dir: ./${trainer.base_dir}/${trainer.project_name}/${trainer.experiment_name}
56
+ default_hdfs_dir: null
57
+ project_name: e2c-sft
58
+ experiment_name: run1
59
+ total_epochs: 3
60
+ total_training_steps: null
61
+ logger:
62
+ - console
63
+ seed: 114514
64
+ save_freq: 100
65
+ test_freq: -1
66
+ kl_coeff: 0
67
+ nnodes: 1
68
+ n_gpus_per_node: 8
69
+ max_ckpt_to_keep: null
70
+ resume_mode: auto
71
+ resume_from_path: null
72
+ checkpoint:
73
+ save_contents:
74
+ - model
75
+ - optimizer
76
+ - extra
77
+ - hf_model
78
+ load_contents:
79
+ - model
80
+ - optimizer
81
+ - extra
82
+ device: cuda
83
+ global_step: 0
e2c/config/sft_trainer_engine.yaml ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Format checks enforced on CI:
2
+ # 1. Comments must appear above each field.
3
+ # 2. There must be a blank line between each field.
4
+ # 3. Inline comments (after a field on the same line) are not allowed.
5
+ # 4. Indentation level is respected for nested fields.
6
+
7
+ # <folder_name>@<field_name>.<field_name>: <yaml_file_name>
8
+
9
+ defaults:
10
+ - model@model: hf_model
11
+ - engine@engine: fsdp
12
+ - optim@optim: fsdp
13
+ - _self_
14
+
15
+ data:
16
+ train_batch_size: 256 # global batch size
17
+ micro_batch_size_per_gpu: 4 # this is also val batch size
18
+ max_token_len_per_gpu: 8192
19
+ use_dynamic_bsz: True
20
+ train_files: ~/data/gsm8k/train.parquet
21
+ val_files: ~/data/gsm8k/test.parquet
22
+ # Multi-turn settings
23
+ messages_key: messages # Key for messages list in multi-turn mode
24
+ tools_key: tools # Key for tools list in multi-turn mode
25
+ enable_thinking_key: enable_thinking # Whether to enable thinking in multi-turn mode
26
+ pad_mode: left_right
27
+ # for right padding
28
+ max_length: 1024
29
+ # for left right padding
30
+ max_prompt_length: 512
31
+ max_response_length: 512
32
+ truncation: error
33
+ balance_dp_token: False # to be implement
34
+ custom_cls:
35
+ path: null
36
+ name: null
37
+ use_shm: False
38
+ apply_chat_template_kwargs: {}
39
+
40
+ # Checkpoint configuration
41
+ checkpoint:
42
+ _target_: verl.trainer.config.CheckpointConfig
43
+ # What to include in saved checkpoints
44
+ # with 'hf_model' you can save whole model as hf format, now only use sharded model checkpoint to save space
45
+ save_contents: ["model", "optimizer", "extra"]
46
+
47
+ # For more flexibility, you can specify the contents to load from the checkpoint.
48
+ load_contents: ${checkpoint.save_contents}
49
+
50
+ trainer:
51
+ default_local_dir: checkpoints/${trainer.project_name}/${trainer.experiment_name}
52
+ default_hdfs_dir: null
53
+ project_name: gsm8k-sft
54
+ experiment_name: test
55
+ total_epochs: 4
56
+ total_training_steps: null
57
+ logger: [ 'console', 'wandb' ]
58
+ seed: 1
59
+ save_freq: -1
60
+ test_freq: -1
61
+ max_ckpt_to_keep: null # Maximum number of checkpoints to keep, set to null to keep all
62
+
63
+ # Resume mode: "auto", "disable", or "resume_path"
64
+ # "auto": resume from last checkpoint if available
65
+ # "disable": start from scratch
66
+ # "resume_path": resume from a user-defined path
67
+ resume_mode: auto
68
+
69
+ # Path to resume training from (used when resume_mode is "resume_path" or "auto")
70
+ resume_from_path: null
71
+ device: cuda
e2c/data/README.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ The Datas
2
+ Please download the benchmark datasets from the following links:
3
+ and put the evaluation data in data/eval
4
+
5
+ Please download the training datasets from:
6
+ and put the training data in data/train
e2c/rl/e2c_rl.sh ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Tested successfully on the hiyouga/verl:ngc-th2.6.0-cu126-vllm0.8.4-flashinfer0.2.2-cxx11abi0 image.
2
+ # It outperforms the Qwen2 7B base model by two percentage points on the test set of GSM8K.
3
+ # ray start --head --port=6379 --num-gpus=4
4
+ ray start --head --port=6379 --num-gpus=8
5
+ CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
6
+ CUDA_NUM=8
7
+ MASTER_PORT=12345
8
+ MODEL_PATH="Path to the pretrained model"
9
+ base_dir="./training"
10
+ total_epochs=2
11
+ train_file=./data/e2c-rl-train.parquet
12
+ val_file=./data/e2c-rl-val.parquet
13
+ adv_coeff=2.0
14
+ project_name=E2C-RL
15
+ experiment_name=run1
16
+ set -x
17
+ # ROLL_TEMP=1.3
18
+ python3 -m verl.trainer.main_ppo \
19
+ --config-path ./config --config-name ppo_trainer.yaml \
20
+ algorithm.adv_estimator=grpo \
21
+ data.train_files="/home/fit/alex/Kaisen.Yang/CoT Decomposition/dataset/dapo/dapo-diverse.parquet" \
22
+ data.val_files="/home/fit/alex/Kaisen.Yang/CoT Decomposition/dataset/dapo/qwen-rl-valid.parquet" \
23
+ data.train_batch_size=256 \
24
+ data.question_suffix="" \
25
+ data.solution_prefix="'<EXPLORATION>'" \
26
+ data.max_prompt_length=712 \
27
+ data.max_response_length=8192 \
28
+ data.filter_overlong_prompts=True \
29
+ data.truncation='error' \
30
+ reward_model.use_constrain_reward=True \
31
+ actor_rollout_ref.model.path="/WORK/fit/alex/Kaisen/checkpoints/qwen/combine/global_step_500/huggingface" \
32
+ actor_rollout_ref.actor.optim.lr=1e-6 \
33
+ actor_rollout_ref.model.use_remove_padding=True \
34
+ actor_rollout_ref.actor.ppo_mini_batch_size=32 \
35
+ actor_rollout_ref.actor.ppo_max_token_len_per_gpu=14000 \
36
+ actor_rollout_ref.actor.use_dynamic_bsz=True \
37
+ actor_rollout_ref.ref.log_prob_use_dynamic_bsz=True \
38
+ actor_rollout_ref.rollout.log_prob_use_dynamic_bsz=True \
39
+ actor_rollout_ref.actor.use_dynamic_bsz=True \
40
+ actor_rollout_ref.actor.use_kl_loss=True \
41
+ actor_rollout_ref.actor.kl_loss_coef=0 \
42
+ actor_rollout_ref.actor.kl_loss_type=low_var_kl \
43
+ actor_rollout_ref.actor.entropy_coeff=0 \
44
+ actor_rollout_ref.actor.adv_coeff=$adv_coeff \
45
+ actor_rollout_ref.actor.log_part_entropy=True \
46
+ actor_rollout_ref.model.enable_gradient_checkpointing=True \
47
+ actor_rollout_ref.actor.fsdp_config.param_offload=False \
48
+ actor_rollout_ref.actor.fsdp_config.optimizer_offload=False \
49
+ actor_rollout_ref.rollout.tensor_model_parallel_size=1 \
50
+ actor_rollout_ref.rollout.name=vllm \
51
+ actor_rollout_ref.rollout.temperature=1.0 \
52
+ actor_rollout_ref.rollout.gpu_memory_utilization=0.85 \
53
+ actor_rollout_ref.rollout.n=8 \
54
+ actor_rollout_ref.ref.fsdp_config.param_offload=True \
55
+ algorithm.use_kl_in_reward=False \
56
+ trainer.critic_warmup=0 \
57
+ trainer.logger='["console"]' \
58
+ trainer.project_name=$project_name \
59
+ trainer.experiment_name=$experiment_name \
60
+ actor_rollout_ref.rollout.val_kwargs.n=1 \
61
+ trainer.n_gpus_per_node=8 \
62
+ trainer.nnodes=1 \
63
+ trainer.save_freq=30 \
64
+ trainer.test_freq=10 \
65
+ reward_model.reward_manager=dapo \
66
+ +reward_model.reward_kwargs.overlong_buffer_cfg.enable=True \
67
+ +reward_model.reward_kwargs.overlong_buffer_cfg.len=4096 \
68
+ +reward_model.reward_kwargs.overlong_buffer_cfg.penalty_factor=1.0 \
69
+ +reward_model.reward_kwargs.overlong_buffer_cfg.log=False \
70
+ +reward_model.reward_kwargs.max_resp_len=8192 \
71
+ trainer.total_epochs=3 $@
72
+
73
+ # change rl_qwen
74
+ # change naive for decoding
75
+ # change rl_dataset for loading
76
+
77
+
78
+ # temp sample epoch fix
e2c/sft/e2c_sft.sh ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export train_file=./data/e2c-sft-train.parquet
2
+ export val_file=./data/e2c-sft-val.parquet
3
+ export CUDA_VISIBLE_DEVICES=0,1,2,3
4
+ export CUDA_NUM=4
5
+ export MASTER_PORT=12345
6
+ export MODEL_PATH="Path to the pretrained model"
7
+ export base_dir=""
8
+ # 1000 iter is enough
9
+ export total_training_steps=1000
10
+ torchrun --nproc_per_node $CUDA_NUM ".\verl\verl\trainer\fsdp_sft_trainer.py" --config-path config --config-name sft_trainer.yaml \
11
+ model.partial_pretrain=$MODEL_PATH \
12
+ data.train_files=$train_file \
13
+ data.val_files=$val_file \
14
+ trainer.project_name=e2c-sft \
15
+ trainer.experiment_name=run1 \
16
+ trainer.base_dir=$base_dir \
17
+ trainer.total_training_steps=$total_training_steps \
18
+ trainer.n_gpus_per_node=$CUDA_NUM \
e2c/sft/ef-sft.sh ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export train_file=./data/ef-sft-train.parquet
2
+ export val_file=./data/ef-sft-val.parquet
3
+ export CUDA_VISIBLE_DEVICES=0,1,2,3
4
+ export CUDA_NUM=4
5
+ export MASTER_PORT=12345
6
+ export MODEL_PATH="Path to the pretrained model"
7
+ export base_dir=""
8
+ # 500 iter is enough
9
+ export total_training_steps=500
10
+ torchrun --nproc_per_node $CUDA_NUM ".\verl\verl\trainer\fsdp_sft_trainer.py" --config-path config --config-name sft_trainer.yaml \
11
+ model.partial_pretrain=$MODEL_PATH \
12
+ data.train_files=$train_file \
13
+ data.val_files=$val_file \
14
+ trainer.project_name=e2c-sft \
15
+ trainer.experiment_name=run1 \
16
+ trainer.base_dir=$base_dir \
17
+ trainer.total_training_steps=$total_training_steps \
18
+ trainer.n_gpus_per_node=$CUDA_NUM \