File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ class NPUPlatform(Platform):
5858 device_type : str = "npu"
5959 simple_compile_backend : str = "eager" # Disable torch.compile()
6060 ray_device_key : str = "NPU"
61- device_control_env_var : str = "ASCEND_RT_VISIBLE_DEVICES"
61+ # device_control_env_var: str = "ASCEND_RT_VISIBLE_DEVICES"
62+ device_control_env_var : str = ""
6263 dispatch_key : str = "PrivateUse1"
6364
6465 supported_quantization : list [str ] = [ASCEND_QUATIZATION_METHOD ]
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ def __init__(
7575 distributed_init_method = distributed_init_method ,
7676 is_driver_worker = is_driver_worker )
7777 # Try to import mindie_turbo to accelerate vLLM inference.
78+ local_dp_rank = self .vllm_config .parallel_config .data_parallel_rank_local
79+ world_size = self .vllm_config .parallel_config .world_size
80+ self .local_rank_across_dp = local_dp_rank * world_size + self .local_rank
7881 try_register_lib (
7982 "mindie_turbo" ,
8083 "MindIE Turbo is installed. vLLM inference will be accelerated with MindIE Turbo."
@@ -112,7 +115,7 @@ def wake_up(self, tags: Optional[list[str]] = None) -> None:
112115
113116 def init_device (self ):
114117 if self .device_config .device .type == "npu" :
115- self .device = torch .device (f"npu:{ self .local_rank } " )
118+ self .device = torch .device (f"npu:{ self .local_rank_across_dp } " )
116119 NPUPlatform .set_device (self .device )
117120 NPUPlatform .empty_cache ()
118121 self .init_npu_memory = NPUPlatform .mem_get_info ()[0 ]
You can’t perform that action at this time.
0 commit comments