-
Notifications
You must be signed in to change notification settings - Fork 311
Expand file tree
/
Copy pathagentic_val_sokoban_lora.yaml
More file actions
170 lines (150 loc) · 4.93 KB
/
Copy pathagentic_val_sokoban_lora.yaml
File metadata and controls
170 lines (150 loc) · 4.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
defaults:
- ../config/traj_envs@_here_
- ../config/deepspeed_zero@_here_
- ../config/deepspeed_zero2@_here_
- ../config/deepspeed_zero3@_here_
- ../config/deepspeed_zero3_cpuoffload@_here_
hydra:
run:
dir: .
output_subdir: null
exp_name: "agentic_pipeline"
seed: 42
logging_dir: ./output/logs
output_dir: ./output
render_save_dir: ./output/render
system_envs:
USE_MODELSCOPE: '1'
#track_with: wandb
#tracker_kwargs:
# api_key:
# project: roll-agentic
# name: ${exp_name}_sokoban
# notes: "agentic_pipeline"
# tags:
# - agentic
# - roll
# - baseline
track_with: stdout # Disable TensorBoard in smoke run to bypass SummaryWriter type constraints.
tracker_kwargs:
log_dir: ./output/tensorboard/agentic_sokoban_lora_smoke # Use local path so smoke test does not depend on external mount.
checkpoint_config:
type: file_system
output_dir: /tmp/roll_output/agentic_sokoban_lora_smoke # Keep checkpoint path local for a portable smoke run.
num_gpus_per_node: 4 # Fit smoke test to a 4-GPU node.
max_steps: 3 # Minimal training smoke: one training step is enough to verify end-to-end path.
save_steps: 10000
logging_steps: 1
eval_steps: 0 # Disable eval loop for faster smoke validation.
resume_from_checkpoint: false
async_generation_ratio: 1 # Required by partial_gpu_mode validation in agentic_pipeline.
rollout_batch_size: 4 # Keep rollout tiny to reduce runtime/memory.
val_batch_size: 4
sequence_length: 2048 # Reduce memory pressure while preserving normal train path.
advantage_clip: 0.2
ppo_epochs: 1
adv_estimator: "grpo"
#pg_clip: 0.1
#dual_clip_loss: True
init_kl_coef: 0.0
whiten_advantages: true
entropy_loss_coef: 0
max_grad_norm: 1.0
pretrain: Qwen/Qwen2.5-0.5B-Instruct
reward_pretrain: Qwen/Qwen2.5-0.5B-Instruct
actor_train:
model_args:
attn_implementation: fa2
disable_gradient_checkpointing: false
dtype: bf16
model_type: ~
lora_target: all-linear
lora_rank: 32
lora_alpha: 32
training_args:
learning_rate: 2.0e-5
weight_decay: 0
per_device_train_batch_size: 1 # Minimal micro-batch for smoke stability.
gradient_accumulation_steps: 2
warmup_steps: 1
lr_scheduler_type: cosine
data_args:
template: qwen2_5
strategy_args:
# strategy_name: deepspeed_train
# strategy_config: ${deepspeed_zero3}
strategy_name: megatron_train
strategy_config:
tensor_model_parallel_size: 1
pipeline_model_parallel_size: 1
expert_model_parallel_size: 1
use_distributed_optimizer: true
recompute_granularity: full
device_mapping: list(range(0,2)) # Constrain actor_train to 4 GPUs for this smoke profile.
infer_batch_size: 2
actor_infer:
model_args:
disable_gradient_checkpointing: true
dtype: bf16
lora_target: q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj
lora_rank: 32
lora_alpha: 32
generating_args:
max_new_tokens: 64 # Shorter generation keeps smoke test fast.
top_p: 1
top_k: 3
num_beams: 1
temperature: 0.0
num_return_sequences: 1
data_args:
template: qwen2_5
strategy_args:
strategy_name: vllm
strategy_config:
gpu_memory_utilization: 0.8
block_size: 16
load_format: auto
device_mapping: list(range(0,4)) # Constrain actor_infer to same 4-GPU pool.
reference:
model_args:
attn_implementation: fa2
disable_gradient_checkpointing: true
dtype: bf16
model_type: ~
data_args:
template: qwen2_5
strategy_args:
strategy_name: hf_infer
strategy_config: ~
device_mapping: list(range(0,2)) # Keep reference mapping consistent with 4-GPU smoke topology.
infer_batch_size: 2
reward_normalization:
grouping: traj_group_id # 可以tags(env_type)/traj_group_id(group)/batch(rollout_batch)... group_by计算reward/adv
method: mean_std # asym_clip / identity / mean_std
train_env_manager:
format_penalty: -0.15 # sokoban env penalty_for_step=-0.1
max_env_num_per_worker: 4 # Smaller env fanout for quick smoke startup.
num_env_groups: 2
# under the same group, the env config and env seed are ensured to be equal
group_size: 2
tags: [SimpleSokoban]
num_groups_partition: [2] # Match reduced group count for smoke.
val_env_manager:
max_env_num_per_worker: 4 # Keep validation manager light even though eval is disabled.
num_env_groups: 4
group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
tags: [SimpleSokoban, LargerSokoban, SokobanDifferentGridVocab, FrozenLake]
num_groups_partition: [1, 1, 1, 1] # Minimal partitioning for smoke.
# Here, you can override variables defined in the imported envs. max_tokens_per_step: 128 in custom_env.SimpleSokoban, here replaced by 64
max_tokens_per_step: 64
custom_envs:
SimpleSokoban:
${custom_env.SimpleSokoban}
LargerSokoban:
${custom_env.LargerSokoban}
SokobanDifferentGridVocab:
${custom_env.SokobanDifferentGridVocab}
FrozenLake:
${custom_env.FrozenLake}
FrozenLakeThink:
${custom_env.FrozenLakeThink}