Repository navigation
[Fix] diffusion: Fix the load duration missing from subclassed server tests - #40657
Conversation
`_validate_and_record` took the load duration as an optional argument that defaulted to None, and only the base class `_test_diffusion_request` passed it. The AMD and XPU nightlies override `test_diffusion_generation` and call `_validate_and_record` themselves, so their summaries carried no load time and `_record_performance_result` rejected every case with "Load duration missing or invalid: None" even though the server had measured one. Read the duration off the `ServerContext` instead, as `_validate_realtime_performance` already does. Every caller holds the context, so the measurement can no longer be dropped on the way to the summary. Co-authored-by: Michael <michaelzhang-ai@users.noreply.github.com>
The three registered diffusion tests that override `test_diffusion_generation` drive the recording path themselves, so nothing caught them drifting from the base class contract until the AMD nightly failed. Run each override against a stub server and assert the context's load time reaches the recorded result. Co-authored-by: Michael <michaelzhang-ai@users.noreply.github.com>
The list of overrides was hand-maintained, which is the same "added X without updating Y" gap that let the original drift through. Scan the registered tree for tests that call `_validate_and_record` themselves and require the list to match. Co-authored-by: Michael <michaelzhang-ai@users.noreply.github.com>
The completeness check only walked test/registered, so an override added under python/sglang/multimodal_gen/test — where the diffusion server suites also subclass DiffusionServerBase — escaped the check meant to catch exactly that. Scan both trees, and assert the base class's own call site is still found so a wrong scan root fails loudly instead of matching nothing. Co-authored-by: Michael <michaelzhang-ai@users.noreply.github.com>
parents[4] silently resolves to the wrong directory if this file is ever moved, turning a relocation into a confusing red in an unrelated PR. Walk up until an ancestor actually contains both scanned trees instead. Co-authored-by: Michael <michaelzhang-ai@users.noreply.github.com>
test/registered/unit/README.md says tests here are CPU-only and register with register_cpu_ci, and this one needs no GPU either — but base-a-test-cpu installs python[dev], which omits the diffusion extra it imports. Co-authored-by: Michael <michaelzhang-ai@users.noreply.github.com>
|
Superseding my two earlier comments — both name runs that later pushes made stale. Do not rerun 35677085181 or 35684596604. Current head is This change is green
Everything red is one root causeEvery other failed job in the run emits this in its own log: I checked all twenty individually. That root cause is flaky on
|
Co-authored-by: quitenode <quitenode@users.noreply.github.com>
yichiche
left a comment
There was a problem hiding this comment.
PR 40657 passes pre-review: the diffusion test helper reads the load duration from the server context, NVIDIA still records the same load_time_ms, and every checklist row passed. LGTM.
|
@michaelzhang-ai Dependency issue in unit test. |
|
@michaelzhang-ai heads-up — this PR now conflicts with Could you merge or rebase |
# Conflicts: # python/sglang/multimodal_gen/test/unit/test_pi05_modelopt_fp8_cuda.py
|
@yichiche Both are addressed in 49f3f65. The CI is re-running on the new head. |
Making ctx a required argument already turns a stale override call into a TypeError, so the guard no longer catches anything the signature does not.
|
@yichiche Two updates since your approval:
The NVIDIA |
|
@yichiche @HaiShaw @BBuf @mickqian Could you merge this when you get a chance? Thanks! On ef3a301, every diffusion suite in PR Test that ran passed, including The remaining red NVIDIA checks are |
…ject#40657 sgl-project#40657 restored the (ctx, case, perf_record) signature and updated the XPU call sites on main; the merge kept the load_time_ms kwarg form, which no longer matches.
Motivation
The AMD nightly
nightly-1-gpu-zimage-turbohas failed on all three ROCm variants since the 2026-09-21 run (job), and was still failing on 2026-10-12:Image generation succeeds; the failure is in recording the result. #39206 added a
load_time_ms=Noneparameter toDiffusionServerBase._validate_and_record, and a check in_record_performance_resultthat rejects a missing load duration, but only updated the base class's own call site. Three tests overridetest_diffusion_generationand call_validate_and_record(case, perf_record)directly, so they recordNoneeven though the server measured its load time:test/registered/amd/test_zimage_turbo.pytest/registered/xpu/test_xpu_zimage_turbo.pytest/registered/xpu/test_xpu_flux2_dev.pyModifications
_validate_and_recordnow takes theServerContextand readsctx.load_time_msitself, as_validate_realtime_performancealready does. The three overrides, the base-class call site andtest_performance_failure_policy.pypass the context. Sincectxis required, an override still using the old call fails with aTypeErrorinstead of silently recordingNone.NVIDIA behaviour is unchanged: the base class used to pass
diffusion_server.load_time_msand now passesdiffusion_server.Verification
diffusion-coverage-check) andmultimodal-gen-unit-testpassed on this branch at e9616a3 (run).continue_on_error=false(run), passes on rocm10, rocm724 and rocm720. Each job records the server's load time (52.3–58.6 s) instead of failing onNone.An earlier revision also added a guard test that drove the three overrides with a stub server. It has been removed: with
ctxrequired, it no longer catches anything the signature doesn't.Notes for reviewers
Two XPU issues are left alone because this regression did not cause them:
fixture 'perf_results' not found.test/registered/amd/conftest.pyre-exports it ([AMD] Fix the diffusion perf fixture lookup #38686), buttest/registered/xpu/has no equivalent.flux2_dev_image_t2ihas no entry inperf_baselines/xpu_b60.json, so once the fixture is fixed it will fail on the missing baseline ([Diffusion] Guard E2E/loading latency with runner-aware baselines #39206 moved that check out ofif case.run_perf_check:).CI States
Latest PR Test (Base): 🚫 Run #38519229876
Latest PR Test (Extra): ❌ Run #38519229934
Latest PR Test (AMD ROCm 10): ❌ Run #38519229845