Skip to content

[Infra] Reduce llm_translation_testing parallelism and tolerate worker restarts - #25897

Closed
yuneng-berri wants to merge 4 commits into
litellm_internal_stagingfrom
litellm_llmTranslationOomMitigation
Closed

[Infra] Reduce llm_translation_testing parallelism and tolerate worker restarts#25897
yuneng-berri wants to merge 4 commits into
litellm_internal_stagingfrom
litellm_llmTranslationOomMitigation

Conversation

@yuneng-berri

Copy link
Copy Markdown
Collaborator

Relevant issues

Summary

Problem

Workers in the `llm_translation_testing` CircleCI job have been crashing mid-run with `[gw*] node down: Not properly terminated`, failing the job and blocking the pipeline. The crashes are OOM kills: multiple workers go down near the end of the run (97–99% through), and the log shows accumulating `Unclosed client session` / `Unclosed connector` messages before the final crash. Bumping `resource_class` from `large` to `xlarge` (#25887) did not resolve it.

Fix

Two small, independent mitigations on the pytest invocation:

  • Drop xdist workers from `-n 8` to `-n 4`. Memory pressure per worker is the dominant failure mode, not CPU throughput; these tests are I/O-bound.
  • Add `--max-worker-restart=5` so a crashed worker is replaced and its remaining tests are redistributed, instead of failing the entire job on the first OOM.

Testing

CI will exercise the new configuration when this PR runs.

Type

🚄 Infrastructure

ishaan-berri and others added 4 commits April 16, 2026 22:49
…orker restarts

Workers in llm_translation_testing have been crashing mid-run with
"Not properly terminated" (OOM), even after bumping resource_class to
xlarge. Reduce xdist workers from 8 to 4 to lower peak memory, and add
--max-worker-restart=5 so a crashed worker is replaced instead of
failing the whole run.
@yuneng-berri
yuneng-berri requested a review from a team April 16, 2026 20:06
@vercel

vercel Bot commented Apr 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 16, 2026 8:07pm

Request Review

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ Sameerlite
✅ yuneng-berri
❌ ishaan-berri
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Reduces llm_translation_testing parallelism from -n 8 to -n 4 and adds --max-worker-restart=5 to tolerate OOM-induced worker crashes, following an earlier failed attempt to fix the same crashes by bumping the resource class.

The actual changeset is a single line in .circleci/config.yml; the other 14 files listed in the PR description are on the base branch and were not touched by this commit.

Confidence Score: 5/5

Safe to merge — the change is a one-line CI tuning with no production code impact.

The PR makes a single, well-motivated change to a CI job configuration. Halving parallelism doubles per-worker RAM (1 GB → 2 GB on resource_class:large) and --max-worker-restart=5 prevents a single OOM crash from aborting the entire suite. No application code is modified. The only non-blocking concern is whether the 15m no_output_timeout remains comfortable with fewer workers, which CI itself will confirm.

No files require special attention; .circleci/config.yml is the only changed file.

Important Files Changed

Filename Overview
.circleci/config.yml Single-line change: drops xdist workers from 8 → 4 and adds --max-worker-restart=5 on the llm_translation_testing job; resource_class remains large (4 vCPU / 8 GB), giving each worker 2 GB instead of 1 GB.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[llm_translation_testing job
resource_class: large
4 vCPU / 8 GB RAM] --> B[pytest-xdist
-n 4 workers]
    B --> W1[Worker 0
~2 GB RAM]
    B --> W2[Worker 1
~2 GB RAM]
    B --> W3[Worker 2
~2 GB RAM]
    B --> W4[Worker 3
~2 GB RAM]
    W1 -- OOM crash --> R{Restarts used
< 5?}
    W2 -- OOM crash --> R
    R -- Yes --> B
    R -- No --> FAIL[Job fails]
    W1 -- Tests pass --> PASS[Job passes]
    W2 -- Tests pass --> PASS
    W3 -- Tests pass --> PASS
    W4 -- Tests pass --> PASS
Loading

Reviews (1): Last reviewed commit: "[Infra] CI: reduce llm_translation_testi..." | Re-trigger Greptile

Comment thread .circleci/config.yml
done
uv run --no-sync python -m pytest -v tests/llm_translation $IGNORE_ARGS --junitxml=test-results/junit.xml --durations=20 -n 8 --timeout=120 --timeout_method=thread --retries 2 --retry-delay 5
uv run --no-sync python -m pytest -v tests/llm_translation $IGNORE_ARGS --junitxml=test-results/junit.xml --durations=20 -n 4 --timeout=120 --timeout_method=thread --retries 2 --retry-delay 5 --max-worker-restart=5
no_output_timeout: 15m

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.

P2 no_output_timeout may be tight with half the workers

Halving workers from 8 → 4 will increase wall-clock run time for CPU/memory-bound tests. The current no_output_timeout: 15m is the time without any output; as long as pytest prints progress it won't fire. If any test generates no output for a full 15 minutes (e.g. a hung network call that slips past the 120 s --timeout), the job could be killed. Worth monitoring the first few runs to confirm the suite still comfortably finishes within the overall job limit.

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.

4 participants