zluda remove dnn

This commit is contained in:
Seunghoon Lee
2024-05-18 12:50:32 +09:00
parent 1cc373fd89
commit cdc694c7f9
4 changed files with 2 additions and 24 deletions
-5
View File
@@ -500,11 +500,6 @@ def check_torch():
try:
if args.reinstall_zluda:
zluda_installer.uninstall()
if args.use_zluda_dnn:
if zluda_installer.check_dnn_dependency():
zluda_installer.enable_dnn()
else:
log.warning("Couldn't find the required dependency of ZLUDA DNN.")
zluda_path = zluda_installer.get_path()
zluda_installer.install(zluda_path)
zluda_installer.make_copy(zluda_path)
-1
View File
@@ -41,7 +41,6 @@ group.add_argument("--disable-queue", default=os.environ.get("SD_DISABLEQUEUE",
group.add_argument('--debug', default=os.environ.get("SD_DEBUG", False), action='store_true', help = "Run installer with debug logging, default: %(default)s")
group.add_argument('--use-directml', default=os.environ.get("SD_USEDIRECTML", False), action='store_true', help = "Use DirectML if no compatible GPU is detected, default: %(default)s")
group.add_argument('--use-zluda', default=os.environ.get("SD_USEZLUDA", False), action='store_true', help = "Force use ZLUDA, AMD GPUs only, default: %(default)s")
group.add_argument('--use-zluda-dnn', default=os.environ.get("SD_USEZLUDADNN", False), action='store_true', help = "Enable ZLUDA DNN (experimental), requires --use-zluda, AMD GPUs only, Windows only, default: %(default)s")
group.add_argument("--use-openvino", default=os.environ.get("SD_USEOPENVINO", False), action='store_true', help="Use Intel OpenVINO backend, default: %(default)s")
group.add_argument("--use-ipex", default=os.environ.get("SD_USEIPX", False), action='store_true', help="Force use Intel OneAPI XPU backend, default: %(default)s")
group.add_argument("--use-cuda", default=os.environ.get("SD_USECUDA", False), action='store_true', help="Force use nVidia CUDA backend, default: %(default)s")
+2 -2
View File
@@ -27,7 +27,7 @@ def test(device: DeviceLikeType) -> Union[Exception, None]:
def initialize_zluda():
device = devices.get_optimal_device()
if platform.system() == "Windows" and devices.cuda_ok and is_zluda(device):
torch.backends.cudnn.enabled = shared.cmd_opts.use_zluda_dnn
torch.backends.cudnn.enabled = False
torch.backends.cuda.enable_flash_sdp(False)
torch.backends.cuda.enable_flash_sdp = do_nothing
torch.backends.cuda.enable_math_sdp(True)
@@ -35,7 +35,7 @@ def initialize_zluda():
torch.backends.cuda.enable_mem_efficient_sdp(False)
torch.backends.cuda.enable_mem_efficient_sdp = do_nothing
if hasattr(torch.backends.cuda, "enable_cudnn_sdp"):
torch.backends.cuda.enable_cudnn_sdp(shared.cmd_opts.use_zluda_dnn and shared.cmd_opts.experimental)
torch.backends.cuda.enable_cudnn_sdp(False)
torch.backends.cuda.enable_cudnn_sdp = do_nothing
shared.opts.sdp_options = ['Math attention']
devices.device_codeformer = devices.cpu
-16
View File
@@ -30,22 +30,6 @@ def find_hip_sdk() -> Union[str, None]:
return os.environ.get('HIP_PATH', hip_path_default)
def check_dnn_dependency() -> bool:
if os.environ.get("ZLUDA", None) is None:
return False
hip_path = os.environ.get("HIP_PATH", None)
if hip_path is None: # unable to check
return True
if os.path.exists(os.path.join(hip_path, 'bin', 'MIOpen.dll')):
return True
return False
def enable_dnn() -> None:
DLL_MAPPING['cudnn.dll'] = 'cudnn64_8.dll'
HIP_TARGETS.append('MIOpen.dll')
def install(zluda_path: os.PathLike) -> None:
if os.path.exists(zluda_path):
return