Skip to content

Commit 3b5a721

Browse files
committed
add spec decode e2e UT && replace logger mode
Signed-off-by: mengwei805 <[email protected]>
1 parent 2f15503 commit 3b5a721

File tree

14 files changed

+854
-34
lines changed

14 files changed

+854
-34
lines changed

tests/conftest.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@
1717
# limitations under the License.
1818
#
1919

20+
import contextlib
21+
import gc
2022
from typing import List, Optional, Tuple, TypeVar, Union
2123

2224
import numpy as np
2325
import pytest
26+
import torch
2427
from PIL import Image
2528
from vllm import LLM, SamplingParams
2629
from vllm.config import TaskOption
27-
from vllm.distributed import cleanup_dist_env_and_memory
30+
from vllm.distributed import (destroy_distributed_environment,
31+
destroy_model_parallel)
2832
from vllm.inputs import ExplicitEncoderDecoderPrompt, TextPrompt, TokensPrompt
2933
from vllm.logger import init_logger
3034
from vllm.outputs import RequestOutput
@@ -44,6 +48,15 @@
4448
PromptVideoInput = _PromptMultiModalInput[np.ndarray]
4549

4650

51+
def cleanup_dist_env_and_memory():
52+
destroy_model_parallel()
53+
destroy_distributed_environment()
54+
with contextlib.suppress(AssertionError):
55+
torch.distributed.destroy_process_group()
56+
gc.collect()
57+
torch.npu.empty_cache()
58+
59+
4760
class VllmRunner:
4861

4962
def __init__(

0 commit comments

Comments
 (0)