Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@pallasathena92
Copy link
Collaborator

What type of PR is this?

/kind feature
/kind design

What this PR does / why we need it:

Add awareness acceleratorClass in runtiem matcher and selector.

  • The main logic is:
  1. when inference service has annotation about AC, the runtime needs to match it
  2. when inference service has acceleratorSelector, the runtime needs to match it
  3. when engine has acceleratorOverride, the runtime needs to match it
  4. when decoder has acceleratorOverride, the runtime needs to match it
  • Add unit test for the logic

Does this PR introduce a user-facing change?

None. All components in crd is optional. if customer doesn't declear it, their experience won't be impact.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @pallasathena92, 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 significantly enhances the runtime selection mechanism by introducing awareness of accelerator classes. It allows InferenceServices to declare specific hardware requirements, which the system then uses to intelligently match against available ServingRuntimes. This ensures that models are deployed on compatible and optimized hardware, improving the efficiency and reliability of model serving. The changes involve updating the runtime matcher and selector logic, along with comprehensive testing to validate the new functionality.

Highlights

  • Accelerator Class Awareness: Introduced logic to make the runtime selector aware of AcceleratorClasses when matching InferenceServices to ServingRuntimes.
  • Flexible Accelerator Specification: The system now considers accelerator class requirements specified through InferenceService annotations, acceleratorSelector, engine.acceleratorOverride, and decoder.acceleratorOverride.
  • Refactored Runtime Selection Methods: Updated core runtime selection and validation methods (SelectRuntime, ValidateRuntime, IsCompatible, GetCompatibilityDetails) to accept the full InferenceService object, enabling richer matching criteria.
  • Comprehensive Unit Testing: Added extensive unit tests to cover various scenarios for accelerator class matching, ensuring the new logic functions as expected.
  • Dependency Cleanup: Performed a significant cleanup of unused Go module dependencies in go.sum, reducing the project's dependency footprint.
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 introduces accelerator class awareness to the runtime selection logic. The changes correctly propagate the InferenceService object through the selector and matcher functions to allow for this new compatibility check. However, I've found a critical bug in the new accelerator matching logic that could lead to incorrect runtime selection. I've provided a detailed comment with a suggested fix to address this issue and improve the code's readability.

pkg/runtimeselector/matcher.go Show resolved Hide resolved
@pallasathena92 pallasathena92 removed the request for review from CatherineSue September 26, 2025 00:51
@slin1237 slin1237 merged commit 196171d into main Sep 26, 2025
24 checks passed
@zhyncs zhyncs deleted the yifeliu/runtiemselector branch October 4, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.