Skip to content

Commit

Permalink
add comment for AUTOMATIC1111#4407 and remove seemingly unnecessary c…
Browse files Browse the repository at this point in the history
…udnn.enabled
  • Loading branch information
AUTOMATIC1111 committed Dec 3, 2022
1 parent 2651267 commit 46b0d23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ def torch_gc():

def enable_tf32():
if torch.cuda.is_available():

# enabling benchmark option seems to enable a range of cards to do fp16 when they otherwise can't
# see https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4407
if any([torch.cuda.get_device_capability(devid) == (7, 5) for devid in range(0, torch.cuda.device_count())]):
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.enabled = True

torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True
Expand Down

0 comments on commit 46b0d23

Please sign in to comment.