Skip to content

Commit

Permalink
first_scheduled_time can be None
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryWu99 committed Sep 9, 2024
1 parent 3937c1f commit 982f911
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions vllm/engine/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1875,16 +1875,18 @@ def _get_stats(self,
# Latency timings
time_e2e_requests.append(now -
seq_group.metrics.arrival_time)
time_queue_requests.append(
seq_group.metrics.first_scheduled_time -
seq_group.metrics.arrival_time)
time_prefill_requests.append(
seq_group.metrics.first_token_time -
seq_group.metrics.first_scheduled_time)
time_decode_requests.append(
now - seq_group.metrics.first_token_time)
time_inference_requests.append(
now - seq_group.metrics.first_scheduled_time)
if (seq_group.metrics.first_scheduled_time is not None and
seq_group.metrics.first_token_time is not None):
time_queue_requests.append(
seq_group.metrics.first_scheduled_time -
seq_group.metrics.arrival_time)
time_prefill_requests.append(
seq_group.metrics.first_token_time -
seq_group.metrics.first_scheduled_time)
time_decode_requests.append(
now - seq_group.metrics.first_token_time)
time_inference_requests.append(
now - seq_group.metrics.first_scheduled_time)
# Metadata
num_prompt_tokens_requests.append(
len(seq_group.prompt_token_ids))
Expand Down

0 comments on commit 982f911

Please sign in to comment.