vllm/tests/test_lazy_torch_compile.py
youkaichao 334d64d1e8
[ci] add vllm_test_utils (#10659)
Signed-off-by: youkaichao <youkaichao@gmail.com>
2024-11-26 00:20:04 -08:00

17 lines
521 B
Python

# Description: Test the lazy import module
# The utility function cannot be placed in `vllm.utils`
# this needs to be a standalone script
import sys
from vllm_test_utils import blame
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")