test_lazy_torch_compile.py 521 Bytes
Newer Older
1
2
3
4
5
# Description: Test the lazy import module
# The utility function cannot be placed in `vllm.utils`
# this needs to be a standalone script
import sys

youkaichao's avatar
youkaichao committed
6
from vllm_test_utils import blame
7
8
9
10
11
12
13
14
15
16

module_name = "torch._inductor.async_compile"

with blame(lambda: module_name in sys.modules) as result:
    import vllm  # noqa

assert not result.found, (f"Module {module_name} is already imported, the"
                          f" first import location is:\n{result.trace_stack}")

print(f"Module {module_name} is not imported yet")