File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,15 @@ def get_accelerator():
140
140
try :
141
141
import torch
142
142
143
- # torch.xpu supported in upstream pytorch.
143
+ # torch.xpu will be supported in upstream pytorch-2.8 .
144
144
# Currently we can run on xpu device only using pytorch,
145
145
# also reserve the old path using ipex when the torch version is old.
146
146
if hasattr (torch , 'xpu' ):
147
- if torch .cuda .device_count () == 0 and torch .xpu .device_count () > 0 and torch .xpu .is_available ():
148
- accelerator_name = "xpu"
149
- else :
150
- pass
147
+ if torch .cuda .device_count () == 0 : #ignore-cuda
148
+ if torch .xpu .device_count () > 0 and torch .xpu .is_available ():
149
+ accelerator_name = "xpu"
150
+ else :
151
+ pass
151
152
except ImportError as e :
152
153
pass
153
154
if accelerator_name is None :
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ def is_synchronized_device(self):
39
39
return False
40
40
41
41
def use_host_timers (self ):
42
- # WA XPU event will be consolidated in 2.6
43
42
if not ipex_imported_p :
44
43
return self .is_synchronized_device ()
45
44
else :
You can’t perform that action at this time.
0 commit comments