@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 0e98964e94
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 08:30 UTC

[V1][Metrics] Remove metrics that were deprecated in 0.8 (#18837)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

Mark McLoughlin committed May 28, 2025 at 19:54 UTC 0e98964e94385c914783842eac4b448236018689
6 files changed +1 -156
docs/usage/metrics.md
-13
@@ -35,19 +35,6 @@ The following metrics are exposed:
35 --8<-- "vllm/engine/metrics.py:metrics-definitions"
36 ```
37
38 -The following metrics are deprecated and due to be removed in a future version:
39 -
40 -- `vllm:num_requests_swapped`, `vllm:cpu_cache_usage_perc`, and
41 - `vllm:cpu_prefix_cache_hit_rate` because KV cache offloading is not
42 - used in V1.
43 -- `vllm:gpu_prefix_cache_hit_rate` is replaced by queries+hits
44 - counters in V1.
45 -- `vllm:time_in_queue_requests` because it duplicates
46 - `vllm:request_queue_time_seconds`.
47 -- `vllm:model_forward_time_milliseconds` and
48 - `vllm:model_execute_time_milliseconds` because
49 - prefill/decode/inference time metrics should be used instead.
50 -
38 Note: when metrics are deprecated in version `X.Y`, they are hidden in version `X.Y+1`
39 but can be re-enabled using the `--show-hidden-metrics-for-version=X.Y` escape hatch,
40 and are then removed in version `X.Y+2`.
examples/online_serving/prometheus_grafana/grafana.json
-30
@@ -577,23 +577,6 @@
577 "refId": "A",
578 "useBackend": false
579 },
580 - {
581 - "datasource": {
582 - "type": "prometheus",
583 - "uid": "${DS_PROMETHEUS}"
584 - },
585 - "disableTextWrap": false,
586 - "editorMode": "builder",
587 - "expr": "vllm:num_requests_swapped{model_name=\"$model_name\"}",
588 - "fullMetaSearch": false,
589 - "hide": false,
590 - "includeNullMetadata": true,
591 - "instant": false,
592 - "legendFormat": "Num Swapped",
593 - "range": true,
594 - "refId": "B",
595 - "useBackend": false
596 - },
580 {
581 "datasource": {
582 "type": "prometheus",
@@ -874,19 +857,6 @@
857 "legendFormat": "GPU Cache Usage",
858 "range": true,
859 "refId": "A"
877 - },
878 - {
879 - "datasource": {
880 - "type": "prometheus",
881 - "uid": "${DS_PROMETHEUS}"
882 - },
883 - "editorMode": "code",
884 - "expr": "vllm:cpu_cache_usage_perc{model_name=\"$model_name\"}",
885 - "hide": false,
886 - "instant": false,
887 - "legendFormat": "CPU Cache Usage",
888 - "range": true,
889 - "refId": "B"
860 }
861 ],
862 "title": "Cache Utilization",
tests/entrypoints/openai/test_metrics.py
+1 -6
@@ -171,10 +171,8 @@ async def test_metrics_counts(server: RemoteOpenAIServer,
171
172 EXPECTED_METRICS = [
173 "vllm:num_requests_running",
174 - "vllm:num_requests_swapped", # deprecated
174 "vllm:num_requests_waiting",
175 "vllm:gpu_cache_usage_perc",
177 - "vllm:cpu_cache_usage_perc", # deprecated
176 "vllm:time_to_first_token_seconds_sum",
177 "vllm:time_to_first_token_seconds_bucket",
178 "vllm:time_to_first_token_seconds_count",
@@ -274,10 +272,7 @@ EXPECTED_METRICS_V1 = [
272 "vllm:request_decode_time_seconds_count",
273 ]
274
277 -HIDDEN_DEPRECATED_METRICS = [
278 - "vllm:num_requests_swapped",
279 - "vllm:cpu_cache_usage_perc",
280 -]
275 +HIDDEN_DEPRECATED_METRICS: list[str] = []
276
277
278 @pytest.mark.asyncio
vllm/engine/llm_engine.py
-15
@@ -1680,9 +1680,6 @@ class LLMEngine:
1680 time_inference_requests: List[float] = []
1681 time_prefill_requests: List[float] = []
1682 time_decode_requests: List[float] = []
1683 - time_in_queue_requests: List[float] = []
1684 - model_forward_time_requests: List[float] = []
1685 - model_execute_time_requests: List[float] = []
1683 # Metadata
1684 num_prompt_tokens_requests: List[int] = []
1685 num_generation_tokens_requests: List[int] = []
@@ -1790,15 +1787,6 @@ class LLMEngine:
1787 now - seq_group.metrics.first_token_time)
1788 time_inference_requests.append(
1789 now - seq_group.metrics.first_scheduled_time)
1793 - if seq_group.metrics.time_in_queue is not None:
1794 - time_in_queue_requests.append(
1795 - seq_group.metrics.time_in_queue)
1796 - if seq_group.metrics.model_forward_time is not None:
1797 - model_forward_time_requests.append(
1798 - seq_group.metrics.model_forward_time)
1799 - if seq_group.metrics.model_execute_time is not None:
1800 - model_execute_time_requests.append(
1801 - seq_group.metrics.model_execute_time * 1000)
1790 # Metadata
1791 num_prompt_tokens_requests.append(
1792 len(seq_group.prompt_token_ids))
@@ -1867,9 +1855,6 @@ class LLMEngine:
1855 time_inference_requests=time_inference_requests,
1856 time_prefill_requests=time_prefill_requests,
1857 time_decode_requests=time_decode_requests,
1870 - time_in_queue_requests=time_in_queue_requests,
1871 - model_forward_time_requests=model_forward_time_requests,
1872 - model_execute_time_requests=model_execute_time_requests,
1858 # Metadata
1859 num_prompt_tokens_requests=num_prompt_tokens_requests,
1860 num_generation_tokens_requests=num_generation_tokens_requests,
vllm/engine/metrics.py
-89
@@ -80,17 +80,6 @@ class Metrics:
80 multiprocess_mode="livemostrecent",
81 )
82
83 - # Deprecated in 0.8 - KV cache offloading is not used in V1
84 - # Hidden in 0.9, due to be removed in 0.10
85 - if self.show_hidden_metrics:
86 - self.gauge_scheduler_swapped = self._gauge_cls(
87 - name="vllm:num_requests_swapped",
88 - documentation=(
89 - "Number of requests swapped to CPU. "
90 - "DEPRECATED: KV cache offloading is not used in V1"),
91 - labelnames=labelnames,
92 - multiprocess_mode="sum")
93 -
83 # KV Cache Usage in %
84 self.gauge_gpu_cache_usage = self._gauge_cls(
85 name="vllm:gpu_cache_usage_perc",
@@ -98,35 +87,6 @@ class Metrics:
87 labelnames=labelnames,
88 multiprocess_mode="sum")
89
101 - # Deprecated in 0.8 - KV cache offloading is not used in V1
102 - # Hidden in 0.9, due to be removed in 0.10
103 - if self.show_hidden_metrics:
104 - self.gauge_cpu_cache_usage = self._gauge_cls(
105 - name="vllm:cpu_cache_usage_perc",
106 - documentation=(
107 - "CPU KV-cache usage. 1 means 100 percent usage. "
108 - "DEPRECATED: KV cache offloading is not used in V1"),
109 - labelnames=labelnames,
110 - multiprocess_mode="sum")
111 - self.gauge_cpu_prefix_cache_hit_rate = self._gauge_cls(
112 - name="vllm:cpu_prefix_cache_hit_rate",
113 - documentation=(
114 - "CPU prefix cache block hit rate. "
115 - "DEPRECATED: KV cache offloading is not used in V1"),
116 - labelnames=labelnames,
117 - multiprocess_mode="sum")
118 -
119 - # Deprecated in 0.8 - replaced by queries+hits counters in V1
120 - # Hidden in 0.9, due to be removed in 0.10
121 - if self.show_hidden_metrics:
122 - self.gauge_gpu_prefix_cache_hit_rate = self._gauge_cls(
123 - name="vllm:gpu_prefix_cache_hit_rate",
124 - documentation=("GPU prefix cache block hit rate. "
125 - "DEPRECATED: use vllm:gpu_prefix_cache_queries "
126 - "and vllm:gpu_prefix_cache_queries in V1"),
127 - labelnames=labelnames,
128 - multiprocess_mode="sum")
129 -
90 # Iteration stats
91 self.counter_num_preemption = self._counter_cls(
92 name="vllm:num_preemptions_total",
@@ -200,36 +160,6 @@ class Metrics:
160 "Histogram of time spent in DECODE phase for request.",
161 labelnames=labelnames,
162 buckets=request_latency_buckets)
203 - # Deprecated in 0.8 - duplicates vllm:request_queue_time_seconds:
204 - # Hidden in 0.9, due to be removed in 0.10
205 - if self.show_hidden_metrics:
206 - self.histogram_time_in_queue_request = self._histogram_cls(
207 - name="vllm:time_in_queue_requests",
208 - documentation=
209 - ("Histogram of time the request spent in the queue in seconds. "
210 - "DEPRECATED: use vllm:request_queue_time_seconds instead."),
211 - labelnames=labelnames,
212 - buckets=request_latency_buckets)
213 -
214 - # Deprecated in 0.8 - use prefill/decode/inference time metrics
215 - # Hidden in 0.9, due to be removed in 0.10
216 - if self.show_hidden_metrics:
217 - self.histogram_model_forward_time_request = self._histogram_cls(
218 - name="vllm:model_forward_time_milliseconds",
219 - documentation=
220 - ("Histogram of time spent in the model forward pass in ms. "
221 - "DEPRECATED: use prefill/decode/inference time metrics instead"
222 - ),
223 - labelnames=labelnames,
224 - buckets=build_1_2_3_5_8_buckets(3000))
225 - self.histogram_model_execute_time_request = self._histogram_cls(
226 - name="vllm:model_execute_time_milliseconds",
227 - documentation=
228 - ("Histogram of time spent in the model execute function in ms."
229 - "DEPRECATED: use prefill/decode/inference time metrics instead"
230 - ),
231 - labelnames=labelnames,
232 - buckets=build_1_2_3_5_8_buckets(3000))
163
164 # Metadata
165 self.histogram_num_prompt_tokens_request = self._histogram_cls(
@@ -580,20 +510,10 @@ class PrometheusStatLogger(StatLoggerBase):
510 # System state data
511 self._log_gauge(self.metrics.gauge_scheduler_running,
512 stats.num_running_sys)
583 - if self.metrics.show_hidden_metrics:
584 - self._log_gauge(self.metrics.gauge_scheduler_swapped,
585 - stats.num_swapped_sys)
513 self._log_gauge(self.metrics.gauge_scheduler_waiting,
514 stats.num_waiting_sys)
515 self._log_gauge(self.metrics.gauge_gpu_cache_usage,
516 stats.gpu_cache_usage_sys)
590 - if self.metrics.show_hidden_metrics:
591 - self._log_gauge(self.metrics.gauge_cpu_cache_usage,
592 - stats.cpu_cache_usage_sys)
593 - self._log_gauge(self.metrics.gauge_cpu_prefix_cache_hit_rate,
594 - stats.cpu_prefix_cache_hit_rate)
595 - self._log_gauge(self.metrics.gauge_gpu_prefix_cache_hit_rate,
596 - stats.gpu_prefix_cache_hit_rate)
517 # Including max-lora in metric, in future this property of lora
518 # config maybe extended to be dynamic.
519 lora_info = {
@@ -631,15 +551,6 @@ class PrometheusStatLogger(StatLoggerBase):
551 stats.time_prefill_requests)
552 self._log_histogram(self.metrics.histogram_decode_time_request,
553 stats.time_decode_requests)
634 - if self.metrics.show_hidden_metrics:
635 - self._log_histogram(self.metrics.histogram_time_in_queue_request,
636 - stats.time_in_queue_requests)
637 - self._log_histogram(
638 - self.metrics.histogram_model_forward_time_request,
639 - stats.model_forward_time_requests)
640 - self._log_histogram(
641 - self.metrics.histogram_model_execute_time_request,
642 - stats.model_execute_time_requests)
554 # Metadata
555 finished_reason_counter = CollectionsCounter(
556 stats.finished_reason_requests)
vllm/engine/metrics_types.py
-3
@@ -53,9 +53,6 @@ class Stats:
53 time_inference_requests: List[float]
54 time_prefill_requests: List[float]
55 time_decode_requests: List[float]
56 - time_in_queue_requests: List[float]
57 - model_forward_time_requests: List[float]
58 - model_execute_time_requests: List[float]
56 # Metadata
57 num_prompt_tokens_requests: List[int]
58 num_generation_tokens_requests: List[int]