Add Mac OS support for Apple Silicon (#770)
* Made an install script and auto updates env for mac * GPU sensors and initial training working for MAC. Still WIP. * Switch dataloader to single threaded until I can work around some mac pickeling issues. * Get quantization working on mac * Fix mac exclusive imports so they don't break other builds. * Add mac instructions to the UI
This commit is contained in:
1 parent
bc47fd6755
commit
171535833a
25 files changed
+1072
-71
No files matched your search
@@ -7,6 +7,7 @@ import torch
|
||||
import torchaudio
|
||||
|
||||
from toolkit.prompt_utils import PromptEmbeds
|
||||
from torchao.quantization.quant_primitives import _DTYPE_TO_BIT_WIDTH
|
||||
|
||||
ImgExt = Literal['jpg', 'png', 'webp']
|
||||
|
||||
@@ -668,6 +669,12 @@ class ModelConfig:
|
||||
self.qtype = "float8"
|
||||
if self.layer_offloading and self.qtype_te == "qfloat8":
|
||||
self.qtype_te = "float8"
|
||||
|
||||
# Mac mps only works with torachao uint
|
||||
if torch.backends.mps.is_available() and self.qtype == "qfloat8":
|
||||
self.qtype = "int8"
|
||||
if torch.backends.mps.is_available() and self.qtype_te == "qfloat8":
|
||||
self.qtype_te = "int8"
|
||||
|
||||
# 0 is off and 1.0 is 100% of the layers
|
||||
self.layer_offloading_transformer_percent = kwargs.get("layer_offloading_transformer_percent", 1.0)
|
||||
|
||||
Reference in new issue
Block a user