Skip to content

[CI]: 5 day maximum for Comprehensive Test flexibility#2676

Merged
ApostaC merged 2 commits intoLMCache:devfrom
sammshen:flexible-comprehensive
Mar 5, 2026
Merged

[CI]: 5 day maximum for Comprehensive Test flexibility#2676
ApostaC merged 2 commits intoLMCache:devfrom
sammshen:flexible-comprehensive

Conversation

@sammshen
Copy link
Copy Markdown
Contributor

@sammshen sammshen commented Mar 4, 2026

Proposal: If we have fewer than 5 baselines for any reason, we should be slightly more flexible

2 more ad hoc fixes:

  1. fix the newly redundant flag for compilation level for vllm serve
  2. pass in the GITHUB_TOKEN properly for the nightly push of the comprehensive test results

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
@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 introduces an adaptive mechanism for performance test thresholds within the comprehensive CI suite. By dynamically adjusting the acceptable performance degradation based on the number of available historical baselines, the system gains flexibility. This prevents tests from failing too strictly when baseline data is sparse, ensuring more reliable and less flaky CI results without compromising overall performance monitoring.

Highlights

  • Adaptive Performance Thresholds: Implemented a dynamic tolerance for performance metrics (TTFT, round trip, warmup) in comprehensive tests.
  • Baseline-Dependent Flexibility: The performance threshold now adjusts based on the number of available baselines, ranging from 1.2x (20% tolerance) for 5+ baselines to 1.6x (60% tolerance) for a single baseline.
  • Improved Test Stability: This change aims to reduce spurious test failures when fewer historical baselines are available, making the CI more robust.

🧠 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/k3_tests/comprehensive/scripts/run-single-config.sh
    • Implemented adaptive performance thresholds based on the number of available baselines.
    • Updated performance checks (TTFT, round trip, warmup) to use the new dynamic threshold.
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 introduces an adaptive threshold for performance tests, making them more flexible when fewer baselines are available. This is a sensible improvement. My review includes suggestions to refactor the implementation for better maintainability by reducing code duplication and to improve conciseness and efficiency in the shell script.

Comment on lines +385 to +391
local threshold
threshold=$(awk -v n="$num_baselines" 'BEGIN {
gap = (5 - n); if (gap < 0) gap = 0
printf "%.1f", 1.2 + gap * 0.1
}')
local pct
pct=$(awk -v t="$threshold" 'BEGIN { printf "%d", (t - 1) * 100 }')
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

The calculation of threshold and pct currently uses two separate awk commands, which creates two separate processes. This can be optimized by combining them into a single awk call that calculates and outputs both values. This change would make the code more concise and slightly more efficient.

Suggested change
local threshold
threshold=$(awk -v n="$num_baselines" 'BEGIN {
gap = (5 - n); if (gap < 0) gap = 0
printf "%.1f", 1.2 + gap * 0.1
}')
local pct
pct=$(awk -v t="$threshold" 'BEGIN { printf "%d", (t - 1) * 100 }')
local threshold pct
read -r threshold pct <<< "$(awk -v n=\"$num_baselines\" 'BEGIN {
gap = (5 - n); if (gap < 0) gap = 0
t = 1.2 + gap * 0.1
p = (t - 1) * 100
printf \"%.1f %d\", t, p
}')"

Comment on lines 394 to 419
if [[ "$check_ttft" == "true" ]]; then
echo "Worst-case baseline query ttft per prompt: $expected_query_ttft"
echo "Actual query ttft per prompt: $query_ttft_per_prompt"
awk -v expected="$expected_query_ttft" -v actual="$query_ttft_per_prompt" 'BEGIN {
if (actual > expected * 1.2) { print "FAIL: Query ttft per prompt >20% worse than rolling baseline"; exit 1 }
awk -v expected="$expected_query_ttft" -v actual="$query_ttft_per_prompt" -v t="$threshold" -v pct="$pct" 'BEGIN {
if (actual > expected * t) { printf "FAIL: Query ttft per prompt >%d%% worse than rolling baseline\n", pct; exit 1 }
else { print "PASS: Query ttft per prompt within threshold" }
}'
fi

if [[ "$check_round" == "true" ]]; then
echo "Worst-case baseline query round time per prompt: $expected_query_round"
echo "Actual query round time per prompt: $query_round_time_per_prompt"
awk -v expected="$expected_query_round" -v actual="$query_round_time_per_prompt" 'BEGIN {
if (actual > expected * 1.2) { print "FAIL: Query round time per prompt >20% worse than rolling baseline"; exit 1 }
awk -v expected="$expected_query_round" -v actual="$query_round_time_per_prompt" -v t="$threshold" -v pct="$pct" 'BEGIN {
if (actual > expected * t) { printf "FAIL: Query round time per prompt >%d%% worse than rolling baseline\n", pct; exit 1 }
else { print "PASS: Query round time per prompt within threshold" }
}'
fi

