Skip to content

Commit ca4e857

Browse files
authored
Fix launching Triton kernels in distributed scenario (#3939)
Just applying the patch: #3641 (comment) seems to be enough. I don't notice any slowdown. Signed-off-by: Anatoly Myachev <[email protected]>
1 parent f1e9808 commit ca4e857

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

third_party/intel/backend/driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ def __init__(self):
308308
self.get_device_properties = self.mod.get_device_properties
309309
self.context = self.mod.init_context(self.get_sycl_queue())
310310
self.device_count = self.mod.init_devices(self.get_sycl_queue())
311-
self.current_device = 0 if self.device_count[0] > 0 else -1
312311
self.wait_on_sycl_queue = self.mod.wait_on_sycl_queue
313312

314313
def get_current_device(self):
315-
return self.current_device
314+
import torch
315+
return torch.xpu.current_device()
316316

317317
def get_sycl_queue(self):
318318
import torch

0 commit comments

Comments
 (0)