A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 19:45 UTC
[V1][Metrics] Fix traceback with preemptions+LoRA (#14220)
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin committed
Mar 7, 2025 at 20:36 UTC
e1f0835ae0c784a56bbbb060b2e7c9842dbe7696
1 file changed
+8
vllm/v1/metrics/stats.py
+8
@@ -150,6 +150,7 @@ class IterationStats:
150
LoRARequestStates.scheduled_request(lora_stats, req_id)
151
elif event.type == EngineCoreEventType.PREEMPTED:
152
self.num_preempted_reqs += 1
153
+ LoRARequestStates.preempted_request(lora_stats, req_id)
154
155
def update_from_finished_request(self, finish_reason: "FinishReason",
156
num_prompt_tokens: int,
@@ -224,6 +225,13 @@ class LoRARequestStates:
225
lora_stats.waiting_requests.remove(request_id)
226
lora_stats.running_requests.add(request_id)
227
228
+ @staticmethod
229
+ def preempted_request(lora_stats: Optional[LoRAStats], request_id: str):
230
+ if lora_stats is None:
231
+ return
232
+ lora_stats.running_requests.remove(request_id)
233
+ lora_stats.waiting_requests.add(request_id)
234
+
235
def update_iteration_stats(self,
236
iteration_stats: Optional[IterationStats]):
237
if iteration_stats is None: