Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vllm/v1/metrics/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def update_from_events(self, req_id: str, events: list["EngineCoreEvent"],
LoRARequestStates.scheduled_request(lora_stats, req_id)
elif event.type == EngineCoreEventType.PREEMPTED:
self.num_preempted_reqs += 1
LoRARequestStates.preempted_request(lora_stats, req_id)

def update_from_finished_request(self, finish_reason: "FinishReason",
num_prompt_tokens: int,
Expand Down Expand Up @@ -224,6 +225,13 @@ def scheduled_request(lora_stats: Optional[LoRAStats], request_id: str):
lora_stats.waiting_requests.remove(request_id)
lora_stats.running_requests.add(request_id)

@staticmethod
def preempted_request(lora_stats: Optional[LoRAStats], request_id: str):
if lora_stats is None:
return
lora_stats.running_requests.remove(request_id)
lora_stats.waiting_requests.add(request_id)

def update_iteration_stats(self,
iteration_stats: Optional[IterationStats]):
if iteration_stats is None:
Expand Down