Skip to content

Add report building#216

Merged
nv-alicheng merged 4 commits intofeat/alicheng-pubsub-integrationfrom
feat/alicheng-report-building
Apr 1, 2026
Merged

Add report building#216
nv-alicheng merged 4 commits intofeat/alicheng-pubsub-integrationfrom
feat/alicheng-report-building

Conversation

@nv-alicheng
Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds functionality to build a report like legacy MetricsReporter from the MetricsAggregator service.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

@nv-alicheng nv-alicheng requested a review from a team as a code owner March 26, 2026 01:14
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@github-actions github-actions bot requested review from arekay-nv and nvzhihanj March 26, 2026 01:14
@gemini-code-assist
Copy link
Copy Markdown

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 introduces a new, streamlined reporting system for benchmark metrics, designed to replace the older, more complex MetricsReporter. The new system simplifies metric aggregation and processing by directly utilizing data from a KVStore, avoiding the overhead of SQL databases and UUID tracking. It provides a clear, structured way to generate benchmark reports, offering both human-readable output and JSON serialization, thereby enhancing the overall efficiency and clarity of the metrics infrastructure.

Highlights

  • New Report Module: Introduced a new report module for benchmark result summarization, display, and JSON serialization, replacing the legacy MetricsReporter.
  • Simplified Metrics Processing: Implemented a compute_summary function for efficient rollup statistics, including percentiles and histograms, directly from metric values, eliminating the need for complex SQL queries and UUID tracking.
  • Structured Report Generation: Added a Report dataclass to store summarized benchmark results, including calculated QPS and TPS, and provided methods for human-readable display and JSON output.
  • KVStore Integration: Developed a build_report function that constructs Report objects by reading snapshots from the BasicKVStoreReader, ensuring compatibility with both live and final metrics.
  • Comprehensive Testing: Included unit tests for the compute_summary function, the Report class, and the build_report functionality to ensure correctness and reliability.

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

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.

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
Copy Markdown

@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 introduces a new, simplified metrics reporting system. It includes a compute_summary function for statistical rollups, a Report dataclass to hold benchmark results, and a build_report function to construct reports from KVStore data. The changes also include comprehensive unit tests and design documentation. Feedback suggests improving robustness by using zip(..., strict=True) in compute_summary and _display_metric to prevent potential length mismatches, and ensuring consistency in the Report dataclass by having the tps property return 0.0 instead of None when the total output sequence length is zero.

Comment thread src/inference_endpoint/metrics/report.py Outdated
Comment thread src/inference_endpoint/metrics/report.py Outdated
Comment thread src/inference_endpoint/metrics/report.py Outdated
Comment thread src/inference_endpoint/metrics/report_builder.py Outdated
Comment thread src/inference_endpoint/metrics/report.py
@nvzhihanj
Copy link
Copy Markdown
Collaborator

Review Council — Multi-AI Code Review

Reviewed by: Claude | Depth: standard

Found 2 issues across 2 files:

  • 0 high
  • 2 medium
# File Line Severity Category Summary
1 report_builder.py 40 medium data-integrity Float default in _counter risks precision loss for nanosecond timestamps
2 report.py 119 medium data-integrity arr.std() uses population std (ddof=0) — sample std (ddof=1) more appropriate

🤖 Generated with Claude Code

Comment thread src/inference_endpoint/metrics/report.py Outdated
Comment thread src/inference_endpoint/metrics/report.py
@nv-alicheng nv-alicheng force-pushed the feat/alicheng-kvstore branch from fd7b4ed to b3e80eb Compare March 31, 2026 00:07
@nv-alicheng nv-alicheng changed the base branch from feat/alicheng-kvstore to feat/alicheng-pubsub-integration March 31, 2026 03:50
@nv-alicheng nv-alicheng force-pushed the feat/alicheng-report-building branch from e765e6a to cd3c3f7 Compare March 31, 2026 03:55
Copy link
Copy Markdown
Collaborator Author

@nv-alicheng nv-alicheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Council — Multi-AI Code Review

Reviewed by: Claude (Codex unavailable) | Depth: standard

Found 3 issues across 2 files:

  • 2 medium
  • 1 low
# File Line Severity Category Summary
1 report_builder.py 55 medium performance _summarize copies all raw values into numpy for every series metric. At 50k+ QPS over 60s, that's
2 report.py 127 medium performance dataclasses.asdict(self) deep-copies every field, then msgspec.json.encode traverses it again. C
3 report.py 222 low data-integrity All histogram buckets display as [lo, hi), but np.histogram's last bin is actually [lo, hi] (i

🤖 Generated with Claude Code

Comment thread src/inference_endpoint/metrics/report_builder.py Outdated
Comment thread src/inference_endpoint/metrics/report.py Outdated
Comment thread src/inference_endpoint/metrics/report.py Outdated
Comment thread src/inference_endpoint/metrics/report_builder.py Outdated
Comment thread src/inference_endpoint/metrics/report.py Outdated
@nv-alicheng nv-alicheng merged commit f15c6f1 into feat/alicheng-pubsub-integration Apr 1, 2026
2 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants