Commit 66b809cc authored by zhuwenwen's avatar zhuwenwen
Browse files

Merge tag 'v0.7.2' into v0.7.2-dev

parents 37b63c24 0408efc6
# SPDX-License-Identifier: Apache-2.0
"""Tests which cover integration of the speculative decoding framework with
other features, e.g. cuda graphs.
"""
......
# SPDX-License-Identifier: Apache-2.0
"""Tests which cover integration of the speculative decoding framework with
tensor parallelism.
"""
......
# SPDX-License-Identifier: Apache-2.0
"""Tests which cover integration of the speculative decoding framework with
tensor parallelism.
"""
......
# SPDX-License-Identifier: Apache-2.0
from itertools import cycle
import pytest
......
# SPDX-License-Identifier: Apache-2.0
"""This docstring details important information on the testing methodology.
Most of the tests rely on "greedy equality", where we expect the output of
......
# SPDX-License-Identifier: Apache-2.0
"""This docstring details important information on the testing methodology.
Most of the tests rely on "greedy equality", where we expect the output of
......
# SPDX-License-Identifier: Apache-2.0
"""The tests in this file verify end-to-end speculative decoding correctness.
This docstring details important information on the testing methodology.
......
# SPDX-License-Identifier: Apache-2.0
"""This docstring details important information on the testing methodology.
Most of the tests rely on "greedy equality", where we expect the output of
......
# SPDX-License-Identifier: Apache-2.0
import pytest
import os
......
# SPDX-License-Identifier: Apache-2.0
from typing import List
import pytest
......
# SPDX-License-Identifier: Apache-2.0
from unittest.mock import MagicMock, patch
import pytest
......
# SPDX-License-Identifier: Apache-2.0
import math
from unittest.mock import MagicMock
......
# SPDX-License-Identifier: Apache-2.0
import random
from typing import Dict, List
from unittest.mock import MagicMock
......
# SPDX-License-Identifier: Apache-2.0
import torch
import os
......
# SPDX-License-Identifier: Apache-2.0
import random
from typing import List
......
# SPDX-License-Identifier: Apache-2.0
import random
from collections import defaultdict
from types import SimpleNamespace
......
# SPDX-License-Identifier: Apache-2.0
from unittest.mock import MagicMock
import pytest
......
# SPDX-License-Identifier: Apache-2.0
from itertools import count
from typing import Callable, Dict, List, Optional
from typing import Sequence as GenericSequence
......
# SPDX-License-Identifier: Apache-2.0
# Description: Test the lazy import module
# The utility function cannot be placed in `vllm.utils`
# this needs to be a standalone script
......@@ -6,7 +8,17 @@ from contextlib import nullcontext
from vllm_test_utils import BlameResult, blame
module_name = "torch._inductor.async_compile"
# List of modules that should not be imported too early.
# Lazy import `torch._inductor.async_compile` to avoid creating
# too many processes before we set the number of compiler threads.
# Lazy import `cv2` to avoid bothering users who only use text models.
# `cv2` can easily mess up the environment.
module_names = ["torch._inductor.async_compile", "cv2"]
def any_module_imported():
return any(module_name in sys.modules for module_name in module_names)
# In CI, we only check finally if the module is imported.
# If it is indeed imported, we can rerun the test with `use_blame=True`,
......@@ -14,8 +26,7 @@ module_name = "torch._inductor.async_compile"
# and help find the root cause.
# We don't run it in CI by default because it is slow.
use_blame = False
context = blame(
lambda: module_name in sys.modules) if use_blame else nullcontext()
context = blame(any_module_imported) if use_blame else nullcontext()
with context as result:
import vllm # noqa
......@@ -23,6 +34,6 @@ if use_blame:
assert isinstance(result, BlameResult)
print(f"the first import location is:\n{result.trace_stack}")
assert module_name not in sys.modules, (
f"Module {module_name} is imported. To see the first"
assert not any_module_imported(), (
f"Some the modules in {module_names} are imported. To see the first"
f" import location, run the test with `use_blame=True`.")
# SPDX-License-Identifier: Apache-2.0
import functools
import gc
from typing import Callable, TypeVar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment