Add fsdp+qlora support (#160)

This commit is contained in:
Chansung Park
2024-05-08 15:08:13 +02:00
committed by GitHub
parent 84f8c92820
commit 606d2e954f
5 changed files with 35 additions and 2 deletions
+3
View File
@@ -185,6 +185,9 @@ class ModelArguments:
default="nf4", metadata={"help": "precise the quantization type (fp4 or nf4)"}
)
use_bnb_nested_quant: bool = field(default=False, metadata={"help": "use nested quantization"})
bnb_4bit_quant_storage: Optional[str] = field(
default="uint8", metadata={"help": "storage type to pack the quanitzed 4-bit prarams."}
)
def __post_init__(self):
if self.load_in_8bit and self.load_in_4bit:
+1
View File
@@ -51,6 +51,7 @@ def get_quantization_config(model_args: ModelArguments) -> BitsAndBytesConfig |
bnb_4bit_compute_dtype=compute_dtype,
bnb_4bit_quant_type=model_args.bnb_4bit_quant_type,
bnb_4bit_use_double_quant=model_args.use_bnb_nested_quant,
bnb_4bit_quant_storage=model_args.bnb_4bit_quant_storage,
)
elif model_args.load_in_8bit:
quantization_config = BitsAndBytesConfig(