Skip to content

[Perf] diffusion: Skip the residency calibration probe in auto mode until a planner consumes it - #45979

Merged
mickqian merged 1 commit into
mainfrom
mick/diffusion-auto-skip-unused-calibration
Oct 23, 2026
Merged

mickqian merged 1 commit into
mainfrom
mick/diffusion-auto-skip-unused-calibration

Conversation

@mickqian

@mickqian mickqian commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

#37916 (1/4 of the auto-residency stack) added warmup-calibrated residency measurement: in --performance-mode auto with server warmup, the warmup builder raises the step count to 4 (AUTO_RESIDENCY_TIMING_STEPS) and, when the bounded warmup shape is smaller than the default request, appends a full-shape probe plus a re-warm of the bounded shape. After the probe the worker drops the IPC and Ulysses all-to-all staging buffers.

Nothing consumes the result. The planner and the apply/rollback path are still open (#37917, #37918, #35335): _auto_residency_warmup_records are read only to size the probe itself, and server_warmup.auto_residency_skip_reason has no caller. Auto mode therefore pays for calibration on every startup:

  • a full-shape probe for video models (1024x1024x81 for Cosmos3-Nano), plus a second bounded warmup;
  • four warmup steps instead of two;
  • a staging-buffer drop that the next request has to undo. On 4xGB300 Cosmos3 (CFG 2 x Ulysses 2) this raised std::get: wrong index for variant on some ranks after the probe and hung the next all-to-all until the NCCL watchdog fired.

The debug residency hint also told users that auto "applies safe adjustments automatically", which is not true yet.

Modifications

  • auto_residency_args_skip_reason ends with "residency planner not available" after every other gate passes. The warmup builder already keys the probe, the 4-step floor and the stage-timing retention on this gate, so auto mode is back to the bounded warmup that every other mode runs. The planner PR replaces this one line with return None when it lands, which re-enables the probe in the same PR that consumes it.
  • Warmup memory measurement ([diffusion] Measure warmup memory and layer usage per phase for residency calibration (1/4) #37916) is unchanged; it is cheap and the planner builds on it.
  • The debug hint in do_mem_analysis keeps only the explicit --component-residency <name>=resident advice.

Tests (test_auto_residency.py):

  • New test_eligible_server_warmup_runs_no_probe_or_step_floor: an auto, server-warmup, CUDA video config whose bounded warmup is smaller than its 1280x720x81 default builds one warmup request at the bounded step count. On main it builds three (bounded, probe, re-warm) at 4 steps.
  • The three tests that asserted "every other gate passes" (test_fixed_loading_paths_still_calibrate_other_components, test_parallel_paths_reach_planner_gate, test_eligible_path_reaches_planner_gate) now pin the platform to CUDA and expect the planner reason, instead of accepting either None or "requires CUDA" depending on the runner. All four tests fail on main.
  • The probe-shape and probe-sizing tests still patch the gate open, so the machinery stays covered for the planner PRs.

Accuracy Tests

No numeric path changes: only warmup requests differ, and serving requests run the same code.

Speed Tests and Profiling

Cosmos3-Nano T2V on 2xH200, flagless sglang serve --num-gpus 2 (auto mode, CFG parallel), fresh server per run, rounds interleaved main / PR / main / PR:

Startup to healthy (round 1 / round 2) Server warmup
main 62.1 / 46.0 s 832x480x17 at 4 steps, then the probe at 1024x1024x81 (4 steps, 6.1 s), then 832x480x17 again: ~9 s
this PR 50.0 / 40.0 s 832x480x17 at 2 steps: 2.7 s

The PR's server logs contain no auto residency probe line.

Serving requests run the same code, so their latency and memory do not change.

CI and baselines

No perf or memory baseline should move. Warmup peaks are reported apart from runtime_peak_vram_mb since #37916, and the probe's allocator pool and staging buffers were dropped before serving anyway. Auto-mode warmup is back to what it was before #37916: the bounded shape once, at 2 steps. Video cases in the auto-mode suites start faster; their estimated_full_test_time_s entries are now slightly high, which only affects shard balancing.

Checklist

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ✅ Run #39904976567
Latest PR Test (Extra): ❌ Run #39904976538
Latest PR Test (AMD ROCm 10): ❌ Run #39904976639

…lanner consumes it

Auto mode ran a full-shape warmup probe and raised the warmup to four
steps to calibrate component residency, but nothing applies the result:
only the measurement half (#37916) is merged, while the planner and apply
PRs (#37917/#37918/#35335) are open. The probe still cost startup time and
dropped the IPC/Ulysses staging buffers afterwards, which hung a 4-GPU
CFG+Ulysses Cosmos3 startup on GB300.

The args gate now ends with "residency planner not available", so the
warmup builder emits the bounded warmup only. The planner PR flips this
line when it lands. The debug residency hint no longer claims that auto
applies adjustments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mickqian

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added diffusion SGLang Diffusion run-ci CI: run the baseline test suite on this PR labels Oct 23, 2026
@github-actions

This comment has been minimized.

@mickqian mickqian changed the title [diffusion] Auto mode: skip the residency calibration probe until a planner consumes it [Perf] diffusion: Skip the residency calibration probe in auto mode until a planner consumes it Oct 23, 2026
@mickqian
mickqian merged commit 82ff16d into main Oct 23, 2026
246 of 268 checks passed
@mickqian
mickqian deleted the mick/diffusion-auto-skip-unused-calibration branch October 23, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant