File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,9 @@ def npu_generate_uuid() -> str:
3939 match_chip_id = re .search (r"Chip ID[^\d]*(\d+)" , search_after_pid )
4040 chip_id = int (match_chip_id .group (1 ))
4141 return f"{ get_ip ()} -{ npu_id * chip_count + chip_id } "
42- ValueError ("The current process is not running on the npu device" )
43- except subprocess .CalledProcessError :
44- ValueError ("The current process is not running on the npu device" )
42+ raise ValueError ("The current process is not running on the npu device" )
43+ except subprocess .CalledProcessError as e :
44+ raise ValueError ("The current process is not running on the npu device" ) from e
4545
4646
4747class DeviceManager :
@@ -82,3 +82,5 @@ def backend(self) -> str:
8282 return "hccl"
8383 elif self .device_type == "cuda" :
8484 return "nccl"
85+ else :
86+ raise TypeError ("The current device type is not supported" )
You can’t perform that action at this time.
0 commit comments