Skip to content

Conversation

@sugatmahanti
Copy link
Contributor

SUMMARY:
This is part of #1927

Modernize type annotations using | operator and built-in generics in the metrics module as part of codebase modernization effort.

I also fixed typo for the function name SystemLoggingWraper -> SystemLoggingWrapper as part of this PR.

TEST PLAN:

make style
make quality
make tests

Notes:
Happy to address any comments! Thank you!

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sugatmahanti, 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 modernizes the type annotations within the metrics module, aligning them with contemporary Python syntax by utilizing the | operator for unions and optionals, and built-in generic types. This effort contributes to a broader codebase modernization initiative, enhancing readability and maintainability. Additionally, a minor but important typo in a class name has been corrected.

Highlights

  • Type Annotation Modernization: Updated type annotations across the metrics module to use the | operator for Union and Optional types, and built-in generic types like dict and list.
  • Typo Correction: Fixed a typo in the class name SystemLoggingWraper, renaming it to SystemLoggingWrapper.
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 does a great job of modernizing the type hints in the metrics module, which significantly improves code clarity and maintainability. The typo fix for SystemLoggingWrapper is also a welcome correction. I've identified a few areas where the type hints could be further improved for better type safety and consistency. Specifically, several log_hyperparams methods could use a more specific dict type, and some deprecated methods in LoggerManager have type hints that could lead to runtime errors. Additionally, there's an opportunity to simplify some redundant type hints in frequency_manager.py. My detailed comments and suggestions are below.

@sugatmahanti
Copy link
Contributor Author

I will update Structural Pattern Matching for this module in a follow up commit

@sugatmahanti
Copy link
Contributor Author

I will also address the comments by Gemini as well in a follow up commit.

Copy link
Collaborator

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

thanks for the contribution. The gemini comments look appropriate to me

@sugatmahanti sugatmahanti force-pushed the issue-1927-modernize-metrics branch from c3be9a4 to 2637edf Compare November 9, 2025 22:14
@sugatmahanti
Copy link
Contributor Author

@brian-dellabetta I have addressed all the gemini comments and added Structural Pattern Matching for one of the if-else isinstance chains. Happy to address any other comments! Thanks for the review

Copy link
Collaborator

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

thanks for the contribution!

@brian-dellabetta brian-dellabetta added the ready When a PR is ready for review label Nov 10, 2025
@sugatmahanti
Copy link
Contributor Author

It seems like the test failure is unrelated to my change. I see it is failing in other PRs too.

@brian-dellabetta
Copy link
Collaborator

It seems like the test failure is unrelated to my change. I see it is failing in other PRs too.

yes, will try to merge this in after the fixes to our failing ci/cd tests are resolved

@brian-dellabetta brian-dellabetta merged commit 66ba262 into vllm-project:main Nov 11, 2025
9 checks passed
@sugatmahanti
Copy link
Contributor Author

@brian-dellabetta Thank you so much! Appreciate it.

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

Labels

ready When a PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants