From 3b5270a6afbefe38c3367ff1957cc03901c06a69 Mon Sep 17 00:00:00 2001 From: Yu Gong Date: Thu, 18 Dec 2025 21:22:25 +0000 Subject: [PATCH] fix bug of always capture lora even no-lora case Signed-off-by: Yu Gong --- vllm/v1/worker/lora_model_runner_mixin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vllm/v1/worker/lora_model_runner_mixin.py b/vllm/v1/worker/lora_model_runner_mixin.py index 06c933d214b79..01d73ccecf84a 100644 --- a/vllm/v1/worker/lora_model_runner_mixin.py +++ b/vllm/v1/worker/lora_model_runner_mixin.py @@ -195,10 +195,12 @@ class LoRAModelRunnerMixin: for lora_id in range(1, effective_num_loras + 1) } - if lora_requests: - self._set_active_loras( - tuple(sample_lora_mapping), tuple(token_lora_mapping), lora_requests - ) + # Always call _set_active_loras to ensure the mapping is updated. + # This is important when capturing no-LoRA graphs (effective_num_loras=0) + # after capturing LoRA graphs, as we need to clear the previous mapping. + self._set_active_loras( + tuple(sample_lora_mapping), tuple(token_lora_mapping), lora_requests + ) yield