|
1 | 1 | import os |
2 | 2 |
|
3 | | -from triton.backends.compiler import GPUTarget |
4 | | -from triton.backends.driver import DriverBase |
5 | 3 | from triton._utils import parse_list_string |
6 | | -from triton.backends.intel.driver import compile_module_from_src, COMPILATION_HELPER, XPUUtils, ty_to_cpp, serialize_args |
7 | | - |
8 | | -import torch |
| 4 | +from triton.backends.intel.driver import compile_module_from_src, COMPILATION_HELPER, ty_to_cpp, serialize_args |
9 | 5 |
|
10 | 6 | # ------------------------ |
11 | 7 | # Utils |
@@ -310,33 +306,3 @@ def __call__(self, *args, **kwargs): |
310 | 306 | if serialize_kernel_args: |
311 | 307 | serialize_args(args, self.constants, self.signature) |
312 | 308 | self.launch(*args, **kwargs) |
313 | | - |
314 | | - |
315 | | -class XPUDriver(DriverBase): |
316 | | - |
317 | | - def __init__(self): |
318 | | - self.launcher_cls = XPULauncher |
319 | | - |
320 | | - def __getattr__(self, name): |
321 | | - # Lazily initialize utils to avoid unnecessary XPU runtime invocations. |
322 | | - # See https://github.com/intel/intel-xpu-backend-for-triton/issues/624 |
323 | | - if name == "utils": |
324 | | - self.utils = XPUUtils() # pylint: disable=attribute-defined-outside-init |
325 | | - return self.utils |
326 | | - raise AttributeError |
327 | | - |
328 | | - def get_current_device(self): |
329 | | - return self.utils.get_current_device() |
330 | | - |
331 | | - def get_current_stream(self, device): # pylint: disable=unused-argument |
332 | | - return torch.xpu.current_stream().sycl_queue |
333 | | - |
334 | | - def get_current_target(self): |
335 | | - device = self.get_current_device() |
336 | | - dev_property = torch.xpu.get_device_capability(device) |
337 | | - warp_size = 32 |
338 | | - return GPUTarget("xpu", dev_property, warp_size) |
339 | | - |
340 | | - @staticmethod |
341 | | - def is_active(): |
342 | | - return torch.xpu.is_available() |
0 commit comments