Skip to content

[CI][Temp fix] make threshold a soft fail for multiprocessing test#2661

Merged
KuntaiDu merged 2 commits intoLMCache:devfrom
ApostaC:local-dev/mp-ci-fix-feb28
Mar 1, 2026
Merged

[CI][Temp fix] make threshold a soft fail for multiprocessing test#2661
KuntaiDu merged 2 commits intoLMCache:devfrom
ApostaC:local-dev/mp-ci-fix-feb28

Conversation

@ApostaC
Copy link
Copy Markdown
Contributor

@ApostaC ApostaC commented Feb 28, 2026

What this PR does / why we need it:

Special notes for your reviewers:

If applicable:

  • this PR contains user facing changes - docs added
  • this PR contains unit tests

Signed-off-by: ApostaC <yihua98@uchicago.edu>
@ApostaC ApostaC added the mp Buildkite trigger for multi-processing mode test label Feb 28, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

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 adjusts the behavior of the multiprocessing performance test in the CI pipeline. The primary goal is to prevent the entire CI run from failing due to performance regressions that are within a tolerable range, instead issuing a warning. This change allows for better visibility into performance trends without blocking development, treating threshold breaches as warnings rather than hard failures.

Highlights

  • Soft Fail Implementation: Modified the multiprocessing-test script to implement a soft-fail mechanism for performance threshold verification. Instead of immediately failing the CI pipeline when performance thresholds are exceeded, the script now logs a warning and allows the pipeline to continue.
  • Performance Metric Tracking: Introduced a global failed flag within the Python script to track if any individual performance metric exceeds its defined threshold (10% slower than baseline). This flag is then used to determine the final exit status of the Python script.
  • Explicit Exit Status: The Python script now explicitly exits with a status of 1 if any performance metric is significantly slower, or 0 if all metrics are within acceptable ranges. This provides a clear indication of the test's outcome.

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

Changelog
  • .buildkite/scripts/multiprocessing-test/run-long-doc-qa.sh
    • Introduced a global failed boolean variable to track performance threshold breaches.
    • Updated the format_comparison function to set the failed flag if LMCache performance is more than 10% slower than the baseline.
    • Added a final check in the Python script to sys.exit(1) if failed is true, indicating a performance regression, or sys.exit(0) otherwise.
    • Modified the main shell function to change the verify_thresholds check from a hard exit 1 to a warning message, making it a soft failure.
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
Copy Markdown
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 modifies a CI script to make a performance threshold check a soft fail instead of a hard fail. The implementation introduces a global variable in the embedded Python script to track failure status. While the change achieves its goal, using a global variable and mixing failure detection logic with formatting logic in the format_comparison function reduces code quality. My review includes a suggestion to refactor the Python code to separate these concerns for better maintainability and clarity.

Comment on lines 157 to +158
def format_comparison(name, lmcache_val, baseline_val):
global failed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using global variables introduces side effects, making functions like format_comparison harder to understand, test, and reuse. This change also mixes the logic for checking failure conditions with the logic for formatting a string, which is a violation of the Single Responsibility Principle.

A cleaner approach would be to separate these concerns. You could have a dedicated loop to determine if the failure threshold is met, and keep format_comparison purely for formatting. For example:

# In the main script body, before printing results
failed = False
for name, baseline_val, lmcache_val in metrics:
    baseline = safe_float(baseline_val)
    lmcache = safe_float(lmcache_val)
    if baseline is not None and lmcache is not None and baseline > 0:
        diff_pct = ((lmcache - baseline) / baseline) * 100
        if diff_pct > 10:
            failed = True
            break # Found a failure, no need to check more

# ... then call printing functions ...

# Then at the end of the script
if failed:
    # ...

With this approach, format_comparison would not need to be modified to handle the failed flag at all, and the global variable would be handled at the script's top level, which is more appropriate.

Copy link
Copy Markdown
Contributor

@sammshen sammshen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@KuntaiDu KuntaiDu left a comment

Choose a reason for hiding this comment

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

LGTM

@KuntaiDu KuntaiDu enabled auto-merge (squash) February 28, 2026 23:32
@github-actions github-actions Bot added the full Run comprehensive tests on this PR label Feb 28, 2026
@KuntaiDu KuntaiDu merged commit ddf8446 into LMCache:dev Mar 1, 2026
21 checks passed
hlin99 pushed a commit to hlin99/LMCache that referenced this pull request Mar 2, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: Ofer Kiselov Nahman <ofer.kiselovnahman@weka.io>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
mauryaavinash95 pushed a commit to mauryaavinash95/LMCache that referenced this pull request Mar 7, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
shaoxiawjc pushed a commit to shaoxiawjc/LMCache that referenced this pull request Mar 11, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: shaoxiawjc <wjc2800@163.com>
realAaronWu pushed a commit to realAaronWu/LMCache that referenced this pull request Mar 20, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: Aaron Wu <aaron.wu@dell.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
…MCache#2661)

[temp fix] make threshhold soft fail for mp ci

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full Run comprehensive tests on this PR mp Buildkite trigger for multi-processing mode test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants