Repository navigation
Conversation
Inventory selected component weights before loading and use them to seed a conservative resident set. The seed changes only ordinary component residency, so post-load planning can replace it before the first serving forward. Run the same exact multi-resource placement solver after components are sized and again after one representative warmup. Each target state jointly obeys per-rank execution-phase VRAM, placement-transition scratch, per-worker HostPin, and host repacking headroom. The complete target frontier includes resident, component offload, and partial layerwise placements for DiTs, encoders, VAEs, lazy components, and two-stage pipelines. Keep structural loading decisions such as explicit FSDP outside the reversible planner, cap normal calibration at one adjustment and one verification warmup, and retain bounded OOM recovery. Extend offline startup to use the same sequence and add exhaustive solver, lifecycle, rollback, multi-rank, custom-pipeline, and server-args coverage.
mickqian
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
ping1jing2 and
yichiche
as code owners
August 27, 2026 14:11
Collaborator
Author
|
/tag-and-rerun-ci |
…nto codex/diffusion-preload-residency-planner # Conflicts: # python/sglang/multimodal_gen/runtime/managers/memory_managers/auto_residency.py # python/sglang/multimodal_gen/test/unit/test_auto_residency.py
The load-safe seed keeps the 1.3B DiT resident from load on a 32 GiB card, so the load peak moves from 928 MiB to 3810 MiB (measured on the 5090 canary).
# Conflicts: # python/sglang/multimodal_gen/runtime/pipelines_core/composed_pipeline_base.py
# Conflicts: # python/sglang/multimodal_gen/test/unit/test_auto_residency.py # python/sglang/multimodal_gen/test/unit/test_auto_residency_warmup.py # python/sglang/multimodal_gen/test/unit/test_component_residency.py # python/sglang/multimodal_gen/test/unit/test_placement_budget.py
# Conflicts: # python/sglang/multimodal_gen/runtime/server_args/auto_tune.py
The pre-load planner only promotes DiTs, so starting from main's memory thresholds loses nothing and avoids serving below them when a promotion is declined (see the apply layer's fix for the measured regressions). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…safe start The 21 'defers residency' variants asserted that auto mode starts every component offloaded so the static planner can place it later. Placement now starts from the memory thresholds main applies and the planner only promotes, so the apply layer's threshold tests are the right expectations again; the FSDP-versus-planner test stays u1's own. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
# Conflicts: # python/sglang/multimodal_gen/test/server/perf_baselines/5090.json # python/sglang/multimodal_gen/test/server/perf_baselines/h100.json
The seed keeps native DiTs resident from load, so the load peaks of the Wan2.2 A14B 2-GPU cases and the 5090 Wan/Turbo-Wan/FLUX.2-klein cases rise accordingly (run 34131148154 at a330811); runtime peaks follow the apply layer's refresh. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
# Conflicts: # python/sglang/multimodal_gen/test/server/perf_baselines/h100.json
…load-residency-planner
Collaborator
Author
|
/tag-and-rerun-ci |
This was referenced Sep 15, 2026
5 tasks done
This was referenced Sep 21, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
originalmode, retain allocator reserve after the realized placement runs, and let numerically non-invariant pipelines decline automatic residency changesDesign boundary
The preload decision is a replaceable load-feasibility seed, not an independent serving optimizer. Its load VRAM budget is a separate lifecycle feasibility constraint; it is never composed after the fact as an independently optimal serving decision. The serving solve uses one selection vector for every runtime phase VRAM, placement transition, and node HostPin constraint. Once modules have exact sizes, static planning may demote or replace every seeded component before the first forward; warmup then validates and refines the complete serving frontier with measured workload phases and latency utility.
Structural loading choices such as explicit FSDP remain outside this planner because changing them after calibration requires reloading weights. Explicit/online quantization and direct GPU loading likewise fix only their affected components; unrelated components in the same pipeline remain eligible for measured placement. The exactness guarantee is therefore relative to the supplied replaceable placement frontier, resource estimates, and target workload, rather than a claim about startup-plus-serving lifecycle cost.
Within one request replica, multi-process HostPin is pooled into the same placement solve, so TP/SP/PP/CFG ranks may receive asymmetric quotas while their sum remains bounded. Different DP replicas retain disjoint local-worker shares rather than coordinating one cross-replica solve; homogeneous startup remains symmetric, while heterogeneous DP workloads are outside the exactness claim. Quotas are applied transactionally and rollback restores the prior allocation.
Validation
B200: Wan2.2 A14B NVFP4, 640x384x17, 12 steps
The load-safe seed selected both DiTs resident. The text encoder and VAE retained their native layerwise loading semantics; the 4-step full-shape probe then selected both resident. This preserves checkpoint/model initialization behavior while moving serving placement out of model-specific thresholds. The post-adjustment pass validates the complete serving shape; resident-only changes use one denoise step because they remove hooks/transfers without changing the compute path.
Conservative preload boundary
A 29.7 GiB Wan2.1 1.3B experiment showed why checkpoint bytes alone cannot promote auxiliary modules safely: a weight-only plan exhausted activation headroom near 29.1 GiB and then paid for layerwise recovery. LTX2.3 showed the same issue on a larger request. The production preload seed therefore covers native DiTs only; encoders and VAEs retain their configured loading path until the bounded full-shape probe supplies activation evidence.
The old-head NVIDIA run passed unit, BCG, component-accuracy, B200, RTX 5090, four of five H100 1-GPU partitions, and one completed H100 2-GPU partition before the three known long-running partitions were cancelled to avoid seven retries against stale VRAM guards. The current-head run validates workload-faithful CI sampling, resident-only one-step validation, and explicit before/after calibration timing.
Focused tests cover initial placement, the exact joint solver, per-rank checkpoint loading, HostPin accounting, layerwise transitions, and warmup/rollback orchestration. Changed-file and merge-conflict pre-commit passed on
93f1464c2af64. The current head preserves node-pooled HostPin and per-group policy choices, avoids speculative pin-frontier construction before calibration, and collapses a measured pin frontier only when every rank-local share and the exact per-component latency cap prove it non-binding.Completed H100 evidence from parent run
33183409022additionally showed why both planner layers are needed: LTX2.3 HQ selected a live-allocation-feasible layout whose mapped allocator pool left no request reserve, while SANA-WM changed numerics after runtime promotion. The stack now combines the child branch allocation-gap correction during candidate planning with the parent post-placement peak-reserved guard, fixes both LTX DiTs inoriginalmode, and keeps SANA-WM on its proven static placement. No additional warmup or retry round was added.Stack
Depends on #35335.
CI States
Latest PR Test (Base): ❌ Run #34829333187
Latest PR Test (Extra): ❌ Run #34829333044
Latest PR Test (AMD ROCm 10): ❌ Run #34829333150
Baseline note (2026-09-05)
5090.jsonturbo_wan2_1_t2v_1.3bload peak 928 → 3810 MiB: the load-safe seed keeps the 1.3B DiT resident from load on a 32 GiB card (same effect already recorded forflux_2_klein_base_image_t2iandzimage_image_t2i).