verl icon indicating copy to clipboard operation
verl copied to clipboard

vLLM V1 with LoRA: FileNotFoundError for placeholder 'simon_lora_path' when using VLLM_USE_V1=1

Open August-murr opened this issue 1 year ago • 3 comments

System Info

----------Python Info----------
Version      : 3.10.12
Compiler     : GCC 11.4.0
Build        : ('main', 'Aug 15 2025 14:32:43')
Arch         : ('64bit', 'ELF')
------------Pip Info-----------
Version      : 25.2
Directory    : /root/verl/.venv/lib/python3.10/site-packages/pip
vllm         : 0.10.0
sglang       : not found.
ray          : 2.47.1
torch        : 2.7.1
----------verl Info-----------
Version      : 0.7.0.dev
Directory    : /root/verl/verl
Commit Hash  : 05da859a0929b410e5a3efaf33bdf640415e9935
----------Platform Info----------
Platform     : Linux-5.15.0-94-generic-x86_64-with-glibc2.35
system       : Linux
node         : 48893ace99a4
release      : 5.15.0-94-generic
version      : #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024
----------Environment----------
CUDA Runtime : 12.6
CUDA compiler : Not found: [Errno 2] No such file or directory: 'nvcc'
----------System Info----------
CPU Memory      : 503.52 GB
GPU Count       : 2
GPU 1   Type    : NVIDIA A40
GPU 1   Memory  : 44.99 GB
GPU 2   Type    : NVIDIA A40
GPU 2   Memory  : 44.99 GB

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

When running VERL GRPO training with vLLM V1 backend and LoRA enabled, the system crashes with a FileNotFoundError attempting to load a hardcoded placeholder path 'simon_lora_path/adapter_config.json'.

#!/bin/bash
set -x

# For async rollout mode, dataset should return raw chat.
rollout_mode="async"
rollout_name="vllm" # Using vllm as requested
if [ "$rollout_mode" = "async" ]; then
    export VLLM_USE_V1=1
    return_raw_chat="True"
fi

python3 -m verl.trainer.main_ppo \
    algorithm.adv_estimator=grpo \
    data.train_files=/root/verl/data/tool_use_math/train.parquet \
    data.val_files=/root/verl/data/tool_use_math/test.parquet \
    data.return_raw_chat=$return_raw_chat \
    data.train_batch_size=32 \
    data.max_prompt_length=512 \
    data.max_response_length=1024 \
    data.filter_overlong_prompts=True \
    data.truncation='error' \
    custom_reward_function.path=/root/verl/custom_reward.py \
    custom_reward_function.name=compute_score \
    actor_rollout_ref.model.path=Qwen/Qwen3-0.6B \
    actor_rollout_ref.model.lora_rank=8 \
    actor_rollout_ref.model.lora_alpha=32 \
    actor_rollout_ref.model.target_modules="all-linear" \
    actor_rollout_ref.actor.optim.lr=3e-5 \
    actor_rollout_ref.model.use_remove_padding=True \
    actor_rollout_ref.actor.ppo_mini_batch_size=64 \
    actor_rollout_ref.actor.use_dynamic_bsz=True \
    actor_rollout_ref.actor.ppo_max_token_len_per_gpu=12000 \
    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.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.tensor_model_parallel_size=1 \
    actor_rollout_ref.rollout.name=$rollout_name \
    actor_rollout_ref.rollout.mode=$rollout_mode \
    actor_rollout_ref.rollout.multi_turn.enable=True \
    actor_rollout_ref.rollout.multi_turn.format=hermes \
    actor_rollout_ref.rollout.gpu_memory_utilization=0.6 \
    actor_rollout_ref.rollout.n=8 \
    actor_rollout_ref.rollout.multi_turn.tool_config_path=/root/verl/code_executor_tool_config.yaml \
    actor_rollout_ref.rollout.trace.backend=weave \
    actor_rollout_ref.rollout.trace.token2text=True \
    actor_rollout_ref.ref.fsdp_config.param_offload=True \
    algorithm.use_kl_in_reward=False \
    trainer.critic_warmup=0 \
    trainer.logger='["console","wandb"]' \
    trainer.project_name='verl_grpo_tool_use_math' \
    trainer.experiment_name='qwen3_0.6b_code_executor_lora8' \
    trainer.val_before_train=False \
    trainer.n_gpus_per_node=2 \
    trainer.nnodes=1 \
    trainer.save_freq=20 \
    trainer.test_freq=5 \
    trainer.total_epochs=15 $@

ERROR:

