Fix LTX2 channels-last review scope

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
Hongsheng Liu committed 2026-08-12 23:02:51 +08:00
1 parent 81e5e8e3bb
commit dc072a12bd
11 files changed
+35 -60

No files matched your search

+5 -9
View File
@@ -779,13 +779,8 @@ def test_structured_diffusion_config_rejects_non_boolean_compile_dynamic():
omni_config_module._DiffusionConfigProjection(diffusion_compile_dynamic="false")
def test_structured_diffusion_config_rejects_non_boolean_vae_channels_last_3d():
with pytest.raises(ValidationError, match="vae_use_channels_last_3d"):
omni_config_module._DiffusionConfigProjection(vae_use_channels_last_3d="true")
def test_from_pipeline_config_routes_vae_channels_last_3d(tmp_path):
deploy_path = tmp_path / "dreamzero_vae_layout.yaml"
def test_from_pipeline_config_routes_ltx2_model_extra(tmp_path):
deploy_path = tmp_path / "dreamzero_ltx2_extras.yaml"
deploy_path.write_text(
"\n".join(
[
@@ -793,14 +788,15 @@ def test_from_pipeline_config_routes_vae_channels_last_3d(tmp_path):
"async_chunk: false",
"stages:",
" - stage_id: 0",
" vae_use_channels_last_3d: true",
" extras:",
" ltx2_use_channels_last_3d: true",
]
)
)
stage = _from_pipeline_key("dreamzero", deploy_config_path=str(deploy_path)).stage_by_id(0)
assert stage.diffusion_config.vae_use_channels_last_3d is True
assert stage.diffusion_config.extras["ltx2_use_channels_last_3d"] is True
def test_structured_diffusion_config_rejects_invalid_compile_granularity():
@@ -12,6 +12,21 @@ pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
class TestLTXChannelsLast3D:
@pytest.mark.parametrize(
("extras", "expected"),
[({}, False), ({"ltx2_use_channels_last_3d": True}, True)],
)
def test_channels_last_opt_in_is_ltx2_model_extra(self, extras, expected):
from vllm_omni.diffusion.models.ltx2.ltx2_components import _ltx2_use_channels_last_3d
assert _ltx2_use_channels_last_3d(SimpleNamespace(extras=extras)) is expected
def test_channels_last_opt_in_rejects_non_boolean_model_extra(self):
from vllm_omni.diffusion.models.ltx2.ltx2_components import _ltx2_use_channels_last_3d
with pytest.raises(TypeError, match="ltx2_use_channels_last_3d"):
_ltx2_use_channels_last_3d(SimpleNamespace(extras={"ltx2_use_channels_last_3d": "true"}))
@pytest.mark.parametrize(
("causal", "kernel_size"),
[
-12
View File
@@ -534,18 +534,6 @@ class TestDiffusionCompileConfig:
with pytest.raises(TypeError, match="diffusion_compile_dynamic"):
OmniDiffusionConfig(model="test", diffusion_compile_dynamic="false")
def test_channels_last_3d_is_opt_in_and_strict(self) -> None:
assert OmniDiffusionConfig(model="test").vae_use_channels_last_3d is False
assert (
OmniDiffusionConfig.from_kwargs(
model="test",
vae_use_channels_last_3d=True,
).vae_use_channels_last_3d
is True
)
with pytest.raises(TypeError, match="vae_use_channels_last_3d"):
OmniDiffusionConfig(model="test", vae_use_channels_last_3d="true")
@pytest.mark.parametrize(
"kwargs, feature",
[
@@ -20,7 +20,7 @@ def test_default_stage_config_includes_cache_backend():
"cache_backend": "cache_dit",
"cache_config": '{"Fn_compute_blocks": 2}',
"vae_use_slicing": True,
"vae_use_channels_last_3d": True,
"extras": {"ltx2_use_channels_last_3d": True},
"ulysses_degree": 2,
}
)[0]
@@ -30,7 +30,7 @@ def test_default_stage_config_includes_cache_backend():
assert engine_args["cache_backend"] == "cache_dit"
assert engine_args["cache_config"]["Fn_compute_blocks"] == 2
assert engine_args["vae_use_slicing"] is True
assert engine_args["vae_use_channels_last_3d"] is True
assert engine_args["extras"]["ltx2_use_channels_last_3d"] is True
assert engine_args["parallel_config"].ulysses_degree == 2
assert engine_args["model_stage"] == "diffusion"
@@ -373,25 +373,6 @@ def test_serve_cli_accepts_diffusion_compile_controls():
assert stage_cfg["engine_args"]["diffusion_compile_dynamic"] is False
def test_serve_cli_accepts_vae_channels_last_3d_opt_in():
parser = TrackingArgumentParser()
subparsers = parser.add_subparsers(dest="command")
OmniServeCommand().subparser_init(subparsers)
args = parser.parse_args(
[
"serve",
"Lightricks/LTX-2",
"--omni",
"--vae-use-channels-last-3d",
]
)
stage_cfg = AsyncOmniEngine._create_default_diffusion_stage_cfg(args.get_explicit_kwargs_dict())[0]
assert args.vae_use_channels_last_3d is True
assert stage_cfg["engine_args"]["vae_use_channels_last_3d"] is True
def test_serve_cli_accepts_diffusion_attention_backend():
"""Ensure diffusion serve CLI exposes the shorthand backend flag."""
parser = TrackingArgumentParser()