Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user_guide/diffusion_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The following tables show which models support each feature:
|-------|:----------:|:-----------:|:---------------------:|:--------------:|:-----------------:|:------:|:------------------------:|:--------------------:|:--------------:|:----------------:|
| **Wan2.2** | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ (encode/decode) | ❌ | ❌ |
| **Wan2.1-VACE** | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ (decode) | ❌ | ❌ |
| **LTX-2** | ❌ | ✅ | ✅ | ✅ | ✅ | | ✅ | ❌ | ❌ | ❌ |
| **LTX-2** | ❌ | ✅ | ✅ | ✅ | ✅ | | ✅ | ❌ | ❌ | ❌ |
| **Helios** | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| **HunyuanVideo-1.5 T2V I2V** | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ (decode) | ✅ | ❌ |
| **DreamID-Omni** | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
Expand Down
8 changes: 8 additions & 0 deletions docs/user_guide/examples/online_serving/text_to_video.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ vllm serve Lightricks/LTX-2 --omni --port 8098 \
--enforce-eager --flow-shift 1.0 --boundary-ratio 1.0
```

For multi-GPU memory reduction, you can enable HSDP:

```bash
vllm serve Lightricks/LTX-2 --omni --port 8098 \
--enforce-eager --flow-shift 1.0 --boundary-ratio 1.0 \
--use-hsdp --hsdp-shard-size 2
```

#### Start with Optimization Presets

Use the LTX-2 startup script with built-in optimization presets:
Expand Down
25 changes: 25 additions & 0 deletions tests/diffusion/models/ltx2/test_ltx2_hsdp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
import torch.nn as nn

from vllm_omni.diffusion.models.ltx2.ltx2_transformer import LTX2VideoTransformer3DModel

Comment thread
fywc marked this conversation as resolved.
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]


def test_ltx2_exposes_hsdp_shard_conditions_for_transformer_blocks():
model = object.__new__(LTX2VideoTransformer3DModel)
nn.Module.__init__(model)
model.transformer_blocks = nn.ModuleList([nn.Linear(4, 4) for _ in range(2)])
model.norm_out = nn.LayerNorm(4)

conditions = getattr(model, "_hsdp_shard_conditions", None)

assert conditions is not None
assert len(conditions) == 1

matched = []
for name, module in model.named_modules():
if any(cond(name, module) for cond in conditions):
matched.append(name)

assert matched == ["transformer_blocks.0", "transformer_blocks.1"]
2 changes: 2 additions & 0 deletions vllm_omni/diffusion/models/ltx2/ltx2_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

from vllm_omni.diffusion.attention.backends.abstract import AttentionMetadata
from vllm_omni.diffusion.attention.layer import Attention
from vllm_omni.diffusion.distributed.hsdp_utils import is_transformer_block_module
from vllm_omni.diffusion.distributed.sp_plan import SequenceParallelInput, SequenceParallelOutput
from vllm_omni.diffusion.forward_context import get_forward_context, is_forward_context_available

Expand Down Expand Up @@ -1265,6 +1266,7 @@ class LTX2VideoTransformer3DModel(nn.Module):
_skip_layerwise_casting_patterns = ["norm"]
_repeated_blocks = ["LTX2VideoTransformerBlock"]
_layerwise_offload_blocks_attrs = ["transformer_blocks"]
_hsdp_shard_conditions = [is_transformer_block_module]
_sp_plan: dict[str, Any] | None = None

@staticmethod
Expand Down
Loading