mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
remove sdp_kernel hijack
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user