diff --git a/studio/backend/core/inference/video.py b/studio/backend/core/inference/video.py index 9e83ae8949..9036befd67 100644 --- a/studio/backend/core/inference/video.py +++ b/studio/backend/core/inference/video.py @@ -1011,10 +1011,10 @@ class VideoBackend: vae_tiling = vae_tiling, memory_mode = plan.requested_mode, speed_mode = effective_speed, - # Only the optimisations that actually engaged: apply_speed_optims - # returns every flag with True/False, and iterating the dict raw - # would report disabled ones as active in /video/status. - speed_optims = tuple(k for k, v in (speed_optims or {}).items() if v), + # Already filtered above to only the optimisations that engaged; + # apply_speed_optims returns every flag True/False and the view + # loop keeps just the True names. + speed_optims = speed_optims, backend_flags = backend_flags, attention_backend = attention_engaged, transformer_cache = cache_engaged, diff --git a/studio/backend/tests/test_video_backend.py b/studio/backend/tests/test_video_backend.py index a6e1b5cdf3..69a02fefae 100644 --- a/studio/backend/tests/test_video_backend.py +++ b/studio/backend/tests/test_video_backend.py @@ -404,6 +404,25 @@ def test_load_generate_unload_gguf(fake_runtime, tmp_path): assert status["loaded"] is False +def test_load_records_engaged_speed_optims(fake_runtime, tmp_path, monkeypatch): + # Regression: the load tail once re-ran the already-filtered speed_optims + # tuple through ``.items()`` as if it were still the raw applied dict, so + # every real-GPU load (where at least channels_last engages) crashed with + # 'tuple' object has no attribute 'items'. Fake runtime forces every optim + # False, so this only reproduces when one is made to engage. + from core.inference import video as video_mod + + monkeypatch.setattr( + video_mod, + "apply_speed_optims", + lambda *a, **k: {"channels_last": True, "cudnn_benchmark": False}, + ) + backend = VideoBackend() + status = _load_gguf(backend, tmp_path) + assert status["loaded"] is True + assert status["speed_optims"] == ["channels_last"] + + def test_generate_defaults_from_variant(fake_runtime, tmp_path): # A distilled GGUF pick defaults to the few-step no-CFG schedule. (tmp_path / "ltx-2.3-22b-distilled-1.1-Q4_K_M.gguf").write_bytes(b"w")