Skip to content

Commit 1e6c66d

Browse files
committed
(fix): update demo yaml configs
1 parent 895e73f commit 1e6c66d

2 files changed

Lines changed: 63 additions & 129 deletions

File tree

examples/agentic_demo/agent_val_frozen_lake_multi_nodes_demo.yaml

Lines changed: 32 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
defaults:
2-
- ../config/envs@_here_
2+
- ../config/traj_envs@_here_
33
- ../config/deepspeed_zero@_here_
44
- ../config/deepspeed_zero2@_here_
55
- ../config/deepspeed_zero3@_here_
@@ -14,7 +14,7 @@ exp_name: "agentic_pipeline"
1414
seed: 42
1515
logging_dir: ./output/logs
1616
output_dir: ./output
17-
render_save_dir: /data/oss_bucket_0/yali/output/render
17+
render_save_dir: ./output/render
1818
system_envs:
1919
USE_MODELSCOPE: '1'
2020

@@ -29,10 +29,13 @@ system_envs:
2929
# - roll
3030
# - baseline
3131

32-
3332
track_with: tensorboard
3433
tracker_kwargs:
35-
log_dir: /data/oss_bucket_0/yali/llm/tensorboard/roll_exp/agentic_sokoban
34+
log_dir: /data/tensorboard/roll_exp/agentic_frozen_lake
35+
36+
checkpoint_config:
37+
type: file_system
38+
output_dir: /data/cpfs_0/rl_examples/models/${exp_name}
3639

3740
num_gpus_per_node: 2
3841

@@ -46,15 +49,15 @@ rollout_batch_size: 64
4649
val_batch_size: 16
4750
sequence_length: 4096
4851

49-
reward_clip: 20
50-
advantage_clip: 10.0
52+
advantage_clip: 0.2
5153
ppo_epochs: 1
52-
adv_estimator: "reinforce"
54+
adv_estimator: "grpo"
5355
#pg_clip: 0.1
5456
#dual_clip_loss: True
5557
init_kl_coef: 0.0
5658
whiten_advantages: true
5759
entropy_loss_coef: 0
60+
max_grad_norm: 1.0
5861

5962
pretrain: Qwen/Qwen2.5-0.5B-Instruct
6063
reward_pretrain: Qwen/Qwen2.5-0.5B-Instruct
@@ -71,6 +74,7 @@ actor_train:
7174
per_device_train_batch_size: 1
7275
gradient_accumulation_steps: 16
7376
warmup_steps: 10
77+
lr_scheduler_type: cosine
7478
data_args:
7579
template: qwen2_5
7680
strategy_args:
@@ -123,71 +127,34 @@ reference:
123127
device_mapping: list(range(0,4))
124128
infer_batch_size: 1
125129

126-
enable_response_mask: True
127-
action_sep: "||"
128-
use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
129-
enable_think: False # False -> no think RL
130-
max_actions_per_traj: 10
131130
reward_normalization:
132131
grouping: tags # 可以tags(env_type)/traj_group_id(group)/batch(rollout_batch)... group_by计算reward/adv
133132
method: identity # asym_clip / identity / mean_std
134133

