Skip to content

Conversation

ojeda-e
Copy link
Contributor

@ojeda-e ojeda-e commented Oct 20, 2025

This PR complements the work in #1933 to modernize codebase with +3.10, now covering type hints:

  • src/llmcompressor/args/*.py - Dataclass arguments (5 files)
  • src/llmcompressor/recipe/metadata.py - Recipe metadata (1 file)

make test and make style passing.

@github-actions
Copy link

👋 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 @ojeda-e, 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 continues the codebase modernization effort by updating type hints to leverage Python 3.10+ features. The primary goal is to enhance the readability and consistency of type annotations within dataclass arguments and recipe metadata structures, ensuring the code adheres to contemporary Python best practices for type safety and clarity.

Highlights

  • Type Hint Modernization: Updated type hints across dataclass arguments in src/llmcompressor/args/*.py files and recipe metadata in src/llmcompressor/recipe/metadata.py. The changes replace older typing.Optional[X] and typing.Union[X, Y] syntaxes with the more modern and concise X | Y syntax, available since Python 3.10.
  • Import Clean-up: Removed unnecessary imports from the typing module, such as Dict, List, Optional, and Union, as their native Python counterparts (e.g., dict, list, X | None) are now used directly.
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 effectively modernizes the type hints across the codebase to align with Python 3.10+ standards, replacing Optional, Union, List, and Dict with their modern counterparts (|, list, dict). This significantly improves code readability and maintainability. The changes are consistent and well-executed. I've added a couple of suggestions to further enhance type specificity in one of the files, building upon the great work already done.

@ojeda-e ojeda-e force-pushed the issue-1927-type-hints branch from 75167f3 to a1b90f3 Compare October 20, 2025 13:27
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! This looks good to me, the places that were updated (e.g. changing TrainingArguments return type to TrainingArguments | None) all look appropriate

@brian-dellabetta brian-dellabetta added the ready When a PR is ready for review label Oct 20, 2025
@ojeda-e
Copy link
Contributor Author

ojeda-e commented Oct 20, 2025

Thanks @brian-dellabetta,
The tests pass locally but they are failing in the CI, unrelated to the changes in this PR though, it errors out while installing dev deps. It looks like I can't re run the test either. Since this is my first contribution to the project, is there anything else I should do for the tests? I will keep an eye for additional reviews and request for changes, but I wonder if from my side I can do anything else for the tests in the CI.

@brian-dellabetta
Copy link
Collaborator

Thanks @brian-dellabetta, The tests pass locally but they are failing in the CI, unrelated to the changes in this PR though, it errors out while installing dev deps. It looks like I can't re run the test either. Since this is my first contribution to the project, is there anything else I should do for the tests? I will keep an eye for additional reviews and request for changes, but I wonder if from my side I can do anything else for the tests in the CI.

Thanks @ojeda-e , I'm looking into the CI issue, a new dependency version must be breaking things. Everything looks good in your changes

kylesayrs
kylesayrs previously approved these changes Oct 20, 2025
fynnsu
fynnsu previously approved these changes Oct 20, 2025
Copy link
Collaborator

@fynnsu fynnsu left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the pr!

@brian-dellabetta brian-dellabetta enabled auto-merge (squash) October 21, 2025 19:52
@brian-dellabetta brian-dellabetta dismissed stale reviews from kylesayrs, fynnsu, and themself via a9fb590 October 21, 2025 22:28
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.

Updated to resolve some broken tests

Copy link
Collaborator

@HDCharles HDCharles left a comment

Choose a reason for hiding this comment

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

Looks good

@brian-dellabetta brian-dellabetta merged commit fb1588b into vllm-project:main Oct 22, 2025
9 checks passed
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.

5 participants