-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathrun_memory_7B.sh
More file actions
82 lines (77 loc) · 3.21 KB
/
run_memory_7B.sh
File metadata and controls
82 lines (77 loc) · 3.21 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
#!/bin/bash
set -x
# at least 1 nodes, 4nodes=3~4days to converge
NNODES=4
NGPUS_PER_NODE=8
PROJ_ROOT=
DATASET_ROOT=
MODEL_PATH=Qwen/Qwen2.5-7B-Instruct
VAL_PATH="${DATASET_ROOT}/hotpotqa/hotpotqa_dev.parquet"
TRAIN_PATH="${DATASET_ROOT}/hotpotqa/hotpotqa_train_32k.parquet"
EXP=memory_agent/7B
PROJ_DIR=${PROJ_ROOT}/${EXP}
# Please note that recurrent framewrok will use max_length defined in task config.
# These two values are just for vLLM to decide max_model_length.
MAXLEN=8192
MAX_NEW_TOKEN=1024
python3 -m verl.trainer.main_ppo \
recurrent.enable=memory \
recurrent.memory.config.chunk_size=5000 \
algorithm.adv_estimator=grpo \
algorithm.grpo_use_adv=False \
trainer.save_freq=10 \
actor_rollout_ref.rollout.n=16 \
actor_rollout_ref.rollout.val_kwargs.n=4 \
trainer.logger=['console','wandb'] \
actor_rollout_ref.actor.optim.lr_warmup_steps=20 \
actor_rollout_ref.actor.clip_ratio_high=0.20 \
actor_rollout_ref.actor.entropy_coeff=0.000 \
data.train_files=$TRAIN_PATH \
data.val_files=$VAL_PATH \
data.shuffle=False \
data.filter_overlong_prompts=True \
data.train_batch_size=128 \
data.truncation='center' \
+data.context_key='context' \
data.max_prompt_length=$MAXLEN \
data.max_response_length=$MAX_NEW_TOKEN \
reward_model.reward_manager='thread' \
actor_rollout_ref.model.path=$MODEL_PATH \
actor_rollout_ref.actor.optim.lr=1e-6 \
actor_rollout_ref.model.use_remove_padding=True \
actor_rollout_ref.actor.ppo_mini_batch_size=8 \
actor_rollout_ref.actor.use_dynamic_bsz=True \
actor_rollout_ref.actor.ppo_max_token_len_per_gpu=16384 \
actor_rollout_ref.ref.log_prob_max_token_len_per_gpu=32768 \
actor_rollout_ref.rollout.log_prob_max_token_len_per_gpu=32768 \
actor_rollout_ref.actor.ulysses_sequence_parallel_size=1 \
actor_rollout_ref.actor.use_kl_loss=True \
actor_rollout_ref.actor.kl_loss_coef=0.001 \
actor_rollout_ref.actor.kl_loss_type=low_var_kl \
actor_rollout_ref.model.enable_gradient_checkpointing=True \
actor_rollout_ref.actor.fsdp_config.param_offload=True \
actor_rollout_ref.actor.fsdp_config.optimizer_offload=True \
actor_rollout_ref.rollout.enforce_eager=False \
actor_rollout_ref.rollout.free_cache_engine=False \
actor_rollout_ref.actor.fsdp_config.fsdp_size=8 \
actor_rollout_ref.rollout.name=vllm \
actor_rollout_ref.rollout.temperature=1 \
actor_rollout_ref.rollout.top_p=1.0 \
actor_rollout_ref.rollout.tensor_model_parallel_size=1 \
actor_rollout_ref.rollout.gpu_memory_utilization=0.6 \
actor_rollout_ref.rollout.val_kwargs.do_sample=True \
actor_rollout_ref.rollout.val_kwargs.temperature=1.0 \
actor_rollout_ref.rollout.val_kwargs.top_p=0.7 \
actor_rollout_ref.rollout.max_num_batched_tokens=16384\
actor_rollout_ref.ref.fsdp_config.param_offload=True \
algorithm.kl_ctrl.kl_coef=0.001 \
trainer.critic_warmup=0 \
trainer.project_name='verl-hongli' \
trainer.experiment_name=${EXP} \
trainer.val_before_train=True \
trainer.n_gpus_per_node=$NGPUS_PER_NODE \
trainer.nnodes=$NNODES \
trainer.test_freq=5 \
trainer.default_hdfs_dir=null \
trainer.default_local_dir=$PROJ_DIR \
trainer.total_epochs=30