From 5f0af13e30f087a5ecb07eda24ac7f07ca45bf09 Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Sat, 1 Jun 2024 02:27:42 +0700 Subject: [PATCH 1/6] fix: fix conditional removal of lora_int_id in scheduler.py --- vllm/core/scheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index 7c70b1b244f7d..e59908752a936 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -422,7 +422,8 @@ def _schedule_running( 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 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. From b8a21cc902f3a19d811cc90b23a3129d5792effb Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Sat, 1 Jun 2024 02:48:41 +0700 Subject: [PATCH 2/6] fix: remove redundant condition for lora_int_id removal in scheduler.py --- vllm/core/scheduler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index e59908752a936..ec80f5d847511 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -421,8 +421,7 @@ 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: - if seq_group.lora_int_id in curr_loras: + 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: From dcde110a2d27b741241040f6c63d8dbb9bc65929 Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Sat, 1 Jun 2024 02:51:05 +0700 Subject: [PATCH 3/6] chore: fix Line too long (112 > 80) --- vllm/core/scheduler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index ec80f5d847511..e94e815cd0653 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -421,7 +421,11 @@ 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 and seq_group.lora_int_id in curr_loras: + 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: From ec1d5824ca01c333814be29810c25787ca74a045 Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:48:45 +0700 Subject: [PATCH 4/6] fix: remove redundant condition for lora_int_id removal in scheduler.py --- vllm/core/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index e94e815cd0653..bc882f753c94b 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -426,7 +426,7 @@ def _schedule_running( and seq_group.lora_int_id > 0 and seq_group.lora_int_id in curr_loras ): - curr_loras.remove(seq_group.lora_int_id) + curr_loras.remove(seq_group.lora_int_id) if running_queue: # Preempt the lowest-priority sequence groups. From f8be7fd434d1410c75f135bb478956026ea51890 Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:12:29 +0700 Subject: [PATCH 5/6] reformat: fix lint error --- vllm/core/scheduler.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index bc882f753c94b..fe6405b7f5248 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -421,11 +421,9 @@ 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 - and seq_group.lora_int_id in curr_loras - ): + + 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: From 8830b61af93109e16e67e77740e520fc1b90f361 Mon Sep 17 00:00:00 2001 From: Bla_ckB <50193121+BlackBird-Coding@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:18:13 +0700 Subject: [PATCH 6/6] reformat: remove hidden indent --- vllm/core/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/core/scheduler.py b/vllm/core/scheduler.py index fe6405b7f5248..2736514040bbc 100644 --- a/vllm/core/scheduler.py +++ b/vllm/core/scheduler.py @@ -421,7 +421,7 @@ 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 and seq_group.lora_int_id in curr_loras): curr_loras.remove(seq_group.lora_int_id)