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
Sorry if this seems silly but when unsloth patches qwen2.5 model, it outputs
"Unsloth 2024.10.7 patched 28 layers with 0 QKV layers, 28 O layers and 28 MLP layers."
Why does the QKV layers not get patched?
In the case of llama-3.2
"Unsloth 2024.10.7 patched 16 layers with 16 QKV layers, 16 O layers and 16 MLP layers."
The QKV layers do get patched.
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
model = FastLanguageModel.get_peft_model(
model,
r = 128, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",],
lora_alpha = 32,
lora_dropout = 0, # Supports any, but = 0 is optimized
bias = "none", # Supports any, but = "none" is optimized
# [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
random_state = 3407,
use_rslora = True, # We support rank stabilized LoRA
loftq_config = None, # And LoftQ
)
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/Llama-3.2-1B-Instruct-bnb-4bit",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
model = FastLanguageModel.get_peft_model(
model,
r = 128, # Choose any number > 0 ! Suggested 8, 16, 32, 64, 128
target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",],
lora_alpha = 32,
lora_dropout = 0, # Supports any, but = 0 is optimized
bias = "none", # Supports any, but = "none" is optimized
# [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
random_state = 3407,
use_rslora = True, # We support rank stabilized LoRA
loftq_config = None, # And LoftQ
)
Activity
danielhanchen commentedon Sep 21, 2024
I'm uploading Qwen 2.5 models to Unsloth - there was also some tokenizer changes, so I'll have to reupload all the tokenizers
Excidos commentedon Sep 22, 2024
Can't wait for this, currently using Swift with success but Unsloth support will be amazing :)
danielhanchen commentedon Oct 1, 2024
Oh apologies @Excidos @milsun Forgot to tell you both it works now!!
I also made some Qwen 2.5 notebooks as well
Excidos commentedon Oct 1, 2024
Yes thank you I've already used it extensively and adapted it. Got Linux going with my 4090. Blown away by the speed of it. Thank you so much
milsun commentedon Oct 1, 2024
great, thanks!
DifferentialityDevelopment commentedon Nov 3, 2024
Sorry if this seems silly but when unsloth patches qwen2.5 model, it outputs
"Unsloth 2024.10.7 patched 28 layers with 0 QKV layers, 28 O layers and 28 MLP layers."
Why does the QKV layers not get patched?
In the case of llama-3.2
"Unsloth 2024.10.7 patched 16 layers with 16 QKV layers, 16 O layers and 16 MLP layers."
The QKV layers do get patched.
MinghaoYan commentedon Nov 8, 2024
I am running into the same issue of QKV not getting patched. Any updates on this? Is this due to the bias term in Qwen QKV matrices?
danielhanchen commentedon Nov 11, 2024
@DifferentialityDevelopment @MinghaoYan Just a warning - no need to worry - I'll silence them in the near future once all model comes out