[v1][KVCacheManager] Change prefix caching metric from counting blocks to counting tokens (#18003)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
This commit is contained in:
Chen Zhang
2025-05-12 13:46:12 -07:00
committed by GitHub
parent e9c730c9bd
commit 302f3aca7e
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -183,13 +183,13 @@ class PrometheusStatLogger(StatLoggerBase):
self.counter_gpu_prefix_cache_queries = prometheus_client.Counter(
name="vllm:gpu_prefix_cache_queries",
documentation=
"GPU prefix cache queries, in terms of number of queried blocks.",
"GPU prefix cache queries, in terms of number of queried tokens.",
labelnames=labelnames).labels(*labelvalues)
self.counter_gpu_prefix_cache_hits = prometheus_client.Counter(
name="vllm:gpu_prefix_cache_hits",
documentation=
"GPU prefix cache hits, in terms of number of cached blocks.",
"GPU prefix cache hits, in terms of number of cached tokens.",
labelnames=labelnames).labels(*labelvalues)
#
+1 -1
View File
@@ -19,7 +19,7 @@ class PrefixCacheStats:
# The number of requests in this update.
requests: int = 0
# The number of queries in these requests. Note that "queries" here
# means the number of blocks that were queried from the cache.
# means the number of tokens that were queried from the cache.
queries: int = 0
# The number of hits in these requests.
hits: int = 0