GPU memory usage continuously increased
During training, GPU memory usage continuously increased, leading to an out-of-memory (OOM) error.
This causes an out-of-memory (OOM) error when training reaches a certain step.
My train config:
PYTHONUNBUFFRED=1 python3 -m verl.trainer.main_ppo
algorithm.adv_estimator=grpo
data.train_files="$train_files"
data.val_files=/root/xxx/verl/debiasing/data/test.parquet
data.train_batch_size=16
data.max_prompt_length=576
data.max_response_length=288
data.filter_overlong_prompts=True
data.return_raw_chat=True
data.truncation='error'
data.image_key=images
actor_rollout_ref.rollout.dtype=bfloat16
actor_rollout_ref.model.path=/root/xxx/models/Qwen2.5-VL-3B-Instruct
actor_rollout_ref.actor.optim.lr=1e-6
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.weight_by_group=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.actor.fsdp_config.model_dtype=bfloat16
actor_rollout_ref.model.enable_gradient_checkpointing=True
+actor_rollout_ref.model.enable_activation_offloading=True
actor_rollout_ref.actor.fsdp_config.param_offload=True
actor_rollout_ref.actor.fsdp_config.optimizer_offload=True
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=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.enable_chunked_prefill=False
actor_rollout_ref.nccl_timeout=36000
actor_rollout_ref.rollout.enforce_eager=False
actor_rollout_ref.rollout.free_cache_engine=True
actor_rollout_ref.rollout.n=8
actor_rollout_ref.rollout.multi_turn.enable=True
actor_rollout_ref.rollout.calculate_log_probs=True
actor_rollout_ref.rollout.calculate_tokens_log_probs=True
actor_rollout_ref.rollout.multi_turn.max_user_turns=2
actor_rollout_ref.rollout.multi_turn.max_assistant_turns=2
actor_rollout_ref.rollout.multi_turn.interaction_config_path=/root/xxx/verl/debiasing/waterbird_interaction.yaml
actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=1
actor_rollout_ref.ref.fsdp_config.param_offload=True
custom_reward_function.path=/root/xxx/verl/debiasing/waterbird_reward_func.py
algorithm.use_kl_in_reward=False
trainer.critic_warmup=0
trainer.logger='["console","swanlab"]'
trainer.project_name='debiasing_v3'
trainer.experiment_name='qwen2_5_vl_3b_debiasing_v3_t4'
trainer.n_gpus_per_node=4
trainer.nnodes=1
trainer.save_freq=500
trainer.test_freq=1001
trainer.total_epochs=10
trainer.val_before_train=False $@
if I restart the train, the memory will be normal, it is obvious leak memory
@hiyouga I need your help
+1
@laojiangwei , you can share your run command and env pip list
@laojiangwei ,hello, can you share your problem details? it will help me.
I think it relates to images @laojiangwei
same problem
@Clementine24 update sglang
@Clementine24 update sglang
Hi, I wonder which version of sglang will solve this problem, I use SGLang==0.4.9.post6. And I wonder which changes in SGLang code related to this issue, cause I've been tried many times to change sglang's version, and unfortunately it seems that only this version can be compatible with my other env packages.
Same for vllm 0.11 here. Any updates? @Clementine24
中文:我查到两个公开线索可能与这个问题相关,但还不能安全地直接关闭本 issue。
- 与 #3293 高度相关的根因分析在 #6698:FSDP actor update 中
model_output仍挂在 autograd graph 上,并被每个 micro-batch 的output_lst持有到整批结束,可能导致 GPU memory 按 micro-batch 增长。对应修复 PR #6699 已在 2026-06-12 合并。 - 你在另一个相似的 Qwen2.5-VL + SGLang + image data 问题 #3396 中提到,升级到
sglang==0.4.10.post2后问题解决;相关的 SGLang/VLM OOM 版本更新也已在 PR #3216 合并。 - 但 #3293 的原始复现配置和 #6698/#6699 的完整复现场景不完全相同,而且后续还有用户提到 vLLM 0.11 也有类似现象。因此建议先请复测,而不是直接关闭。
能否请你在包含 PR #6699 的最新 main/release 上复测,并确认:
- 当前 verl commit / release 版本;
- SGLang 或 vLLM 版本;
- 是否仍使用 image inputs、multi_turn、
rollout.n=8、gradient checkpointing; - OOM 发生在 rollout、log_prob/ref_log_prob、actor update、validation 还是保存 checkpoint 阶段;
- 如果仍复现,请附上
global_profiler.tool=torch_memory生成的 memory snapshot 或每步 GPU memory 曲线。
English: I found two public leads that may be related, but they are not enough to safely close this issue yet.
- A closely related root-cause analysis is in #6698: during FSDP actor update,
model_outputremained attached to the autograd graph and was kept in per-micro-batchoutput_lstuntil the whole batch finished, which can make GPU memory grow per micro-batch. The corresponding fix PR #6699 was merged on 2026-06-12. - In another similar Qwen2.5-VL + SGLang + image-data report from the same author (#3396), upgrading to
sglang==0.4.10.post2was reported to solve the problem; the related SGLang/VLM OOM version bump was merged in PR #3216. - However, the original #3293 setup is not exactly the same as the full #6698/#6699 reproduction, and a later comment also mentions similar behavior with vLLM 0.11. So the safer next step is to ask for a retest instead of closing this issue directly.
Could you please retest on a recent main/release that includes PR #6699 and confirm:
- the current verl commit / release version;
- the SGLang or vLLM version;
- whether image inputs, multi_turn,
rollout.n=8, and gradient checkpointing are still enabled; - whether OOM happens during rollout, log_prob/ref_log_prob, actor update, validation, or checkpoint saving;
- if it still reproduces, please attach a
global_profiler.tool=torch_memorysnapshot or a per-step GPU memory curve.
This response was generated by a scheduled Codex GPT5.5 issue processing task.