Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V0][Metrics] Deprecate some KV/prefix cache metrics #14136

Conversation

markmc
Copy link
Contributor

@markmc markmc commented Mar 3, 2025

vllm:num_requests_swapped, vllm:cpu_cache_usage_perc and vllm:cpu_prefix_cache_hit_rate will no longer be relevant in V1 since we no longer implement KV cache offloading. So these metrics should be considered deprecated.

And as agreed in #12592, we have added prefix_cache_queries and prefix_cache_hits counters to replace the prefix_cache_hit_rate gauge as it allows the interval over which the hit rate is calculated to be controlled in a Prometheus query like:

rate(prefix_cache_queries[5m]) / rate(prefix_cache_hits[5m])

In theory, we could ease the transition be implementing the old hit rate metric in V1 and the new queries/hits metrics in V0, but it's probably not worthwhile unless we learn the hit rate metric is heavily used by V0 users.

Copy link

github-actions bot commented Mar 3, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

vllm:num_requests_swapped, vllm:cpu_cache_usage_perc and
vllm:cpu_prefix_cache_hit_rate will no longer be relevant in
V1 since we no longer implement KV cache offloading. So
these metrics should be considered deprecated.

And as agreed in vllm-project#12592, we have added prefix_cache_queries and
prefix_cache_hits counters to replace the prefix_cache_hit_rate
gauge as it allows the interval over which the hit rate is
calculated to be controlled in a Prometheus query like:

```
rate(prefix_cache_queries[5m]) / rate(prefix_cache_hits[5m])
```

In theory, we could ease the transition be implementing the
old hit rate metric in V1 and the new queries/hits metrics
in V0, but it's probably not worthwhile unless we learn the
hit rate metric is heavily used by V0 users.

Signed-off-by: Mark McLoughlin <[email protected]>
@markmc markmc force-pushed the metrics-v1-deprecate-prefix-cache-hit-rate branch from e89b9fe to a2ec1f5 Compare March 3, 2025 13:09
@robertgshaw2-redhat robertgshaw2-redhat enabled auto-merge (squash) March 3, 2025 17:04
@robertgshaw2-redhat robertgshaw2-redhat added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 3, 2025
@robertgshaw2-redhat robertgshaw2-redhat merged commit 2dfdfed into vllm-project:main Mar 3, 2025
52 checks passed
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Mar 5, 2025
johnnynunez pushed a commit to johnnynunez/vllm that referenced this pull request Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants