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
Hi I am finetuning the qwen model using the grpo notebook. I tried merging the model with save_pretrained and loading it using this
from unsloth import FastLanguageModel, PatchFastRL
PatchFastRL("GRPO", FastLanguageModel)
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "model",
max_seq_length = 200,
load_in_4bit = False, # False for LoRA 16bit
fast_inference = True, # Enable vLLM fast inference
gpu_memory_utilization = 0.9, # Reduce if out of memory
)
Resetting the model to original performance on the strawberry question.
Any pointer on how to merge lora adapter? I also want to hook the models for activation later.
yeah seems those issues are all related. I can confirm got not only the issue i described in #1877, but also this one with 16 bit adapter merging. I could not find the thing in our configuration causing that .
Best Practice is save to 16bits (which is the default operation if you do not specify anything), and load in 4 bits if you have to.
For production systems, you might wanna consider post training quantization methods with calibration. These take longer but can also be more reliable.
Saving and merging to 4bits might degrade performance of the model.
To access this recent fix, and if you're running this in a local python environment, please make sure to upgrade your python environment using
Activity
FloLey commentedon Mar 7, 2025
#1670
#1763
#1877
I think all this issues are the same.
Cgrandjean commentedon Mar 7, 2025
yeah seems those issues are all related. I can confirm got not only the issue i described in #1877, but also this one with 16 bit adapter merging. I could not find the thing in our configuration causing that .
shimmyshimmer commentedon Mar 18, 2025
Hi guys we have likely resolved the issue. Please update unsloth and let us know if it works! Thank you
zzz1YAO commentedon Mar 20, 2025
I have a same question
rolandtannous commentedon Jun 6, 2025
@BY571 @FloLey @Joinn99 @K1nght @Mtrya @SpaceHunterInf @Xiaohan-Tian @Yangt524 @canrertugrul @fullstackwebdev @janpf @juli2807 @kjm981995 @liuchengyuan123 @lucky-bai @maopian2333 @matthewchung74 @mingqing431 @mominabbass @saadi297 @vasqu @whiskyboy @wofeishenling @wooozihui @yuimo @yuiseki
A fix has now been merged into pypi for both vision and language models and extensively tested.
reference:
unslothai/unsloth-zoo#135
unslothai/unsloth-zoo#158
#2673
Merging and saving should work now.
Best Practice is save to 16bits (which is the default operation if you do not specify anything), and load in 4 bits if you have to.
For production systems, you might wanna consider post training quantization methods with calibration. These take longer but can also be more reliable.
Saving and merging to 4bits might degrade performance of the model.
To access this recent fix, and if you're running this in a local python environment, please make sure to upgrade your python environment using
If you're in colab, the notebooks install cell will also be updated shortly but should be something like
as we're no longer pinning transformers or trl.
Also note that whenever you need to merge while saving or while pushing to hub, make sure to use
and
If you are not merging at all, use
and
instead.
I'll close this for now. Feel free to comment if you face any problems.
Happy finetuning.