Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/npu/run_qwen2_5_05b_grpo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ python3 -m verl.trainer.main_ppo \
trainer.nnodes=1 \
trainer.save_freq=-1 \
trainer.test_freq=5 \
trainer.total_epochs=1 $@
trainer.total_epochs=1 \
trainer.total_training_steps=2 \
trainer.device=npu $@
3 changes: 2 additions & 1 deletion tests/npu/run_qwen2_5_32b_grpo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ python3 -m verl.trainer.main_ppo \
trainer.nnodes=2 \
trainer.save_freq=-1 \
trainer.test_freq=10 \
trainer.total_epochs=15 $@
trainer.total_epochs=15 \
trainer.device=npu $@
3 changes: 2 additions & 1 deletion tests/npu/run_qwen2_5_7b_grpo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ python3 -m verl.trainer.main_ppo \
trainer.nnodes=1 \
trainer.save_freq=-1 \
trainer.test_freq=5 \
trainer.total_epochs=5 $@
trainer.total_epochs=5 \
trainer.device=npu $@
1 change: 1 addition & 0 deletions verl/trainer/config/ppo_megatron_trainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ trainer:
max_critic_ckpt_to_keep: null
# The timeout for ray worker group to wait for the register center to be ready
ray_wait_register_center_timeout: 300
device: cuda

ray_init:
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.
1 change: 1 addition & 0 deletions verl/trainer/config/ppo_trainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ trainer:
max_critic_ckpt_to_keep: null
# The timeout for ray worker group to wait for the register center to be ready
ray_wait_register_center_timeout: 300
device: cuda

ray_init:
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.
3 changes: 1 addition & 2 deletions verl/trainer/main_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from verl.trainer.ppo.ray_trainer import RayPPOTrainer
from verl.trainer.ppo.reward import load_reward_manager
from verl.utils.device import is_cuda_available


def get_custom_reward_fn(config):
Expand Down Expand Up @@ -179,7 +178,7 @@ def run(self, config):
val_dataset=val_dataset,
collate_fn=collate_fn,
train_sampler=train_sampler,
device_name="cuda" if is_cuda_available else "npu",
device_name=config.trainer.device,
)
trainer.init_workers()
trainer.fit()
Expand Down
Loading