mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
remove MacOS Sonoma check in devices.py (#5312)
* remove MacOS Sonoma check in devices.py As of pytorch 2.1.0, float16 works with our MPS fixes on Sonoma, so the check is no longer needed. * remove unused platform import
This commit is contained in:
parent
64858b2523
commit
2d11d97dad
@ -1,11 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import platform
|
||||
from contextlib import nullcontext
|
||||
from typing import Union
|
||||
|
||||
import torch
|
||||
from packaging import version
|
||||
from torch import autocast
|
||||
|
||||
from invokeai.app.services.config import InvokeAIAppConfig
|
||||
@ -37,7 +35,7 @@ def choose_precision(device: torch.device) -> str:
|
||||
device_name = torch.cuda.get_device_name(device)
|
||||
if not ("GeForce GTX 1660" in device_name or "GeForce GTX 1650" in device_name):
|
||||
return "float16"
|
||||
elif device.type == "mps" and version.parse(platform.mac_ver()[0]) < version.parse("14.0.0"):
|
||||
elif device.type == "mps":
|
||||
return "float16"
|
||||
return "float32"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user