Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 06d9876

Browse files
TGISStatLogger: fix stats usage (#25)
Cherry-pick of fix commit 6100f4b from ODH: #17 --------- Signed-off-by: Travis Johnson <[email protected]> Co-authored-by: Daniele Trifirò <[email protected]>
1 parent c737a7a commit 06d9876

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

vllm/tgis_utils/metrics.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,19 @@ def log(self, stats: Stats) -> None:
116116
self._vllm_stat_logger.log(stats)
117117

118118
# Then log TGIS specific ones
119-
self.tgi_queue_size.set(stats.num_waiting + stats.num_swapped)
120-
self.tgi_batch_current_size.set(stats.num_running)
119+
self.tgi_queue_size.set(stats.num_waiting_sys + stats.num_swapped_sys)
120+
self.tgi_batch_current_size.set(stats.num_running_sys)
121121

122-
for ttft in stats.time_to_first_tokens:
122+
for ttft in stats.time_to_first_tokens_iter:
123123
self.tgi_batch_inference_duration.labels({
124124
"method": "prefill"
125125
}).observe(ttft)
126-
for tpot in stats.time_per_output_tokens:
126+
for tpot in stats.time_per_output_tokens_iter:
127127
self.tgi_batch_inference_duration.labels({
128128
"method": "next_token"
129129
}).observe(tpot)
130130

131-
# These metrics depend on open PR: https://github.com/vllm-project/vllm/pull/2764
132-
if hasattr(stats, "num_prompt_tokens_lst"):
133-
for input_len in stats.num_prompt_tokens_lst:
134-
self.tgi_request_input_length.observe(input_len)
135-
for output_len in stats.num_generation_tokens_lst:
136-
self.tgi_request_generated_tokens.observe(output_len)
131+
for input_len in stats.num_prompt_tokens_requests:
132+
self.tgi_request_input_length.observe(input_len)
133+
for output_len in stats.num_generation_tokens_requests:
134+
self.tgi_request_generated_tokens.observe(output_len)

0 commit comments

Comments
 (0)