diff --git a/modules/devices.py b/modules/devices.py index c35c8b909..0c5fb1552 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -395,10 +395,10 @@ def set_cudnn_params(): torch.use_deterministic_algorithms(opts.cudnn_deterministic) if opts.cudnn_deterministic: os.environ.setdefault('CUBLAS_WORKSPACE_CONFIG', ':4096:8') - torch.backends.cudnn.benchmark = True + torch.backends.cudnn.benchmark = opts.cudnn_benchmark if opts.cudnn_benchmark: log.debug('Torch cuDNN: enable benchmark') - torch.backends.cudnn.benchmark_limit = 0 + torch.backends.cudnn.benchmark_limit = opts.cudnn_benchmark_limit torch.backends.cudnn.allow_tf32 = True except Exception as e: log.warning(f'Torch cudnn: {e}') diff --git a/modules/shared.py b/modules/shared.py index 884ca3154..b1faa53ba 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -482,9 +482,10 @@ options_templates.update(options_section(('backends', "Backend Settings"), { "other_sep": OptionInfo("