@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 6e5595ca39
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 11:00 UTC

[CI/Build] Automatically retry flaky tests (#17856)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>

Cyrus Leung committed May 9, 2025 at 23:55 UTC 6e5595ca396f5e33e6c27cc5c8d514835d21199f
3 files changed +2 -35
tests/kernels/moe/test_moe.py
+1
@@ -286,6 +286,7 @@ def test_mixtral_moe(dtype: torch.dtype, padding: bool, use_rocm_aiter: bool,
286 atol=mixtral_moe_tol[dtype])
287
288
289 +@pytest.mark.flaky(reruns=2)
290 @pytest.mark.parametrize("m", [1, 123, 666])
291 @pytest.mark.parametrize("n", [128, 1024])
292 @pytest.mark.parametrize("k", [256, 2048])
tests/tensorizer_loader/conftest.py
-33
@@ -1,12 +1,5 @@
1 # SPDX-License-Identifier: Apache-2.0
2 -
3 -import functools
4 -import gc
5 -from typing import Callable, TypeVar
6 -
2 import pytest
8 -import torch
9 -from typing_extensions import ParamSpec
3
4 from vllm.distributed import cleanup_dist_env_and_memory
5 from vllm.model_executor.model_loader.tensorizer import TensorizerConfig
@@ -25,32 +18,6 @@ def cleanup():
18 cleanup_dist_env_and_memory(shutdown_ray=True)
19
20
28 -_P = ParamSpec("_P")
29 -_R = TypeVar("_R")
30 -
31 -
32 -def retry_until_skip(n: int):
33 -
34 - def decorator_retry(func: Callable[_P, _R]) -> Callable[_P, _R]:
35 -
36 - @functools.wraps(func)
37 - def wrapper_retry(*args: _P.args, **kwargs: _P.kwargs) -> _R:
38 - for i in range(n):
39 - try:
40 - return func(*args, **kwargs)
41 - except AssertionError:
42 - gc.collect()
43 - torch.cuda.empty_cache()
44 - if i == n - 1:
45 - pytest.skip(f"Skipping test after {n} attempts.")
46 -
47 - raise AssertionError("Code should not be reached")
48 -
49 - return wrapper_retry
50 -
51 - return decorator_retry
52 -
53 -
21 @pytest.fixture(autouse=True)
22 def tensorizer_config():
23 config = TensorizerConfig(tensorizer_uri="vllm")
tests/tensorizer_loader/test_tensorizer.py
+1 -2
@@ -28,7 +28,6 @@ from vllm.model_executor.model_loader.tensorizer import (TensorizerConfig,
28 from vllm.utils import PlaceholderModule, import_from_path
29
30 from ..utils import VLLM_PATH, RemoteOpenAIServer
31 -from .conftest import retry_until_skip
31
32 try:
33 from tensorizer import EncryptionParams
@@ -325,7 +324,7 @@ def test_deserialized_encrypted_vllm_model_with_tp_has_same_outputs(
324 assert outputs == deserialized_outputs
325
326
328 -@retry_until_skip(3)
327 +@pytest.mark.flaky(reruns=3)
328 def test_vllm_tensorized_model_has_same_outputs(vllm_runner, tmp_path):
329 gc.collect()
330 torch.cuda.empty_cache()