135-
custom_envs:
136-
SimpleSokoban:
137-
env_type: sokoban
138-
max_actions_per_traj: ${max_actions_per_traj} # used in environment state manager to control the actual max actions executed per trajectory
139-
max_steps_per_traj: ${max_actions_per_traj}
140-
env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer must be one of action in a turn, format is <answer>Right</answer>"
141-
max_tokens: 100 # used to curate llm prompt "max words", not used for rollout
142-
env_config: # keys should be a subset of SokobanConfig
143-
dim_x: 6
144-
dim_y: 6
145-
num_boxes: 1
146-
max_steps: ${max_actions_per_traj}
147-
LargerSokoban:
148-
env_type: sokoban
149-
max_actions_per_traj: ${max_actions_per_traj}
150-
max_steps_per_traj: ${max_actions_per_traj}
151-
env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer must be one of action in a turn, format is <answer>Right</answer>"
152-
max_tokens: 100
153-
env_config:
154-
dim_x: 8
155-
dim_y: 8
156-
num_boxes: 2
157-
max_steps: ${max_actions_per_traj}
158-
search_depth: 10
159-
SokobanDifferentGridVocab:
160-
env_type: sokoban
161-
max_actions_per_traj: ${max_actions_per_traj}
162-
max_steps_per_traj: ${max_actions_per_traj}
163-
env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer must be one of action in a turn, format is <answer>Right</answer>"
164-
max_tokens: 100
165-
env_config: # keys should be a subset of SokobanConfig
166-
search_depth: 30
167-
dim_x: 6
168-
dim_y: 6
169-
num_boxes: 1
170-
max_steps: ${max_actions_per_traj}
171-
grid_lookup: { 0: "W", 1: ".", 2: "G", 3: "C", 4: "B", 5: "A", 6: "@" }
172-
grid_vocab: { "W": "wall", ".": "empty", "G": "target", "C": "box on target", "B": "box", "A": "player", "@": "player on target" }
173-
FrozenLake:
174-
env_type: frozen_lake
175-
max_actions_per_traj: ${max_actions_per_traj}
176-
max_steps_per_traj: ${max_actions_per_traj}
177-
env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. The answer must be one of action in a turn, format is <answer>Right</answer>"
178-
max_tokens: 100
179-
env_config:
180-
is_slippery: false
181-
182134
train_env_manager:
183-
format_penalty: -0.001
184-
env_groups: 1
135+
format_penalty: -0.15 # sokoban env penalty_for_step=-0.1
136+
max_env_num_per_worker: 16
137+
num_env_groups: 1
138+
# under the same group, the env config and env seed are ensured to be equal
185139
group_size: 1
186140
tags: [FrozenLake]
187-
n_groups: [1] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
141+
num_groups_partition: [1] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
188142

189143
val_env_manager:
190-
env_groups: 2
144+
max_env_num_per_worker: 1
145+
num_env_groups: 2
191146
group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
192-
tags: [SimpleSokoban, FrozenLake]
193-
n_groups: [1, 1] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
147+
tags: [SimpleSokoban, LargerSokoban]
148+
num_groups_partition: [1, 1] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
149+
150+
max_tokens_per_step: 64
151+
152+
custom_envs:
153+
SimpleSokoban:
154+
${custom_env.SimpleSokoban}
155+
LargerSokoban:
156+
${custom_env.LargerSokoban}
157+
SokobanDifferentGridVocab:
158+
${custom_env.SokobanDifferentGridVocab}
159+
FrozenLake:
160+
${custom_env.FrozenLake}

examples/agentic_demo/agent_val_frozen_lake_single_node_demo.yaml

Lines changed: 31 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
defaults:
2-
- ../config/envs@_here_
2+
- ../config/traj_envs@_here_
33
- ../config/deepspeed_zero@_here_
44
- ../config/deepspeed_zero2@_here_
55
- ../config/deepspeed_zero3@_here_
@@ -29,10 +29,13 @@ system_envs:
2929
# - roll
3030
# - baseline
3131

32-
3332
track_with: tensorboard
3433
tracker_kwargs:
35-
log_dir: /data/oss_bucket_0/yali/llm/tensorboard/roll_exp/agentic_sokoban
34+
log_dir: /data/tensorboard/roll_exp/agentic_frozen_lake
35+
36+
checkpoint_config:
37+
type: file_system
38+
output_dir: ./output/render
3639

3740
num_gpus_per_node: 1
3841

@@ -46,15 +49,15 @@ rollout_batch_size: 16
4649
val_batch_size: 16
4750
sequence_length: 4096
4851

49-
reward_clip: 20
50-
advantage_clip: 10.0
52+
advantage_clip: 0.2
5153
ppo_epochs: 1
52-
adv_estimator: "reinforce"
54+
adv_estimator: "grpo"
5355
#pg_clip: 0.1
5456
#dual_clip_loss: True
5557
init_kl_coef: 0.0
5658
whiten_advantages: true
5759
entropy_loss_coef: 0
60+
max_grad_norm: 1.0
5861

5962
pretrain: Qwen/Qwen2.5-0.5B-Instruct
6063
reward_pretrain: Qwen/Qwen2.5-0.5B-Instruct
@@ -71,6 +74,7 @@ actor_train:
7174
per_device_train_batch_size: 1
7275
gradient_accumulation_steps: 16
7376
warmup_steps: 10
77+
lr_scheduler_type: cosine
7478
data_args:
7579
template: qwen2_5
7680
strategy_args:
@@ -123,71 +127,34 @@ reference:
123127
device_mapping: list(range(0,1))
124128
infer_batch_size: 1
125129