if [[ "$check_warmup" == "true" ]]; then
echo "Worst-case baseline warmup round time per prompt: $expected_warmup"
echo "Actual warmup round time per prompt: $warmup_round_time_per_prompt"
awk -v expected="$expected_warmup" -v actual="$warmup_round_time_per_prompt" 'BEGIN {
if (actual > expected * 1.2) { print "FAIL: Warmup round time per prompt >20% worse than rolling baseline"; exit 1 }
awk -v expected="$expected_warmup" -v actual="$warmup_round_time_per_prompt" -v t="$threshold" -v pct="$pct" 'BEGIN {
if (actual > expected * t) { printf "FAIL: Warmup round time per prompt >%d%% worse than rolling baseline\n", pct; exit 1 }
else { print "PASS: Warmup round time per prompt within threshold" }
}'
fi
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

The logic for checking performance metrics (TTFT, round time, and warmup time) is repeated three times with only minor differences in variable names and strings. This code duplication can be reduced by refactoring it into a loop. By defining the metrics in an associative array, you can iterate through them and use a single, generalized awk command for all checks. This will make the script more maintainable and easier to extend in the future.

        local -A metrics_to_check
        metrics_to_check[ttft]="query ttft per prompt:${expected_query_ttft}:${query_ttft_per_prompt}"
        metrics_to_check[round]="query round time per prompt:${expected_query_round}:${query_round_time_per_prompt}"
        metrics_to_check[warmup]="warmup round time per prompt:${expected_warmup}:${warmup_round_time_per_prompt}"

        for check_type in ttft round warmup; do
            local check_var="check_${check_type}"
            if [[ "${!check_var}" == "true" ]]; then
                local metric_name expected_value actual_value
                IFS=':' read -r metric_name expected_value actual_value <<< "${metrics_to_check[${check_type}]}"
                
                echo "Worst-case baseline ${metric_name}: ${expected_value}"
                echo "Actual ${metric_name}: ${actual_value}"
                awk -v expected="${expected_value}" -v actual="${actual_value}" -v t="${threshold}" -v pct="${pct}" -v name="${metric_name}" 'BEGIN {
                    if (actual > expected * t) {
                        printf "FAIL: %s >%d%% worse than rolling baseline\n", name, pct;
                        exit 1;
                    } else {
                        printf "PASS: %s within threshold\n", name;
                    }
                }'
            fi
        done

… test redundant compile flag

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
Copy link
Copy Markdown
Contributor

@ApostaC ApostaC left a comment

Choose a reason for hiding this comment

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

LGTM!

@sammshen sammshen requested a review from DongDongJu March 5, 2026 23:04
@sammshen sammshen added the full Run comprehensive tests on this PR label Mar 5, 2026
@ApostaC
Copy link
Copy Markdown
Contributor

ApostaC commented Mar 5, 2026

Merging this to unblock LMCache CI.

@ApostaC ApostaC merged commit 275f717 into LMCache:dev Mar 5, 2026
20 of 24 checks passed
mauryaavinash95 pushed a commit to mauryaavinash95/LMCache that referenced this pull request Mar 7, 2026
* make flexible comprehensive test

Signed-off-by: Samuel Shen <slshen@uchciago.edu>

* 2 more fixes: 1. GITHUB_TOKEN for nightly comprehensve 2. correctness test redundant compile flag

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
Co-authored-by: Samuel Shen <slshen@uchciago.edu>
shaoxiawjc pushed a commit to shaoxiawjc/LMCache that referenced this pull request Mar 11, 2026
* make flexible comprehensive test

Signed-off-by: Samuel Shen <slshen@uchciago.edu>

* 2 more fixes: 1. GITHUB_TOKEN for nightly comprehensve 2. correctness test redundant compile flag

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
Co-authored-by: Samuel Shen <slshen@uchciago.edu>
Signed-off-by: shaoxiawjc <wjc2800@163.com>
realAaronWu pushed a commit to realAaronWu/LMCache that referenced this pull request Mar 20, 2026
* make flexible comprehensive test

Signed-off-by: Samuel Shen <slshen@uchciago.edu>

* 2 more fixes: 1. GITHUB_TOKEN for nightly comprehensve 2. correctness test redundant compile flag

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
Co-authored-by: Samuel Shen <slshen@uchciago.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
* make flexible comprehensive test

Signed-off-by: Samuel Shen <slshen@uchciago.edu>

* 2 more fixes: 1. GITHUB_TOKEN for nightly comprehensve 2. correctness test redundant compile flag

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
Co-authored-by: Samuel Shen <slshen@uchciago.edu>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
* make flexible comprehensive test

Signed-off-by: Samuel Shen <slshen@uchciago.edu>

* 2 more fixes: 1. GITHUB_TOKEN for nightly comprehensve 2. correctness test redundant compile flag

Signed-off-by: Samuel Shen <slshen@uchciago.edu>
Co-authored-by: Samuel Shen <slshen@uchciago.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants