-
Notifications
You must be signed in to change notification settings - Fork 691
[Misc] Add P2P transfer stats gauges to Promethus #1567
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
Conversation
Signed-off-by: chickeyton <[email protected]>
Signed-off-by: chickeyton <[email protected]>
Signed-off-by: chickeyton <[email protected]>
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.
Summary of Changes
Hello @chickeyton, 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 enhances the observability of the LMCache system by adding detailed performance metrics for peer-to-peer cache chunk transfers. It provides insights into the average time taken for chunks to be transferred from both disk and CPU sources, making these statistics available through Prometheus for better monitoring and performance analysis of the distributed caching mechanism.
Highlights
- New P2P Transfer Time Metrics: Introduced new metrics to track the average peer-to-peer transfer time for cache chunks, differentiating between transfers originating from disk and CPU.
- LMCStatsMonitor Integration: Added update functions to
LMCStatsMonitorto record these new p2p transfer times and integrated their calculation into the statistics aggregation process. - Prometheus Reporting: Exposed the new average p2p transfer times as Prometheus gauges, allowing for external monitoring and analysis of these critical performance indicators.
- Distributed Server Instrumentation: Implemented the logic within
NaiveDistributedServerto measure and report p2p transfer times whenever a cache chunk is retrieved, categorizing them by their source (disk or CPU).
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 adds metrics for P2P transfer times to Prometheus, which is a useful addition for observability. The changes are mostly correct, but I've found a bug in the stats calculation and a performance issue due to redundant lookups. My review includes a fix for the bug and a suggestion to improve performance. Overall, good work on enhancing the monitoring capabilities.
Signed-off-by: chickeyton <[email protected]>
Signed-off-by: chickeyton <[email protected]>
|
@chickeyton This is certainly useful. But we might want to hold this for several days as I'm refactoring the P2P code |
I see, I also found the p2p transfer seems not working after rebase |
|
No more needed by TTFT Routing |
An answer to TTFT Routing of vllm for a more accurate TTFT estimation
It measure the average p2p transfer time of chunks (from CPU and Disk) and report by the Promethus mechanism
Actual Code Changes
LMCStatsMonitorfor recording P2P transfer time from CPU/Disk for each cache chunkLMCStatsMonitorinNaiveDistributedServerafter transferring a cache chunk to other peer.lmcache:avg_p2p_transfer_time_from_diskandlmcache:avg_p2p_transfer_time_from_cpugauges to Promethus for reportingTesting
/metrics:PR Checklist (Click to Expand)
Thank you for your contribution to LMCache! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]for bug fixes.[CI/Build]for build or continuous integration improvements.[Doc]for documentation fixes and improvements.[Model]for adding a new model or improving an existing model. Model name should appear in the title.[Core]for changes in the core LMCache logic (e.g.,LMCacheEngine,Backendetc.)[Misc]for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
What to Expect for the Reviews
We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of KuntaiDu, ApostaC or YaoJiayi.