-
Notifications
You must be signed in to change notification settings - Fork 493
[Docs]: update metric names for clarity and consistency #1822
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
base: main
Are you sure you want to change the base?
[Docs]: update metric names for clarity and consistency #1822
Conversation
…oss multiple files - Updated autoscaling configurations (apa.yaml, hpa.yaml, kpa.yaml, etc.) to use kv_cache_usage_perc instead of gpu_cache_usage_perc. - Modified application code (app.py, metrics.py, etc.) to reflect the new metric name. - Adjusted documentation and README files to align with the metric changes. - Updated tests and mock contexts to ensure compatibility with the new metric. - Reflected changes in Grafana dashboards and JSON configurations for observability. Signed-off-by: Tim <[email protected]>
Summary of ChangesHello @haitwang-cloud, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request systematically updates all references to a previously deprecated metric, Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly updates the metric name from gpu_cache_usage_perc to kv_cache_usage_perc across a large number of files. The changes are mostly consistent and well-executed. However, I've identified a few areas for improvement to enhance clarity and consistency further:
- Metric Value Inconsistency: There's a notable inconsistency in how the
kv_cache_usage_percmetric is used. In some configuration and test files, it's treated as a ratio (0-1), while in others, it's a percentage (0-100). The_percsuffix and the implementation indevelopment/app/app.pysuggest it should be a percentage. I've added comments to standardize this to a percentage value (0-100) across all relevant files. - Constant Naming: In
pkg/metrics/metrics.go, the constant for this metric is still namedGPUCacheUsagePerc, which is now misleading. I've suggested renaming it toKVCacheUsagePerc. - Grafana Dashboards: The legends in some Grafana dashboard files (
observability/grafana/AIBrix_vLLM_Engine_Dashboard.jsonandsamples/deepseek-r1/static/AIBrix Engine Dashboard (vLLM)-1741078999667.json) still refer to 'GPU Cache Usage'. While I couldn't comment directly on these lines as they weren't in the diff, updating them to 'KV Cache Usage' would improve consistency.
Addressing these points will help solidify the clarity and consistency this pull request aims to achieve.
| path: metrics | ||
| targetMetric: gpu_cache_usage_perc | ||
| targetMetric: kv_cache_usage_perc | ||
| targetValue: '0.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| path: metrics | ||
| targetMetric: gpu_cache_usage_perc | ||
| targetMetric: kv_cache_usage_perc | ||
| targetValue: '0.5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| path: metrics | ||
| targetMetric: gpu_cache_usage_perc | ||
| targetMetric: kv_cache_usage_perc | ||
| targetValue: '0.5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| path: metrics | ||
| targetMetric: gpu_cache_usage_perc | ||
| targetMetric: kv_cache_usage_perc | ||
| targetValue: '0.5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| path: metrics | ||
| targetMetric: gpu_cache_usage_perc | ||
| targetMetric: kv_cache_usage_perc | ||
| targetValue: '0.5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ScaleTargetRefWithKind("Deployment", "apps/v1", "cooldown-deployment"). | ||
| MetricSource(wrapper.MakeMetricSourcePod( | ||
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "gpu_cache_usage_perc", "0.5")). | ||
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "0.5")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target value is 0.5, which suggests a ratio. However, the metric kv_cache_usage_perc seems to be a percentage (0-100) in other parts of the codebase. For consistency, should this be 50?
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "0.5")). | |
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "50")). |
| ScaleTargetRefWithKind("Deployment", "apps/v1", "delay-deployment"). | ||
| MetricSource(wrapper.MakeMetricSourcePod( | ||
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "gpu_cache_usage_perc", "0.5")). | ||
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "0.5")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target value is 0.5, which suggests a ratio. However, the metric kv_cache_usage_perc seems to be a percentage (0-100) in other parts of the codebase. For consistency, should this be 50?
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "0.5")). | |
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "50")). |
| ScaleTargetRefWithKind("Deployment", "apps/v1", "annotations-deployment"). | ||
| MetricSource(wrapper.MakeMetricSourcePod( | ||
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "gpu_cache_usage_perc", "0.5")). | ||
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "0.5")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target value is 0.5, which suggests a ratio. However, the metric kv_cache_usage_perc seems to be a percentage (0-100) in other parts of the codebase. For consistency, should this be 50?
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "0.5")). | |
| autoscalingv1alpha1.HTTP, "8080", "/metrics", "kv_cache_usage_perc", "50")). |
| ScaleTargetRefWithKind("Deployment", "apps/v1", "test"). | ||
| MetricSource(wrapper.MakeMetricSourcePod(autoscalingapi.HTTP, | ||
| "8080", "/metrics", "gpu_cache_usage_perc", "0.5")). | ||
| "8080", "/metrics", "kv_cache_usage_perc", "0.5")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target value is 0.5, which suggests a ratio. However, the metric kv_cache_usage_perc seems to be a percentage (0-100) in other parts of the codebase. For consistency, should this be 50?
| "8080", "/metrics", "kv_cache_usage_perc", "0.5")). | |
| "8080", "/metrics", "kv_cache_usage_perc", "50")). |
| ScaleTargetRefWithKind("Deployment", "apps/v1", "test-ss"). | ||
| MetricSource(wrapper.MakeMetricSourceExternal(autoscalingapi.HTTP, | ||
| "monitoring.example.com", "/metrics", "gpu_cache_usage_perc", "0.5")). | ||
| "monitoring.example.com", "/metrics", "kv_cache_usage_perc", "0.5")). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target value is 0.5, which suggests a ratio. However, the metric kv_cache_usage_perc seems to be a percentage (0-100) in other parts of the codebase. For consistency, should this be 50?
| "monitoring.example.com", "/metrics", "kv_cache_usage_perc", "0.5")). | |
| "monitoring.example.com", "/metrics", "kv_cache_usage_perc", "50")). |
|
part of: #1815 |
|
I’ve become aware of this issue recently and will put it upstream to the sglang/vLLM maintainers. |
|
I think right now, we lack of mechanisim to make control plane compatible with engine changes. this is a design problem |
some thought: https://github.com/vllm-project/aibrix/pull/1814/files#r2591433626 |
|
@googs1025 @Jeffwan Thanks so much for commenting! I wholeheartedly agree that it's of utmost importance to request the upstream (vLLM/SGLang) to maintain metric compatibility. It's super crucial for all LLM users. |
|
could i know which version introduced |
|
@googs1025 we should consider to allow user to annotate version on pod and then support |
At least from V.10.*, cause this PR vllm-project/vllm#18354 was merged in May 2025 |
| MetricSource: PodRawMetrics, | ||
| MetricType: MetricType{Raw: Gauge}, | ||
| EngineMetricsNameMapping: map[string]string{ | ||
| "vllm": "vllm_gpu_cache_usage_perc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz remove this part. We need a fallback mechanism; if we make this change, the value won't be available in versions prior to v0.10.0. This will be supported in this pr #1814
Pull Request Description
In vllm-project/vllm#18354, the
vllm:gpu_cache_usage_percmetric was deprecated andvllm:kv_cache_usage_percwas introduced as its replacement.See also vllm-project/vllm#27133
Related Issues
Resolves: #[Insert issue number(s)]
Important: Before submitting, please complete the description above and review the checklist below.
Contribution Guidelines (Expand for Details)
We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:
Pull Request Title Format
Your PR title should start with one of these prefixes to indicate the nature of the change:
[Bug]: Corrections to existing functionality[CI]: Changes to build process or CI pipeline[Docs]: Updates or additions to documentation[API]: Modifications to aibrix's API or interface[CLI]: Changes or additions to the Command Line Interface[Misc]: For changes not covered above (use sparingly)Note: For changes spanning multiple categories, use multiple prefixes in order of importance.
Submission Checklist
By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.