verl icon indicating copy to clipboard operation
verl copied to clipboard

CPU OOM during the validation in training process

Open search-codes-now-2016 opened this issue 1 year ago • 10 comments

System Info

My task: Qwen 2.5 VL 3B - GRPO - visual thinking task - vllm My device: A6000 48G * 8 + 512G Memory My Data: The training data scale is equal or smaller than the validation data

Bug: If training without any validation, the whole training process works well, including saving checkpoints. Meanwhile, once begin to validate data during training process, the training task will be crashed. The terminal shows: ray.exceptions.ActorDiedError: The actor died unexpectedly before finishing this task. class_name: TaskRunner actor_id: **** pid: **** namespace: ***** ip: 192.168.*** The actor is dead because its worker process has died. Worker exit type: SYSTEM_ERROR Worker exit detail: Worker unexpectedly exits with a connection error code 2. End of file. There are some potential root causes. (1) The process is killed by SIGKILL by OOM killer due to high memory usage. (2) ray stop --force is called. (3) The worker is crashed unexpectedly due to SIGSEGV or other unexpected errors. Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Could you please help us solve this bug?

Information

  • [ ] The official example scripts
  • [x] My own modified scripts

Tasks

  • [ ] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • [x] My own task or dataset (give details below)

Reproduction

set -x ENGINE=${1:-vllm}

MODEL_PATH=/data/Models/Qwen2.5-VL-3B-Instruct

python3 -m verl.trainer.main_ppo
algorithm.adv_estimator=grpo
data.custom_cls.path=recipe/detection/loco.py
data.custom_cls.name=MYRLHFDataset
data.train_files="$train_files"
data.val_files="$val_files"
data.train_batch_size=32
data.max_prompt_length=8192
data.max_response_length=2048
data.filter_overlong_prompts=False
data.filter_overlong_prompts_workers=8
data.truncation='error'
data.image_key=images
custom_reward_function.path=recipe/detection/loco.py
custom_reward_function.name=compute_score
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=32
actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=1
actor_rollout_ref.actor.use_kl_loss=True
actor_rollout_ref.actor.kl_loss_coef=0.01
actor_rollout_ref.actor.kl_loss_type=low_var_kl
actor_rollout_ref.actor.entropy_coeff=0
actor_rollout_ref.model.enable_gradient_checkpointing=True
actor_rollout_ref.actor.fsdp_config.param_offload=False
actor_rollout_ref.actor.fsdp_config.optimizer_offload=False
actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=1
actor_rollout_ref.rollout.tensor_model_parallel_size=1
actor_rollout_ref.rollout.name=$ENGINE
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True
actor_rollout_ref.rollout.gpu_memory_utilization=0.9
actor_rollout_ref.rollout.enable_chunked_prefill=False
actor_rollout_ref.rollout.enforce_eager=False
actor_rollout_ref.rollout.free_cache_engine=True
actor_rollout_ref.rollout.n=8
actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=1
actor_rollout_ref.ref.fsdp_config.param_offload=True
algorithm.use_kl_in_reward=False
trainer.critic_warmup=0
trainer.logger='["console","swanlab"]'
trainer.project_name=${PROJECT_NAME}
trainer.experiment_name=${EXPERIMENT_NAME}
trainer.n_gpus_per_node=8
trainer.nnodes=1
trainer.save_freq=25
trainer.test_freq=500
trainer.val_before_train=False
trainer.default_local_dir=/data/verl_checkpoints/${PROJECT_NAME}/${EXPERIMENT_NAME}
trainer.total_epochs=10 $@

Expected behavior

ray.exceptions.ActorDiedError: The actor died unexpectedly before finishing this task. class_name: TaskRunner actor_id: **** pid: **** namespace: ***** ip: 192.168.*** The actor is dead because its worker process has died. Worker exit type: SYSTEM_ERROR Worker exit detail: Worker unexpectedly exits with a connection error code 2. End of file. There are some potential root causes. (1) The process is killed by SIGKILL by OOM killer due to high memory usage. (2) ray stop --force is called. (3) The worker is crashed unexpectedly due to SIGSEGV or other unexpected errors. Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

search-codes-now-2016 avatar Sep 04 '25 14:09 search-codes-now-2016

Hi, I encountered the same issue. How did you solve it? Thanks

XueTianci avatar Sep 10 '25 17:09 XueTianci

Same. How to fix. thx! @XueTianci @search-codes-now-2016

zhangquanchen avatar Sep 25 '25 12:09 zhangquanchen

Hi all, I encountered the same issue when increasing the validation set. How did you solve it in the end? @search-codes-now-2016 @XueTianci @zhangquanchen Thanks!

fengyzpku avatar Nov 13 '25 03:11 fengyzpku

Same error!

Raven-EM11 avatar Dec 09 '25 13:12 Raven-EM11

Same error. Let me know if something worked

hanshen95 avatar Dec 21 '25 14:12 hanshen95

I am facing the same error, has it been debugged?

mr-sarthakgupta avatar Jan 07 '26 15:01 mr-sarthakgupta

Same error!

jp1924 avatar Feb 24 '26 00:02 jp1924

已收到您的信件!

zhangquanchen avatar Feb 24 '26 00:02 zhangquanchen

any update?

v4if avatar Mar 25 '26 06:03 v4if

any update?

My personal solution was to configure the data.val_batch_size parameter to avoid sending the entire validation dataset to the server engine all at once.

eg: val_batch_size: 256

v4if avatar Mar 25 '26 09:03 v4if