remove sdp_kernel hijack

This commit is contained in:
Disty0
2025-09-17 20:15:00 +03:00
parent 2842f5e3aa
commit 6f969958ae
+1 -6
View File
@@ -3,7 +3,7 @@ from functools import wraps
from contextlib import nullcontext
import torch
import numpy as np
from modules import devices, errors
from modules import devices
torch_version = torch.__version__[:4]
@@ -17,10 +17,6 @@ device_supports_fp64 = torch.xpu.has_fp64_dtype() if hasattr(torch.xpu, "has_fp6
# pylint: disable=protected-access, missing-function-docstring, line-too-long, unnecessary-lambda, no-else-return
def return_null_context(*args, **kwargs): # pylint: disable=unused-argument
return nullcontext()
@property
def is_cuda(self):
return self.device.type == "xpu" or self.device.type == "cuda"
@@ -351,7 +347,6 @@ def ipex_hijacks():
torch.Generator = torch_Generator
torch._C.Generator = torch_Generator
torch.backends.cuda.sdp_kernel = return_null_context
torch.UntypedStorage.is_cuda = is_cuda
torch.amp.autocast_mode.autocast.__init__ = autocast_init