[CI/Build] Share nightly CUDA YAML between H100/L4 and B200 (#7028)

Signed-off-by: wangyu <410167048@qq.com>
Signed-off-by: [Your Name] [Your Email]
Signed-off-by: [Your Name] <your.email@example.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
authored and GitHub committed 2026-09-14 14:27:10 +08:00
1 parent 58adeec05f
commit 64903b8e30
78 files changed
+437 -321

No files matched your search

@@ -109,7 +109,7 @@ def _generate_single_stage_image(
return images, peak_mem
@hardware_test(res={"cuda": "L4"})
@hardware_test(res={"cuda": ["L4", "B200"]})
@pytest.mark.full_model
@pytest.mark.diffusion
@pytest.mark.parametrize("model", [Z_IMAGE_CONFIG, FLUX_CONFIG], ids=["Z-Image-Turbo", "FLUX.2-klein"])
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""
End-to-end tests for the unified quantization framework (PR #1764).
@@ -270,7 +270,7 @@ def _generate_bagel_image(
# ─── Single-stage diffusion model tests ──────────────────────────────────────
@hardware_test(res={"cuda": "L4"})
@hardware_test(res={"cuda": ["L4", "B200"]})
def test_single_stage_zimage_fp8():
"""Z-Image-Turbo with FP8 generates valid images."""
images, _ = _generate_single_stage_image(
@@ -281,7 +281,7 @@ def test_single_stage_zimage_fp8():
images[0].save("test_zimage_fp8.png")
@hardware_test(res={"cuda": "L4"})
@hardware_test(res={"cuda": ["L4", "B200"]})
def test_single_stage_zimage_fp8_uses_less_memory():
"""FP8 should use less peak memory than BF16 for Z-Image-Turbo."""
_, mem_bf16 = _generate_single_stage_image(
@@ -300,7 +300,7 @@ def test_single_stage_zimage_fp8_uses_less_memory():
assert mem_fp8 < mem_bf16, f"FP8 ({mem_fp8:.2f} GiB) should use less memory than BF16 ({mem_bf16:.2f} GiB)"
@hardware_test(res={"cuda": "L4", "xpu": "B60"})
@hardware_test(res={"cuda": ["L4", "B200"], "xpu": "B60"})
@pytest.mark.advanced_model
def test_single_stage_qwen_image_fp8():
"""Qwen-Image (random weights) with FP8 generates valid images."""
@@ -316,7 +316,7 @@ def test_single_stage_qwen_image_fp8():
images[0].save("test_qwen_image_fp8.png")
@hardware_test(res={"cuda": "H100"})
@hardware_test(res={"cuda": ["H100", "B200"]})
@pytest.mark.skip(reason="This model is not authorized on Hugging Face Hub yet")
def test_single_stage_flux_fp8():
"""FLUX.1-dev with FP8 generates valid images."""
@@ -331,7 +331,7 @@ def test_single_stage_flux_fp8():
images[0].save("test_flux_fp8.png")
@hardware_test(res={"cuda": "H100"})
@hardware_test(res={"cuda": ["H100", "B200"]})
@pytest.mark.skip(reason="This model is not authorized on Hugging Face Hub yet")
def test_single_stage_flux_fp8_uses_less_memory():
"""FP8 should use less peak memory than BF16 for FLUX.1-dev."""
@@ -357,7 +357,7 @@ def test_single_stage_flux_fp8_uses_less_memory():
assert mem_fp8 < mem_bf16, f"FP8 ({mem_fp8:.2f} GiB) should use less memory than BF16 ({mem_bf16:.2f} GiB)"
@hardware_test(res={"cuda": "H100"})
@hardware_test(res={"cuda": ["H100", "B200"]})
def test_single_stage_ltx2_fp8_uses_less_memory():
"""FP8 should use less peak memory than BF16 for LTX-2."""
_, mem_bf16 = _generate_single_stage_video(
@@ -379,7 +379,7 @@ def test_single_stage_ltx2_fp8_uses_less_memory():
# ─── Multi-stage model tests (BAGEL) ─────────────────────────────────────────
@hardware_test(res={"cuda": "H100"})
@hardware_test(res={"cuda": ["H100", "B200"]})
def test_bagel_fp8_generates_image():
"""BAGEL with diffusion-stage FP8 generates a valid image.
@@ -392,7 +392,7 @@ def test_bagel_fp8_generates_image():
image.save("test_bagel_fp8.png")
@hardware_test(res={"cuda": "H100"})
@hardware_test(res={"cuda": ["H100", "B200"]})
def test_bagel_bf16_generates_image():
"""BAGEL without quantization generates a valid image (baseline)."""
image, _ = _generate_bagel_image(diffusion_quantization_config=None)
@@ -402,7 +402,7 @@ def test_bagel_bf16_generates_image():
# ─── Quantization config routing tests ────────────────────────────────────────
@hardware_test(res={"cuda": "L4"})
@hardware_test(res={"cuda": ["L4", "B200"]})
def test_quantization_key_maps_to_quantization_config():
"""The old 'quantization' kwarg should map to 'quantization_config'
in OmniDiffusionConfig.from_kwargs for backwards compatibility."""
@@ -413,7 +413,7 @@ def test_quantization_key_maps_to_quantization_config():
assert config.quantization_config.get_name() == "fp8"
@hardware_test(res={"cuda": "L4"})
@hardware_test(res={"cuda": ["L4", "B200"]})
def test_quantization_config_key_takes_priority():
"""When both 'quantization' and 'quantization_config' are set,
'quantization_config' takes priority."""
@@ -428,7 +428,7 @@ def test_quantization_config_key_takes_priority():
assert config.quantization_config.activation_scheme == "static"
@hardware_test(res={"cuda": "L4"})
@hardware_test(res={"cuda": ["L4", "B200"]})
def test_single_stage_quantization_config_key():
"""Single-stage model using quantization_config (dict) key generates images."""
images, _ = _generate_single_stage_image(
@@ -45,6 +45,7 @@ import pytest
import torch
from PIL import Image
from tests.e2e.accuracy.helpers import resolve_device_threshold
from tests.helpers.mark import hardware_marks
_REPO_ROOT = Path(__file__).resolve().parents[3]
@@ -70,7 +71,7 @@ class QualityTestConfig:
id: str # pytest ID, e.g. "fp8_z_image"
task: str # "t2i" or "t2v"
prompt: str # generation prompt
max_lpips: float # fail threshold — higher = more lenient
max_lpips: float | dict[str, float] # threshold, or {"H100": 0.15, "B200": 0.17}
model: str | None = None # HF model name
quantization: str | dict[str, object] | None = None # quantization method/config, e.g. "fp8"
baseline_model: str | None = None # explicit BF16/local baseline path
@@ -80,7 +81,6 @@ class QualityTestConfig:
num_inference_steps: int = 20 # keep low for CI speed
num_frames: int = 5 # only for t2v
seed: int = 42
gpu: str = "H100" # minimum GPU requirement
negative_prompt: str | None = ""
guidance_scale: float | None = None
sigmas: list[float] | None = None
@@ -190,7 +190,7 @@ QUALITY_CONFIGS = [
quantization={"text_encoder": "fp8", "transformer": None, "vae": None},
task="t2i",
prompt="a cup of coffee on a wooden table, morning light",
max_lpips=0.15,
max_lpips={"H100": 0.15, "B200": 0.17},
num_inference_steps=10,
enable_cpu_offload=True,
height=1024,
@@ -528,7 +528,7 @@ def test_ltx_quality_gate_uses_official_eager_defaults(monkeypatch):
assert captured.sampling.guidance_scale is None
_marks = hardware_marks(res={"cuda": "H100"})
_marks = hardware_marks(res={"cuda": ["H100", "B200"]})
_OUTPUT_DIR = Path(os.environ["VLLM_OMNI_QUALITY_OUTPUT_DIR"]) if "VLLM_OMNI_QUALITY_OUTPUT_DIR" in os.environ else None
@@ -588,8 +588,9 @@ def test_quantization_quality(config: QualityTestConfig):
# --- Similarity metrics ---
lpips_score = _compute_lpips(baseline_out, quant_out, config.task)
psnr_score, mae_score = _compute_psnr_and_mae(baseline_out, quant_out, config.task)
assert lpips_score <= config.max_lpips, (
f"LPIPS {lpips_score:.4f} exceeds threshold {config.max_lpips} "
gpu_key, max_lpips = resolve_device_threshold(config.max_lpips, label=f"{config.id} max_lpips")
assert lpips_score <= max_lpips, (
f"LPIPS {lpips_score:.4f} exceeds threshold {max_lpips} ({gpu_key}) "
f"for {config.quantization_ref() or 'pre-quantized checkpoint'} on {config.quantized_ref()}"
)
@@ -601,12 +602,12 @@ def test_quantization_quality(config: QualityTestConfig):
print(f" Baseline: {config.baseline_ref()}")
print(f" Quantized: {config.quantized_ref()}")
print(f" Method: {config.quantization_ref() or 'pre-quantized checkpoint'}")
print(f" LPIPS: {lpips_score:.4f} (threshold: {config.max_lpips})")
print(f" LPIPS: {lpips_score:.4f} (threshold: {max_lpips}, gpu: {gpu_key})")
print(f" PSNR: {psnr_score:.4f} dB (higher is better)")
print(f" MAE: {mae_score:.6f} (lower is better)")
print(f" BF16 memory: {bl_mem:.2f} GiB")
print(f" Quant memory: {qt_mem:.2f} GiB ({mem_reduction:.0f}% reduction)")
print(f" Result: {'PASS' if lpips_score <= config.max_lpips else 'FAIL'}")
print(f" Result: {'PASS' if lpips_score <= max_lpips else 'FAIL'}")
print(f"{'=' * 60}\n")
assert np.isfinite(psnr_score) or np.isinf(psnr_score), f"PSNR is invalid for {config.id}: {psnr_score}"