From 618a1703ae6e7ba2b60522792bc5f36f800fd492 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 14 May 2023 12:28:37 -0400 Subject: [PATCH] update cudnn benchmark setting --- modules/devices.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/devices.py b/modules/devices.py index 59619d360..4adf74634 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -106,7 +106,8 @@ def set_cuda_params(): if torch.backends.cudnn.is_available(): try: torch.backends.cudnn.benchmark = True - torch.backends.cudnn.benchmark_limit = 0 if shared.opts.cudnn_benchmark else 1 + if shared.opts.cudnn_benchmark: + torch.backends.cudnn.benchmark_limit = 0 torch.backends.cudnn.allow_tf32 = shared.opts.cuda_allow_tf32 except: pass