Skip to content

feat: integrate trtllm metrics#2005

Open
varungup90 wants to merge 1 commit intovllm-project:mainfrom
varungup90:feat/integrate-trtllm-metrics
Open

feat: integrate trtllm metrics#2005
varungup90 wants to merge 1 commit intovllm-project:mainfrom
varungup90:feat/integrate-trtllm-metrics

Conversation

@varungup90
Copy link
Collaborator

Pull Request Description

  • update config to include
return_perf_metrics: true
enable_iter_perf_stats: true
enable_iter_req_stats: true

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

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

Signed-off-by: varungupta <varungup90@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 integrates TensorRT-LLM (trtllm) specific metrics into the system, enhancing observability for deployments using this engine. It introduces a mechanism to correctly fetch metrics from trtllm's distinct Prometheus endpoint and maps several critical performance metrics to their trtllm equivalents. Additionally, it updates sample deployment configurations to ensure these new performance metrics are enabled by default, providing richer insights into trtllm's operational performance.

Highlights

  • Dynamic Metrics Path Handling: Introduced a new utility function to dynamically determine the Prometheus metrics endpoint path based on the engine type, specifically accommodating trtllm's unique /prometheus/metrics path, and updated existing metric fetching functions to utilize this.
  • TensorRT-LLM Metric Integration: Extended metric mapping configurations to include TensorRT-LLM (trtllm) for key performance indicators such as successful requests, end-to-end latency, request queue time, time to first token, and time per output token.
  • Enabled Performance Metrics in Samples: Updated sample TensorRT deployment configurations to enable detailed performance metrics collection, including iteration-level statistics and request statistics, by setting relevant flags in the trtllm-serve command.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • pkg/metrics/engine_fetcher.go
    • Added metricsPathForEngine function to determine the correct Prometheus metrics path.
    • Updated FetchTypedMetric to use metricsPathForEngine for URL construction.
    • Updated FetchAllTypedMetrics to use metricsPathForEngine for URL construction.
  • pkg/metrics/metrics.go
    • Added trtllm mapping for num_requests_success_total.
    • Added trtllm mapping for e2e_request_latency_seconds.
    • Added trtllm mapping for request_queue_time_seconds.
    • Added trtllm mapping for time_to_first_token_seconds.
    • Added trtllm mapping for time_per_output_token_seconds.
    • Added trtllm mapping for inter_token_latency_seconds.
  • samples/quickstart/tensorrt/tensor-rt-pd.yaml
    • Enabled return_perf_metrics, enable_iter_perf_stats, enable_iter_req_stats, and perf_metrics_max_requests in the configuration.
  • samples/quickstart/tensorrt/tensor-rt.yaml
    • Added a temporary config file (/tmp/config.yaml) to enable return_perf_metrics, enable_iter_perf_stats, enable_iter_req_stats, and perf_metrics_max_requests for trtllm-serve.
Activity
  • No specific review comments or activities have been recorded yet for this pull request.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 integrates metrics from the trtllm engine. The changes include adding a helper function to determine the correct metrics endpoint path for trtllm, updating the metrics definitions to include trtllm specific metric names, and enabling metrics collection in the sample YAML configurations for trtllm. The implementation is straightforward. I've added one suggestion to improve maintainability by using a constant for the engine type string, which is now used across multiple files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant