3131from torch_npu .npu .streams import Event
3232from vllm .logger import logger
3333
34- import vllm_ascend .envs as envs
34+ import vllm_ascend .envs as envs_ascend
3535from vllm_ascend .ascend_config import get_ascend_config
3636
3737if TYPE_CHECKING :
@@ -232,7 +232,7 @@ def find_hccl_library() -> str:
232232 After importing `torch`, `libhccl.so` can be
233233 found by `ctypes` automatically.
234234 """
235- so_file = envs .HCCL_SO_PATH
235+ so_file = envs_ascend .HCCL_SO_PATH
236236
237237 # manually load the hccl library
238238 if so_file :
@@ -273,8 +273,8 @@ def adapt_patch(is_global_patch: bool = False):
273273
274274@functools .cache
275275def vllm_version_is (target_vllm_version : str ):
276- if envs .VLLM_VERSION is not None :
277- vllm_version = envs .VLLM_VERSION
276+ if envs_ascend .VLLM_VERSION is not None :
277+ vllm_version = envs_ascend .VLLM_VERSION
278278 else :
279279 import vllm
280280 vllm_version = vllm .__version__
@@ -385,7 +385,7 @@ def destroy(self):
385385
386386 @contextmanager
387387 def capture_async (self , duration_tag : str ):
388- if not envs .VLLM_ASCEND_MODEL_EXECUTE_TIME_OBSERVE :
388+ if not envs_ascend .VLLM_ASCEND_MODEL_EXECUTE_TIME_OBSERVE :
389389 yield
390390 return
391391
@@ -403,7 +403,7 @@ def capture_async(self, duration_tag: str):
403403 def pop_captured_sync (self ) -> dict :
404404 """Pop and synchronize all events in the observation list"""
405405 durations : dict [str , float ] = {}
406- if not envs .VLLM_ASCEND_MODEL_EXECUTE_TIME_OBSERVE :
406+ if not envs_ascend .VLLM_ASCEND_MODEL_EXECUTE_TIME_OBSERVE :
407407 return durations
408408
409409 while self ._observations :
@@ -437,7 +437,7 @@ def get_rm_router_logits_state(ep_size: int, dp_size: int,
437437 # the fusion operator torch_npu.npu_grouped_matmul_finalize_routing called by allgather ep
438438 # only supports deepseek v3/r1
439439 if dp_size > 1 :
440- if (envs .VLLM_ENABLE_FUSED_EXPERTS_ALLGATHER_EP and ep_size > 1
440+ if (envs_ascend .VLLM_ENABLE_FUSED_EXPERTS_ALLGATHER_EP and ep_size > 1
441441 and is_deepseek_v3_r1 ):
442442 return True
443443 elif ep_size == 1 and is_deepseek_v3_r1 :
@@ -451,7 +451,7 @@ def get_rm_router_logits_state(ep_size: int, dp_size: int,
451451def get_all_reduce_merge_state (ep_size : int , is_deepseek_v3_r1 : bool ):
452452 # the fusion operator torch_npu.npu_grouped_matmul_finalize_routing called by allgather ep
453453 # only supports deepseek v3/r1
454- if (envs .VLLM_ENABLE_FUSED_EXPERTS_ALLGATHER_EP and ep_size > 1
454+ if (envs_ascend .VLLM_ENABLE_FUSED_EXPERTS_ALLGATHER_EP and ep_size > 1
455455 and is_deepseek_v3_r1 ):
456456 return True
457457 elif ep_size == 1 and is_deepseek_v3_r1 :
0 commit comments