example : run_qwen2_5_vl-7b-sglang.sh has GPU memory leak!!!
System Info
I encountered a memory leak when running the official example code, but this is related to the image data. When I use image data without the image, this does not occur.
Pip List
sgl-kernel 0.2.7 sglang 0.4.9.post6 flash_attn 2.8.2 numpy 2.2.6 torch 2.7.1
Information
- [x] The official example scripts
- [ ] My own modified scripts
Tasks
- [x] An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below)
Reproduction
python3 -m verl.trainer.main_ppo
algorithm.adv_estimator=grpo
data.train_files=debiasing/data/geo3k/train.parquet
data.val_files=debiasing/data/geo3k/test.parquet
data.train_batch_size=16
data.max_prompt_length=512
data.max_response_length=512
data.filter_overlong_prompts=True
data.truncation='error'
data.image_key=images
actor_rollout_ref.model.path=/data/wangnn/models/Qwen2.5-VL-3B-Instruct
actor_rollout_ref.actor.optim.lr=1e-6
actor_rollout_ref.model.use_remove_padding=True
actor_rollout_ref.actor.ppo_mini_batch_size=16
actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=2
actor_rollout_ref.actor.use_kl_loss=False
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=2
actor_rollout_ref.rollout.tensor_model_parallel_size=1
actor_rollout_ref.rollout.name=sglang
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True
actor_rollout_ref.rollout.gpu_memory_utilization=0.2
actor_rollout_ref.rollout.multi_stage_wake_up=True
global_profiler.tool=torch_memory
global_profiler.save_path=./mem_snapshots
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=20
actor_rollout_ref.ref.fsdp_config.param_offload=True
actor_rollout_ref.rollout.mode=sync
algorithm.use_kl_in_reward=False
trainer.critic_warmup=0
trainer.logger='["console","swanlab"]'
trainer.project_name='verl_grpo_example_geo3k'
trainer.experiment_name='qwen2_5_vl_7b_function_rm'
trainer.n_gpus_per_node=2
trainer.nnodes=1
trainer.save_freq=200
trainer.test_freq=500
trainer.total_epochs=15
trainer.val_before_train=False $@
Expected behavior
I encountered a memory leak when running the official example code, but this is related to the image data. When I use image data without the image, this does not occur.
@zhaochenyang20 Hi, do you have any ideas?
@zhaochenyang20 Hi, do you have any ideas?
@techkang , I update sglang==0.4.10.post2 solve the problem