126-
enable_response_mask: True
127-
action_sep: "||"
128-
use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
129-
enable_think: False # False -> no think RL
130-
max_actions_per_traj: 10
131130
reward_normalization:
132131
grouping: tags # 可以tags(env_type)/traj_group_id(group)/batch(rollout_batch)... group_by计算reward/adv
133132
method: identity # asym_clip / identity / mean_std
134133

135-
custom_envs:
136-
SimpleSokoban:
137-
env_type: sokoban
138-
max_actions_per_traj: ${max_actions_per_traj} # used in environment state manager to control the actual max actions executed per trajectory
139-
max_steps_per_traj: ${max_actions_per_traj}
140-
env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer must be one of action in a turn, format is <answer>Right</answer>"
141-
max_tokens: 100 # used to curate llm prompt "max words", not used for rollout
142-
env_config: # keys should be a subset of SokobanConfig
143-
dim_x: 6
144-
dim_y: 6
145-
num_boxes: 1
146-
max_steps: ${max_actions_per_traj}
147-
LargerSokoban:
148-
env_type: sokoban
149-
max_actions_per_traj: ${max_actions_per_traj}
150-
max_steps_per_traj: ${max_actions_per_traj}
151-
env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer must be one of action in a turn, format is <answer>Right</answer>"
152-
max_tokens: 100
153-
env_config:
154-
dim_x: 8
155-
dim_y: 8
156-
num_boxes: 2
157-
max_steps: ${max_actions_per_traj}
158-
search_depth: 10
159-
SokobanDifferentGridVocab:
160-
env_type: sokoban
161-
max_actions_per_traj: ${max_actions_per_traj}
162-
max_steps_per_traj: ${max_actions_per_traj}
163-
env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer must be one of action in a turn, format is <answer>Right</answer>"
164-
max_tokens: 100
165-
env_config: # keys should be a subset of SokobanConfig
166-
search_depth: 30
167-
dim_x: 6
168-
dim_y: 6
169-
num_boxes: 1
170-
max_steps: ${max_actions_per_traj}
171-
grid_lookup: { 0: "W", 1: ".", 2: "G", 3: "C", 4: "B", 5: "A", 6: "@" }
172-
grid_vocab: { "W": "wall", ".": "empty", "G": "target", "C": "box on target", "B": "box", "A": "player", "@": "player on target" }
173-
FrozenLake:
174-
env_type: frozen_lake
175-
max_actions_per_traj: ${max_actions_per_traj}
176-
max_steps_per_traj: ${max_actions_per_traj}
177-
env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. The answer must be one of action in a turn, format is <answer>Right</answer>"
178-
max_tokens: 100
179-
env_config:
180-
is_slippery: false
181-
182134
train_env_manager:
183-
format_penalty: -0.001
184-
env_groups: 1
135+
format_penalty: -0.15 # sokoban env penalty_for_step=-0.1
136+
max_env_num_per_worker: 16
137+
num_env_groups: 1
138+
# under the same group, the env config and env seed are ensured to be equal
185139
group_size: 1
186140
tags: [FrozenLake]
187-
n_groups: [1] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
141+
num_groups_partition: [1] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
188142

189143
val_env_manager:
190-
env_groups: 2
144+
max_env_num_per_worker: 1
145+
num_env_groups: 2
191146
group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
192-
tags: [SimpleSokoban, FrozenLake]
193-
n_groups: [1, 1] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
147+
tags: [SimpleSokoban, LargerSokoban]
148+
num_groups_partition: [1, 1] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
149+
150+
max_tokens_per_step: 64
151+
152+
custom_envs:
153+
SimpleSokoban:
154+
${custom_env.SimpleSokoban}
155+
LargerSokoban:
156+
${custom_env.LargerSokoban}
157+
SokobanDifferentGridVocab:
158+
${custom_env.SokobanDifferentGridVocab}
159+
FrozenLake:
160+
${custom_env.FrozenLake}

0 commit comments

Comments
 (0)