Skip to content

feat: add max-duration-ms=-1 support #209

Merged
viraatc merged 2 commits intomainfrom
feat/viraatc-close-197
Mar 30, 2026
Merged

feat: add max-duration-ms=-1 support #209
viraatc merged 2 commits intomainfrom
feat/viraatc-close-197

Conversation

@viraatc
Copy link
Copy Markdown
Collaborator

@viraatc viraatc commented Mar 25, 2026

What does this PR do?

Close #197

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)

@viraatc viraatc requested a review from a team as a code owner March 25, 2026 03:01
Copilot AI review requested due to automatic review settings March 25, 2026 03:01
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

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

@github-actions github-actions bot requested review from arekay-nv and nvzhihanj March 25, 2026 03:01
@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 significant enhancement to the system's configuration by allowing an unlimited maximum test duration. By enabling max_duration_ms to be set to -1, users can now run benchmarks or tests without an imposed upper time limit, which was previously a constraint. This change improves the adaptability and utility of the system for various testing scenarios, particularly those requiring extended execution times.

Highlights

  • Configuration Update: Introduced support for max_duration_ms = -1 in RuntimeConfig to signify no maximum test duration, enhancing flexibility for long-running benchmarks.
  • Logic Adjustment: Modified the _from_config_default function to correctly interpret max_duration_ms = -1 as None when constructing RuntimeSettings.
  • Validation Refinement: Updated the RuntimeConfig schema to allow max_duration_ms to be -1 and adjusted the validation logic to ensure max_duration_ms is not less than min_duration_ms unless it is -1.
  • Test Coverage: Added new unit tests to verify that max_duration_ms cannot be set below -1 and that -1 is correctly converted to None in the runtime settings.

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

@viraatc viraatc changed the title feat: add max-duration-ms=-1 support (#197) feat: add max-duration-ms=-1 support Mar 25, 2026
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 "no limit" option for max_duration_ms by allowing it to be set to -1. This special value is then converted to None in RuntimeSettings and is excluded from the min_duration_ms validation. New tests have been added to cover this behavior. The review comments suggest replacing the magic number -1 with a named constant for improved readability and maintainability.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for treating max_duration_ms = -1 as “no wall-clock limit” so benchmark runs can continue until samples are exhausted instead of stopping at a fixed timeout.

Changes:

  • Allow max_duration_ms to be -1 in the config schema and relax duration validation accordingly.
  • Convert max_duration_ms = -1 from config into RuntimeSettings.max_duration_ms = None (no timeout).
  • Add unit tests covering rejection of values < -1 and -1 conversion behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/unit/config/test_schema.py Adds unit tests for max_duration_ms < -1 validation and -1 -> None runtime conversion.
src/inference_endpoint/config/schema.py Updates RuntimeConfig.max_duration_ms to allow -1 and adjusts duration validation logic.
src/inference_endpoint/config/runtime_settings.py Maps max_duration_ms == -1 to None in derived RuntimeSettings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nvzhihanj
Copy link
Copy Markdown
Collaborator

Review Council — Multi-AI Code Review

Reviewed by: Codex + Claude | Depth: quick

No new critical/high issues found.

  • Claude: Reviewed the 80-line diff and verified the -1 sentinel handling through RuntimeConfigRuntimeSettings conversion path. The only concern (default change removing safety timeout) is already covered by existing comments.
  • Codex: Proposed 3 findings but all 3 failed Step 3.5 verification — they reference files (factory.py, execute.py, schema.py:242) not changed in this PR.

The existing 5 comments cover the key concerns for this change.

🤖 Generated with Claude Code

Addresses PR feedback: 0 is a more natural sentinel for "no limit"
since -1 could cause issues with duration conversions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@viraatc viraatc merged commit 38551da into main Mar 30, 2026
5 checks passed
@viraatc viraatc deleted the feat/viraatc-close-197 branch March 30, 2026 22:17
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 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.

[Runtime setting] max_duration_ms: Ends online test prematurely (soon as duration is hit).

4 participants