Skip to content

ci(codspeed): pin benchmark runner to ubuntu-24.04 - #31746

Merged
mateo-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_/busy-lehmann-caafae
Jun 30, 2026
Merged

ci(codspeed): pin benchmark runner to ubuntu-24.04#31746
mateo-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_/busy-lehmann-caafae

Conversation

@yuneng-berri

Copy link
Copy Markdown
Collaborator

Relevant issues

Fixes #31738

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests (n/a; one-line CI runner pin with no unit-testable surface)
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

The CodSpeed workflow runs only on push/pull_request to main and litellm_internal_staging plus workflow_dispatch, so there is no live-proxy curl to show here; the realistic proof is a green run of the workflow itself on the pinned runner. I dispatched codspeed.yml on this branch and it completed successfully on ubuntu-24.04:

https://github.com/BerriAI/litellm/actions/runs/28469560495

✓ Set up job
✓ Run actions/checkout
✓ Set up Python
✓ Set up uv
✓ Run benchmarks
✓ Complete job

Type

🚄 Infrastructure

Changes

ubuntu-latest resolves to different runner images between the BASE (main/litellm_internal_staging) and HEAD (PR) runs, so CodSpeed reports "Different runtime environments detected" and emits false-positive regressions. A concrete example is the -25.2% swing reported on test_completion_multi_turn (3.1 ms -> 4.2 ms) in #31684, an MCP auth-resilience fix that touched no LLM code path

Pinning the benchmark job to a fixed image keeps BASE and HEAD on the same hardware, so sub-millisecond swings on a ~3 ms benchmark stop blocking unrelated PRs. This is the Phase 1 quick win from #31738

-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04

Making CodSpeed non-blocking / informational-only is a branch-protection setting in the GitHub repo rather than a code change, so it is intentionally left out of this PR

ubuntu-latest resolves to different runner images between the BASE
(main/staging) and HEAD (PR) runs, so CodSpeed reports 'Different
runtime environments detected' and emits false-positive regressions
(e.g. a -25.2% swing on test_completion_multi_turn in #31684, an MCP
auth fix with no LLM code changes). Pinning the runner to a fixed
image keeps BASE and HEAD on the same hardware so 1 ms swings on a
~3 ms benchmark stop blocking unrelated PRs.

Fixes #31738
@yuneng-berri
yuneng-berri requested a review from a team June 30, 2026 19:16
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR pins the CodSpeed benchmark runner from ubuntu-latest to ubuntu-24.04 to prevent false-positive performance regressions caused by GitHub resolving ubuntu-latest to different runner images between the BASE and HEAD benchmark runs.

  • Changes runs-on: ubuntu-latest to runs-on: ubuntu-24.04 in .github/workflows/codspeed.yml, ensuring BASE and HEAD benchmarks always execute on identical hardware so CodSpeed comparisons are meaningful.
  • The author dispatched the workflow on this branch and confirmed a successful end-to-end run on the pinned runner image before submitting.

Confidence Score: 5/5

This is a one-line CI configuration change that only affects the benchmark runner image; no production code, tests, or schemas are touched.

The change is minimal and self-contained — it replaces a floating runner label with a fixed Ubuntu image. The author verified the workflow completes successfully on ubuntu-24.04 and the motivation (eliminating false-positive CodSpeed regressions from runner image drift) is well-documented. There is nothing here that could break builds or introduce regressions.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/codspeed.yml Single-line runner pin from ubuntu-latest to ubuntu-24.04 to eliminate false-positive CodSpeed benchmark regressions caused by differing runner images between BASE and HEAD runs.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/lit..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

⚡ 1 improved benchmark
❌ 2 regressed benchmarks
✅ 27 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_completion_simple_message 3.2 ms 4.4 ms -26.95%
test_completion_with_tools 3.2 ms 4.2 ms -23.71%
test_completion_multi_turn 4.2 ms 3.1 ms +33.78%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing litellm_/busy-lehmann-caafae (afaca7b) with litellm_internal_staging (88c34a5)

Open in CodSpeed

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The CodSpeed check flip-flops on internal staging and on PRs targeting
it (e.g. "+11.75% improvement" on one run, "-25.36% regression" on the
next) because the comparison flags "different runtime environments" and
the benchmarks are only 3-4 ms, so sub-millisecond runner noise swings
the result by 25-30%. Pinning the runner to ubuntu-24.04 in this PR
helps the head side, but the internal_staging base is still recorded on
the old unpinned runner, so comparisons keep flapping until the pin
merges and the base is re-baselined.

Until that settles, the red X's on internal staging make the OSS
project look unhealthy and confuse contributors, so drop the
litellm_internal_staging push and pull_request triggers and keep
CodSpeed running on main only.
@mateo-berri
mateo-berri self-requested a review June 30, 2026 22:25

@mateo-berri mateo-berri left a comment

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.

LGTM; thanks!

@mateo-berri
mateo-berri merged commit ae8084d into litellm_internal_staging Jun 30, 2026
122 checks passed
@mateo-berri
mateo-berri deleted the litellm_/busy-lehmann-caafae branch June 30, 2026 22:25
duanhongyi pushed a commit to duanhongyi/litellm that referenced this pull request Jul 2, 2026
* ci(codspeed): pin benchmark runner to ubuntu-24.04

ubuntu-latest resolves to different runner images between the BASE
(main/staging) and HEAD (PR) runs, so CodSpeed reports 'Different
runtime environments detected' and emits false-positive regressions
(e.g. a -25.2% swing on test_completion_multi_turn in BerriAI#31684, an MCP
auth fix with no LLM code changes). Pinning the runner to a fixed
image keeps BASE and HEAD on the same hardware so 1 ms swings on a
~3 ms benchmark stop blocking unrelated PRs.

Fixes BerriAI#31738

* ci(codspeed): stop running benchmarks on litellm_internal_staging

The CodSpeed check flip-flops on internal staging and on PRs targeting
it (e.g. "+11.75% improvement" on one run, "-25.36% regression" on the
next) because the comparison flags "different runtime environments" and
the benchmarks are only 3-4 ms, so sub-millisecond runner noise swings
the result by 25-30%. Pinning the runner to ubuntu-24.04 in this PR
helps the head side, but the internal_staging base is still recorded on
the old unpinned runner, so comparisons keep flapping until the pin
merges and the base is re-baselined.

Until that settles, the red X's on internal staging make the OSS
project look unhealthy and confuse contributors, so drop the
litellm_internal_staging push and pull_request triggers and keep
CodSpeed running on main only.

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix flaky CodSpeed bench CI check — false-positive regressions blocking PRs

3 participants