You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
QLora broken - bnb.py resolve_variant should accept QALoRA params for compatibility with LoraLayer #2671
However, resolve_variant in bnb.py does not accept use_qalora and qalora_group_size, causing a break.
Expected behavior
The resolve_variant function in bnb.py should accept use_qalora and qalora_group_size as arguments for compatibility with LoraLayer, but safely ignore them internally if not needed, preventing errors when called via a LoraLayer interface.
I think this is because you're using an outdated from source PEFT install before #2618 was merged, is that possible? At least on the latest PEFT, I can't reproduce the error. This is what I used:
importtorchfromtransformersimportAutoModelForCausalLM, BitsAndBytesConfigfrompeftimportLoraConfig, prepare_model_for_kbit_training, get_peft_modelbnb_config=BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
# Load model with 4-bit quantizationmodel=AutoModelForCausalLM.from_pretrained(
"facebook/opt-125m",
quantization_config=bnb_config,
device_map="auto",
torch_dtype=torch.bfloat16,
)
# Prepare model for k-bit training (essential for QLoRA)model=prepare_model_for_kbit_training(model, use_gradient_checkpointing=True)
# Configure LoRA for QLoRAlora_config=LoraConfig()
model=get_peft_model(model, lora_config)
Activity
BenjaminBossan commentedon Jul 25, 2025
I think this is because you're using an outdated from source PEFT install before #2618 was merged, is that possible? At least on the latest PEFT, I can't reproduce the error. This is what I used:
gapsong commentedon Jul 25, 2025
Ohhh true. Sorry for wasting your time. Yes that fixed the problem.
BenjaminBossan commentedon Jul 25, 2025
No problem, it happens :)