Skip to content

Commit ade3f7d

Browse files
authored
[V1][Bugfix] Do not reset prefix caching metrics (#14235)
1 parent 0df2510 commit ade3f7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vllm/v1/metrics/loggers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class LoggingStatLogger(StatLoggerBase):
3434
def __init__(self):
3535
self._reset(time.monotonic())
3636
self.last_scheduler_stats = SchedulerStats()
37+
# Prefix cache metrics. This cannot be reset.
38+
# TODO: Make the interval configurable.
39+
self.prefix_caching_metrics = PrefixCachingMetrics()
3740

3841
def _reset(self, now):
3942
self.last_log_time = now
@@ -42,9 +45,6 @@ def _reset(self, now):
4245
self.num_prompt_tokens: list[int] = []
4346
self.num_generation_tokens: list[int] = []
4447

45-
# Prefix cache metrics. TODO: Make the interval configurable.
46-
self.prefix_caching_metrics = PrefixCachingMetrics()
47-
4848
def _track_iteration_stats(self, iteration_stats: IterationStats):
4949
# Save tracked stats for token counters.
5050
self.num_prompt_tokens.append(iteration_stats.num_prompt_tokens)

0 commit comments

Comments
 (0)