From ac72f7bb154e5f664cc5aecb0819b89d45373db3 Mon Sep 17 00:00:00 2001 From: MrZ20 <2609716663@qq.com> Date: Mon, 19 Jan 2026 09:38:06 +0800 Subject: [PATCH] fix Signed-off-by: MrZ20 <2609716663@qq.com> --- vllm_ascend/platform.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vllm_ascend/platform.py b/vllm_ascend/platform.py index 5d5dcfca08d..4e2a35c9d6f 100644 --- a/vllm_ascend/platform.py +++ b/vllm_ascend/platform.py @@ -395,14 +395,15 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None: # For example: "page_size:1g" + ",expandable_segments:True". # NOTE: `max_split_size_mb` or `garbage_collection_threshold` cannot # be enabled together with `expandable_segments=True`. - if "expandable_segments" not in npu_alloc_configs and \ - "max_split_size_mb" not in npu_alloc_configs and \ - "garbage_collection_threshold" not in npu_alloc_configs: + if ( + "expandable_segments" not in npu_alloc_configs + and "max_split_size_mb" not in npu_alloc_configs + and "garbage_collection_threshold" not in npu_alloc_configs + ): npu_alloc_configs += ",expandable_segments:True" os.environ["PYTORCH_NPU_ALLOC_CONF"] = npu_alloc_configs logger.info("Set PYTORCH_NPU_ALLOC_CONF=%s", npu_alloc_configs) - @classmethod def import_kernels(cls) -> None: # Directly importing vllm_ascend_C prevents ASCEND_RT_VISIBLE_DEVICES