[Bug][CI] Pin the LTX FP8 quality gate to its established sigma schedule (#5302)

Signed-off-by: mglyn <1203789601@qq.com>
This commit is contained in:
Mu GuanLin authored and GitHub committed 2026-07-22 14:36:32 +08:00
1 parent 24eb4ab89c
commit 39e83e27f0
7 files changed
+134 -19

No files matched your search

@@ -17,7 +17,11 @@ from vllm_omni.diffusion.models.ltx2.ltx2_components import (
LTX23_COMPONENT_PROFILE,
)
from vllm_omni.diffusion.models.ltx2.ltx2_conditioning import LTXI2VConditioningMixin
from vllm_omni.diffusion.models.ltx2.ltx2_denoise import LTXDenoiseExecutor, LTXPhaseResult
from vllm_omni.diffusion.models.ltx2.ltx2_denoise import (
LTXDenoiseExecutor,
LTXPhaseResult,
prepare_scheduler_stage,
)
from vllm_omni.diffusion.models.ltx2.ltx2_guidance import (
LTX_LEGACY_VELOCITY_GUIDANCE,
LTX_OFFICIAL_X0_GUIDANCE,
@@ -324,6 +328,38 @@ def test_ltx2_two_stage_reuses_prompt_context_between_phases():
torch.testing.assert_close(output.output[1], torch.tensor([4.0]))
def test_ltx_custom_sigmas_bypass_scheduler_shifting():
from diffusers import FlowMatchEulerDiscreteScheduler
scheduler = FlowMatchEulerDiscreteScheduler(
use_dynamic_shifting=True,
base_shift=0.95,
max_shift=2.05,
shift_terminal=0.1,
)
pipeline = SimpleNamespace(
scheduler=scheduler,
_make_video_audio_scheduler=lambda *args, **kwargs: object(),
)
sigmas = [1.0, 0.75, 0.25, 0.0]
audio_scheduler, _, timesteps = prepare_scheduler_stage(
pipeline,
SimpleNamespace(num_inference_steps=3),
device=torch.device("cpu"),
sigmas=sigmas,
timesteps=None,
latent_num_frames=1,
latent_height=1,
latent_width=1,
)
expected = torch.tensor(sigmas, dtype=torch.float32)
torch.testing.assert_close(pipeline.scheduler.sigmas, expected)
torch.testing.assert_close(audio_scheduler.sigmas, expected)
torch.testing.assert_close(timesteps, expected[:-1] * scheduler.config.num_train_timesteps)
class TestLTXRequestParsing:
@pytest.mark.parametrize(
("t2v_cls", "i2v_cls"),
@@ -513,6 +549,7 @@ class TestLTX23ForwardStages:
from vllm_omni.inputs.data import OmniDiffusionSamplingParams
pipe = _make_ltx_request_pipe(LTX23Pipeline)
request_sigmas = [1.0, 0.4]
req = DiffusionRequestBatch(
[
OmniDiffusionRequest(
@@ -525,12 +562,13 @@ class TestLTX23ForwardStages:
num_inference_steps=3,
guidance_scale=4.5,
output_type="latent",
sigmas=request_sigmas,
),
request_id="ltx23-t2v-forward-stage-delegation",
)
]
)
sigmas = [1.0, 0.5]
fallback_sigmas = [1.0, 0.5]
timesteps = [1000, 500]
attention_kwargs = {"scale": 1.0}
seen = {}
@@ -545,7 +583,7 @@ class TestLTX23ForwardStages:
output = pipe.forward(
req,
sigmas=sigmas,
sigmas=fallback_sigmas,
timesteps=timesteps,
noise_scale=0.25,
attention_kwargs=attention_kwargs,
@@ -561,7 +599,7 @@ class TestLTX23ForwardStages:
assert seen["request_inputs"].output_type == "latent"
assert seen["kwargs"] == {
"noise_scale": 0.25,
"sigmas": sigmas,
"sigmas": request_sigmas,
"timesteps": timesteps,
"attention_kwargs": attention_kwargs,
}
@@ -82,6 +82,7 @@ class QualityTestConfig:
gpu: str = "H100" # minimum GPU requirement
negative_prompt: str = ""
guidance_scale: float | None = None
sigmas: list[float] | None = None
enable_cpu_offload: bool = False
def baseline_ref(self) -> str:
@@ -215,6 +216,19 @@ QUALITY_CONFIGS = [
width=256,
num_frames=25,
num_inference_steps=8,
# Preserve the final scheduler trajectory used when this FP8 quality
# gate was established. Explicit LTX sigmas bypass dynamic shifting.
sigmas=[
1.0,
0.92185378074646,
0.8327768445014954,
0.7303033471107483,
0.6111654043197632,
0.4709382653236389,
0.30347853899002075,
0.10000002384185791,
0.0,
],
),
]
@@ -322,6 +336,7 @@ def _generate_video(omni, config: QualityTestConfig):
num_inference_steps=config.num_inference_steps,
num_frames=config.num_frames,
guidance_scale=config.guidance_scale,
sigmas=config.sigmas,
),
)
@@ -446,6 +461,33 @@ def test_benchmark_generate_image_unwraps_nested_omni_request_output(monkeypatch
assert peak_mem == 0.0
def test_generate_video_forwards_sigmas(monkeypatch):
from vllm_omni.platforms import current_omni_platform
monkeypatch.setattr(current_omni_platform, "device_type", "cpu", raising=False)
monkeypatch.setattr(torch.accelerator, "reset_peak_memory_stats", lambda: None, raising=False)
monkeypatch.setattr(torch.accelerator, "max_memory_allocated", lambda: 0, raising=False)
captured = SimpleNamespace(sampling=None)
class DummyOmni:
def generate(self, _prompt, sampling):
captured.sampling = sampling
return [SimpleNamespace(images=[np.zeros((1, 2, 2, 3), dtype=np.float32)])]
config = QualityTestConfig(
id="ltx-sigmas",
model="unused",
quantization="fp8",
task="t2v",
prompt="test",
max_lpips=0.1,
sigmas=[1.0, 0.5],
)
_generate_video(DummyOmni(), config)
assert captured.sampling.sigmas == [1.0, 0.5]
_marks = hardware_marks(res={"cuda": "H100"})
_OUTPUT_DIR = Path(os.environ["VLLM_OMNI_QUALITY_OUTPUT_DIR"]) if "VLLM_OMNI_QUALITY_OUTPUT_DIR" in os.environ else None