[Bugfix] Move current_platform import to avoid python import cache. (#16601)

Signed-off-by: iwzbi <wzbi@zju.edu.cn>
This commit is contained in:
Wenzheng Bi
2025-10-09 18:46:19 +08:00
committed by GitHub
parent 0426e3c5e1
commit ec10fd0abc
2 changed files with 8 additions and 7 deletions

View File

@@ -14,7 +14,6 @@ import vllm.envs as envs
from vllm.attention.backends.abstract import AttentionBackend
from vllm.attention.backends.registry import _Backend, backend_name_to_enum
from vllm.logger import init_logger
from vllm.platforms import current_platform
from vllm.utils import STR_BACKEND_ENV_VAR, resolve_obj_by_qualname
logger = init_logger(__name__)
@@ -192,6 +191,8 @@ def _cached_get_attn_backend(
)
# get device-specific attn_backend
from vllm.platforms import current_platform
attention_cls = current_platform.get_attn_backend_cls(
selected_backend,
head_size,