(WorkerDict pid=81696) ERROR:2025-10-23 09:56:23,113:vLLMAsyncRollout _loop_forever error: [Errno 2] No such file or directory: 'simon_lora_path/adapter_config.json'
(WorkerDict pid=81696)   File "/root/verl/verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py", line 554, in _loop_forever
(WorkerDict pid=81696)     result = await self._execute_method(method, *args, **kwargs)
(WorkerDict pid=81696)   File "/root/verl/verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py", line 591, in _execute_method
(WorkerDict pid=81696)     return self.inference_engine.execute_method(method, *args, **kwargs)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/worker/worker_base.py", line 611, in execute_method
(WorkerDict pid=81696)     return run_method(self, method, args, kwargs)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/utils/__init__.py", line 2985, in run_method
(WorkerDict pid=81696)     return func(*args, **kwargs)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context
(WorkerDict pid=81696)     output = self.model_runner.execute_model(scheduler_output, self._prepare_inputs(scheduler_output))
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/v1/worker/gpu_model_runner.py", line 824, in _prepare_inputs
(WorkerDict pid=81696)     self.set_active_loras(self.input_batch, num_scheduled_tokens)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/v1/worker/lora_model_runner_mixin.py", line 84, in set_active_loras
(WorkerDict pid=81696)     return self._set_active_loras(prompt_lora_mapping, token_lora_mapping,
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/v1/worker/lora_model_runner_mixin.py", line 73, in _set_active_loras
(WorkerDict pid=81696)     self.lora_manager.set_active_adapters(lora_requests, lora_mapping)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/lora/worker_manager.py", line 167, in set_active_adapters
(WorkerDict pid=81696)     set_active_adapters_worker(requests, mapping, self._apply_adapters,
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/adapter_commons/utils.py", line 55, in set_active_adapters_worker
(WorkerDict pid=81696)     apply_adapters_func(requests)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/lora/worker_manager.py", line 227, in _apply_adapters
(WorkerDict pid=81696)     self.add_adapter(lora)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/lora/worker_manager.py", line 240, in add_adapter
(WorkerDict pid=81696)     lora = self._load_adapter(lora_request)
(WorkerDict pid=81696)   File "/root/verl/verl/utils/vllm/utils.py", line 65, in hijack__load_adapter
(WorkerDict pid=81696)     peft_helper = PEFTHelper.from_local_dir(lora_path, self.max_position_embeddings)
(WorkerDict pid=81696)   File "/usr/local/lib/python3.10/dist-packages/vllm/lora/peft_helper.py", line 107, in from_local_dir
(WorkerDict pid=81696)     with open(lora_config_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'simon_lora_path/adapter_config.json'

Expected behavior

The training should proceed without errors

August-murr avatar Oct 23 '25 10:10 August-murr

Hi, I see that you are using vllm = 0.10.0, but the line in your trace the line output = self.model_runner.execute_model(scheduler_output, self._prepare_inputs(scheduler_output)) still looks a bit weird. The code in vllm/v1/worker/gpu_worker.py (v0.10.0) is the following

https://github.com/vllm-project/vllm/blob/6d8d0a24c02bfd84d46b3016b865a44f048ae84b/vllm/v1/worker/gpu_worker.py#L337-L338

Also it looks from the beginning that the method triggered within execute_method is update_weights: https://github.com/volcengine/verl/blob/ab676dc2b6732e8d32c793e15b94121548060220/verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py#L607-L631

which exactly creates a TensorLoRARequest, and in the vllm hijacking this ensures that we will not call PEFTHelper.from_local_dir within _load_adapter.

https://github.com/volcengine/verl/blob/ab676dc2b6732e8d32c793e15b94121548060220/verl/utils/vllm/utils.py#L56-L65

Might be worth checking into these locations in the codebase you are using to see where the discrepancy occurs.

listar2000 avatar Oct 24 '25 03:10 listar2000

Hi, just want to give a quick followup -- after some debugging and reproducing, I found that this is currently caused by the generate function from vLLMHttpServerBase is trying to make a request to the vLLM server before LoRA is readily loaded. Usually the LoRA is loaded before we make any generation request but when base_sync_done = False -- which corresponds to cases when the rollout.load_format = "dummy" -- the assumption no longer holds.

For now, one way that perhaps can temporarily make this work is to set load_format = "safetensors", I will send another PR following previous changes in #3821 soon.

listar2000 avatar Oct 25 '25 07:10 listar2000

中文:这个问题看起来已经由 #3907 修复并合入 main。#3907 明确说明它修复了 rollout.load_format="dummy" 导致初始 base_sync_done=False 时 LoRA 尚未加载、但 generate() 仍构造带占位 VLLM_LORA_PATH 的 LoRARequest,从而触发类似 #3882 的 simon_lora_path/adapter_config.json FileNotFoundError。该 PR 还说明已手动复现 #3882 并确认修复,merge commit 为 4576678f0e6a6f200ed637fc811257f129bbca65。

English: This appears to have been fixed by #3907 and merged into main. #3907 specifically explains that when rollout.load_format="dummy" makes the initial base_sync_done=False, LoRA may not be loaded yet while generate() still builds a LoRARequest with the placeholder VLLM_LORA_PATH, causing the simon_lora_path/adapter_config.json FileNotFoundError reported in #3882. The PR also says the author manually reproduced #3882 and confirmed the fix; the merge commit is 4576678f0e6a6f200ed637fc811257f129bbca65.

This response was generated by a scheduled Codex GPT5.5 issue processing task.

Kirrito-k423 avatar Jul 21 '26 02:07 Kirrito-k423