Skip to content

[Test] diffusion: Batch performance guard retry subprocesses - #42359

Open
Tokha233 wants to merge 1 commit into
sgl-project:mainfrom
Tokha233:test/diffusion-batch-perf-retries
Open

Tokha233 wants to merge 1 commit into
sgl-project:mainfrom
Tokha233:test/diffusion-batch-perf-retries

Conversation

@Tokha233

@Tokha233 Tokha233 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The AMD diffusion unit step in #42249 hit its 30-minute limit. Its existing nine test_performance_failure_survives_real_pytest_runner cases consumed about 1,366.5 s between consecutive log timestamps (job). Each case launches an independent runner with seven pytest attempts, repeatedly importing the diffusion stack: 63 pytest startups in total. This is a major cost in the existing suite; #42249's four cold imports separately add about 47.5 s on this runner and are kept intact.

Modifications

Parameterize the nine scenarios inside the generated child test module. One real runner now executes all nine independent pytest items over the original seven attempts, reducing pytest startups from 63 to 7 while preserving seven executions of every scenario.

For every scenario, require seven request/LoRA/retained-metric markers, a failed runner result, and a final JUnit failure containing [performance]. Also check the independent infrastructure timeout's JUnit failure and the exact set of collected cases. Each item retains its own monkeypatch and temporary-directory fixtures. The exhaustion test clears an inherited retry deadline; separate deadline/budget tests continue to check one-attempt exhaustion and preservation of failures.

Only this test file changes. Production inference, retry policy, six-retry limit, CI timeouts, and performance thresholds are unchanged.

Accuracy Tests

No model output changes. Test coverage validates the real performance validator, request loop, subprocess runner, retry classification and final JUnit results. Validation used isolated trees of upstream 00bcc25 and this candidate, each with all 4,126 Python files hash-checked (zero mismatches or extra files).

On the same isolated test host:

Source Result Whole command Pytest reported
upstream 00bcc25 25 passed 888.28 s 877.99 s
candidate 17 passed 117.36 s 107.35 s

The outer count decreases by eight because the original nine outer parametrizations become one integration test containing nine child pytest items. Every scenario still executes seven times, with per-case assertions. Existing retry recovery and budget-preservation tests also pass. Repeating the complete candidate file with SGLANG_DIFFUSION_RETRY_DEADLINE=1 also passes all 17 tests (119.36 s whole command), confirming the exhaustion test is isolated from the outer runner budget.

python -m pytest -q --durations=15 python/sglang/multimodal_gen/test/unit/test_performance_failure_policy.py

Speed Tests and Profiling

Whole-command time decreased 86.8% (7.57×) in this same-host comparison. The nine original integration durations total 873.93 s; the batched integration takes 103.34 s. This is one before/after comparison, not a stability distribution. The local test host is RTX 5090 D v2, Python 3.12, PyTorch 2.13.0+cu130; this is not an AMD rerun or an inference-speed claim. Native AMD CI remains needed to confirm that the complete unit step finishes within its unchanged budget; other known AMD failures are outside this patch.

Checklist

  • Format code with pre-commit.
  • Preserve and strengthen unit coverage.
  • Document the test-only change and validation here; no public API changes.
  • Provide completed test-runtime measurements.
  • Follow SGLang code style.

CI States

Latest PR Test (Base): ❌ Run #37106959367
Latest PR Test (Extra): ❌ Run #37106959275
Latest PR Test (AMD ROCm 10): ❌ Run #37106959383

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant