Can 1-bit quantized model be finetuned using SFT using LoRA or without it #63
-
During using SFTTrainer on 1 bit quantized model with peft config I got ValueError: Target module HQQLinearLoRA(
(linear_layer): HQQLinear()
(peft_drop): Identity()
) is not supported. Currently, only the following modules are supported: `torch.nn.Linear`, `torch.nn.Embedding`, `torch.nn.Conv2d`, `transformers.pytorch_utils.Conv1D`. PEFT config is: peft_config = LoraConfig(
r=64,
lora_alpha=16,
lora_dropout=0.1,
bias="none",
task_type="CASUAL_LM",
target_modules=["q_proj", "k_proj", "v_proj", "o_proj"]
) trainer is initialized as: trainer = SFTTrainer(
model=model,
tokenizer=tokenizer,
args=training_args,
packing=True,
train_dataset=dataset["train"],
eval_dataset=dataset["test"],
dataset_text_field="text",
peft_config=peft_config, #peft config
max_seq_length=tokenizer.model_max_length
) Note: When i removed peft config, finetuning is give me error when training. ValueError: Attempting to unscale FP16 gradients. |
Beta Was this translation helpful? Give feedback.
Answered by
mobicham
Apr 24, 2024
Replies: 1 comment 5 replies
-
Hi @sanjeev-bhandari , that's an issue of the peft library not hqq. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
mobicham
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @sanjeev-bhandari , that's an issue of the peft library not hqq.
We have our own way of doing LoRA: https://github.com/mobiusml/hqq/?tab=readme-ov-file#peft-training