[feat] dreamverse: sequence parallelism for serving - #1424
Conversation
Add DREAMVERSE_SP_SIZE to run a single generation across multiple GPUs via sequence parallelism. Defaults to 1, which is byte-for-byte the existing single-GPU-per-session behaviour. - config: DREAMVERSE_SP_SIZE env knob - gpu_pool: group visible GPUs into SP slots, expose the whole group to the worker (CUDA_VISIBLE_DEVICES="g0,g1,..."), keyed by the first GPU - video_generation: drive engine num_gpus from DREAMVERSE_SP_SIZE - ltx2: drop @torch.compiler.disable on LTXDistributedAttention so the all-to-all distributed attention compiles into the fullgraph at sp>1
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟠 PR merge requirementsWaiting for
Waiting checks:
|
There was a problem hiding this comment.
Code Review
This pull request introduces sequence-parallel (SP) support to Dreamverse by adding a new DREAMVERSE_SP_SIZE configuration. It updates the GPU pool manager to group available GPUs into sequence-parallel slots of this size, configures the video generation engine to use the specified number of GPUs, and removes the @torch.compiler.disable decorator from the forward pass in fastvideo/models/dits/ltx2.py. The review feedback suggests adding a warning log in gpu_pool.py to inform operators when some GPUs are left idle because they cannot be evenly grouped into sequence-parallel slots.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| sp_size = DREAMVERSE_SP_SIZE | ||
| groups = [gpu_ids[i:i + sp_size] for i in range(0, len(gpu_ids), sp_size)] | ||
| groups = [g for g in groups if len(g) == sp_size] |
There was a problem hiding this comment.
When DREAMVERSE_SP_SIZE is greater than 1, any available GPUs that do not fit evenly into sequence-parallel groups of size sp_size are silently dropped. It would be highly beneficial to log a warning message to inform the operator that some GPUs will remain idle due to the grouping configuration.
sp_size = DREAMVERSE_SP_SIZE
groups = [gpu_ids[i:i + sp_size] for i in range(0, len(gpu_ids), sp_size)]
unused_count = len(gpu_ids) % sp_size
if unused_count > 0:
print(f"[WARNING] {unused_count} GPU(s) will be unused because they cannot be grouped into sequence-parallel slots of size {sp_size}.")
groups = [g for g in groups if len(g) == sp_size]
Pre-commit checks failedHi @shaoxiongduan, the pre-commit checks have failed. To fix them locally: # Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install
# Run all checks and auto-fix what's possible
pre-commit run --all-filesCommon fixes:
After fixing, commit and push the changes. The checks will re-run automatically. For future commits, |
|
Hi @shaoxiongduan — automated review from Gob, one of @SolitaryThinker's AI reviewers. Findings below are advisory; pushback welcome, especially on the S2 and S3 calls which are judgment-dependent. The S1 mirrors Gemini's prior flag at the same HEAD. Summary (verdict: ship-with-fixes)Small, focused PR. Config guards are right, GPU grouping is contiguous and keyed by leader, the
One optional clarification (S3) on SP-vs-TP semantics. [S1]
|
1 similar comment
|
Hi @shaoxiongduan — automated review from Gob, one of @SolitaryThinker's AI reviewers. Findings below are advisory; pushback welcome, especially on the S2 and S3 calls which are judgment-dependent. The S1 mirrors Gemini's prior flag at the same HEAD. Summary (verdict: ship-with-fixes)Small, focused PR. Config guards are right, GPU grouping is contiguous and keyed by leader, the
One optional clarification (S3) on SP-vs-TP semantics. [S1]
|
Fix pre-commit yapf failure on the sequence-parallel slot grouping block; line-wrap to match repo 120-col style. No logic change.
Add DREAMVERSE_SP_SIZE to run a single generation across multiple GPUs via sequence parallelism. Defaults to 1, which is byte-for-byte the existing single-GPU-per-session behavior.