Repository navigation
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
b9f7f23 to
173ac2d
Compare
|
Update: added a hard safety gate — overlap now additionally requires every group member to declare |
173ac2d to
b710d6d
Compare
|
/tag-and-rerun-ci |
c051849 to
f301205
Compare
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
5e7d18a to
50d5a32
Compare
|
/tag-and-rerun-ci extra |
|
CI triage for the red checks — none are caused by this PR: multimodal-gen-test-2-npu-a3 ( multimodal-gen-test-*-gpu-amd ( |
|
Re-run outcome: |
Pipelines execute strictly serially even when consecutive stages have no data dependencies: an image-conditioned request pays text encoding plus condition encoding back to back although neither reads the other's output. Let a pipeline declare mutually independent stages with add_parallel_stages. The stage list stays flat, so residency bookkeeping, disaggregation role filtering, and profiling see the same order; members share an execution-group token and the production ParallelExecutor derives sequential levels from consecutive tokens. A multi-member level of replicated stages runs member 0 on the calling thread and the rest on pooled threads pinned to reused side CUDA streams that wait on the current stream before starting and are waited on after joining, preserving every ordering the serial schedule provided; every other level keeps the exact per-paradigm rank behavior. SyncExecutor stays a plain serial executor. Contract for group members: mutate disjoint request state, return the payload received, and keep collective communication to at most one member per process-group family. Residency active-use bookkeeping is serialized under a manager lock; levels fall back to declaration order whenever component offload is enabled or grouped-batch execution chains new batch lists. Co-Authored-By: Claude Fable 5 <[email protected]>
TextEncodingStage and ImageEncodingStage report concurrency_safe dynamically: False whenever encoder folding or encoder dp is active (both involve cross-rank collectives), or when the image stage shares a VLM text encoder with the text stage (conflicting prompt_embeds writes). This keeps declared-parallel groups conservative by default while allowing single-rank replicated encoders to overlap. Co-Authored-By: Claude Fable 5 <[email protected]>
Adopt declared-parallel stage groups in the Wan I2V pipeline: text encoding, CLIP image encoding, and image VAE encoding form one execution level (opt-in via add_standard_ti2v_stages( overlap_condition_encoders=True), requires the before_timestep VAE position). Validated on a single B200 (Wan2.1-I2V-14B-480P, 480x832x33f, 20 steps, performance-mode speed, two sequential requests per process): - request 1 correctly downgrades to serial while the DiT sits in the compile-scoped layerwise-offload window; request 2 overlaps (engagement log observed) and completes with stable memory (members enter at 58.4GB allocated, exit at 58.7GB). - warm-request level time equals the slowest member (~0.44s VAE encode) instead of the serial sum (~0.45s); the win grows when the branches are balanced (cold text encoding: 0.56s text + 0.45s VAE serial vs ~0.6s overlapped) or on hardware where encoders are proportionally slower. Co-Authored-By: Claude Fable 5 <[email protected]>
b4a528a to
fc39518
Compare
# Conflicts: # docs/docs/sglang-diffusion/api/cli.mdx # python/sglang/multimodal_gen/runtime/managers/memory_managers/component_manager.py # python/sglang/multimodal_gen/runtime/pipelines_core/executors/pipeline_executor.py # python/sglang/multimodal_gen/runtime/pipelines_core/stages/text_encoding.py # python/sglang/multimodal_gen/runtime/server_args/server_args.py
… of sgl-project#33036) Squash of 14 commits 5d2f658..12e5682 (net diff from PR base 1270204 applied with git apply -3). Adds --parallel-stage-execution {auto|serial} (default serial): parallel_executor builds groups from stages declaring concurrency safety and overlaps independent CUDA conditioning stages (Wan I2V text+image encoders first), with explicit collective sequencing for distributed, residency-manager coordination in component_manager, and stage-contract markers in stages/base.py, text_encoding.py, image_encoding.py + per-pipeline declarations. Conflict resolutions: - component_manager.py imports: union (theirs threading + ours Iterable). - cli.mdx: kept our fuller cfg-parallel/encoder-parallel bullets, appended theirs' new --parallel-stage-execution bullet. - composed_pipeline_base.py (which carries our sgl-project#32550 DAG hooks) and parallel_executor.py auto-merged cleanly; re-verified by tests. Tests: test_parallel_stage_groups.py + test_server_args.py 221 passed; unit -k "pipeline or executor or component or residency or stage" 651 passed.
Motivation
Adjacent conditioning stages such as text encoding, image encoding, and image-VAE encoding can be independent, but pipelines currently execute every stage serially. This PR adds an explicit declaration mechanism and safely overlaps eligible stages.
Implementation
ComposedPipelineBase.add_parallel_stages()declares one dependency-free execution level.ParallelExecutorruns eligible replicated stages on the caller stream plus reused side CUDA streams. Every member must opt intoconcurrency_safeand return the same request object.PipelineStage.may_use_collectivesindependently declares cross-rank communication. Multiple collective members are placed in declaration-ordered epochs; non-collective siblings can overlap the first epoch without risking rank-dependent NCCL ordering.ImageVAEEncodingStagereads an explicit VAE capability. Wan VAE reports an encode collective only when spatial-parallel encode is active.--parallel-stage-execution serialretain serial execution.serialis the default.autois explicit because overlap can increase the temporary activation/workspace peak.Adoption
Wan I2V and I2V-DMD, Flux2, Qwen Image Edit, Joy Image Edit, MOVA, LongLive2, and the independent LingBot realtime conditioning branches declare applicable parallel groups.
Validation
CI States
Latest PR Test (Base): ✅ Run #32321535556
Latest PR Test (Extra): ✅ Run #32321535429
Latest PR Test (AMD ROCm 7.2): ❌ Run #32321535580