[optimization] support 8bit optims from bistandbytes (#163)

* support 8bit optims from bnb.

* fix exist_ok

* use_8bit_bnb.

* fix.

* note in readme.
This commit is contained in:
Sayak Paul
2024-12-30 14:03:56 +05:30
committed by GitHub
parent e9fba4ab7f
commit 191ea8b0cc
4 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -39,6 +39,7 @@ def get_optimizer(
weight_decay=weight_decay,
)
# TODO: consider moving the validation logic to `args.py` when we have torchao.
if use_8bit and use_4bit:
raise ValueError("Cannot set both `use_8bit` and `use_4bit` to True.")
@@ -46,7 +47,6 @@ def get_optimizer(
try:
import torchao
torchao.__version__
except ImportError:
raise ImportError(
"To use optimizers from torchao, please install the torchao library: `USE_CPP=0 pip install torchao`."