[CI][Bugfix] Refactor the test case to add support for increasing init timeout and stage init timeout in order to resolve the CI timeout error. (#2711)
Signed-off-by: wangyu <410167048@qq.com>
This commit is contained in:
1 parent
d9e745ce2c
commit
22261430b4
31 files changed
+480
-721
No files matched your search
@@ -29,7 +29,6 @@ Usage:
|
||||
import os
|
||||
|
||||
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"
|
||||
os.environ["VLLM_TEST_CLEAN_GPU_MEMORY"] = "1"
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
@@ -37,8 +36,8 @@ from typing import Any
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from tests.conftest import OmniRunner
|
||||
from tests.utils import hardware_test
|
||||
from vllm_omni.entrypoints.omni import Omni
|
||||
from vllm_omni.inputs.data import OmniDiffusionSamplingParams
|
||||
from vllm_omni.outputs import OmniRequestOutput
|
||||
from vllm_omni.platforms import current_omni_platform
|
||||
@@ -61,16 +60,15 @@ def _generate_single_stage_image(
|
||||
|
||||
Returns (images, peak_memory_gib).
|
||||
"""
|
||||
omni_kwargs: dict[str, Any] = {"model": model, **extra_omni_kwargs}
|
||||
omni_kwargs: dict[str, Any] = dict(extra_omni_kwargs)
|
||||
if quantization:
|
||||
omni_kwargs["quantization"] = quantization
|
||||
|
||||
omni = Omni(**omni_kwargs)
|
||||
try:
|
||||
with OmniRunner(model, **omni_kwargs) as runner:
|
||||
torch.cuda.reset_peak_memory_stats()
|
||||
|
||||
generator = torch.Generator(device=current_omni_platform.device_type).manual_seed(seed)
|
||||
outputs = omni.generate(
|
||||
outputs = runner.omni.generate(
|
||||
"a photo of a cat sitting on a laptop keyboard",
|
||||
OmniDiffusionSamplingParams(
|
||||
height=height,
|
||||
@@ -94,8 +92,6 @@ def _generate_single_stage_image(
|
||||
assert images[0].height == height
|
||||
|
||||
return images, peak_mem
|
||||
finally:
|
||||
omni.close()
|
||||
|
||||
|
||||
def _generate_bagel_image(
|
||||
@@ -115,8 +111,9 @@ def _generate_bagel_image(
|
||||
if quantization_config:
|
||||
omni_kwargs["quantization_config"] = quantization_config
|
||||
|
||||
omni = Omni(**omni_kwargs)
|
||||
try:
|
||||
model_name = omni_kwargs.pop("model")
|
||||
with OmniRunner(model_name, **omni_kwargs) as runner:
|
||||
omni = runner.omni
|
||||
torch.cuda.reset_peak_memory_stats()
|
||||
|
||||
params_list = omni.default_sampling_params_list
|
||||
@@ -168,8 +165,6 @@ def _generate_bagel_image(
|
||||
)
|
||||
|
||||
return generated_image, peak_mem
|
||||
finally:
|
||||
omni.close()
|
||||
|
||||
|
||||
# ─── Single-stage diffusion model tests ──────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user