Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fix KeyError: 1 When Using LoRA adapters #5164

Merged
merged 8 commits into from
Jun 9, 2024
8 changes: 6 additions & 2 deletions vllm/core/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,12 @@ def _schedule_running(
num_running_seqs = seq_group.get_max_num_running_seqs()
budget.subtract_num_seqs(seq_group.request_id,
num_running_seqs)
if curr_loras is not None and seq_group.lora_int_id > 0:
curr_loras.remove(seq_group.lora_int_id)
if (
curr_loras is not None
and seq_group.lora_int_id > 0
and seq_group.lora_int_id in curr_loras
):
curr_loras.remove(seq_group.lora_int_id)

if running_queue:
# Preempt the lowest-priority sequence groups.
Expand Down
Loading