已合并
[sync] PR-40339: modify _dynamo_device.py for benchmarks multi process set device error #40448
[sync] PR-40339: modify _dynamo_device.py for benchmarks multi process set device error #40448
已合并
ascend-robot创建于 7月8日
1 个文件变更+2-1
@@ -72,7 +72,8 @@ class NpuInterface(DeviceInterface):
72 @staticmethod72 @staticmethod
73 def exchange_device(device: int) -> int:73 def exchange_device(device: int) -> int:
74 curr_device = current_device()74 curr_device = current_device()
75- set_device(device)75+ if curr_device != device:
76+ set_device(device)
76 return curr_device77 return curr_device
77 78 
78 @staticmethod79 @staticmethod