Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic 4bit quant for merged adapter models #1449

Open
Nazzaroth2 opened this issue Dec 19, 2024 · 2 comments
Open

Dynamic 4bit quant for merged adapter models #1449

Nazzaroth2 opened this issue Dec 19, 2024 · 2 comments
Labels
feature request Feature request pending on roadmap

Comments

@Nazzaroth2
Copy link

I trained an adapter for unsloth/Qwen2-VL-2B-Instruct-unsloth-bnb-4bit with high rank (1024) for continued pretraining on japanese language with a lot but noisy data. I then merged and pushed the model to hf with push_to_hub_merged and save_method merged_16bit.

I wanted to then train on a second but more high quality dataset, but it turns out the merged model has lost the dynamic quant property. When simply loading this in 4bit and training the results are again terrible just as the other vision models beforehand. When training this merged model in 16bit the quality is kept and the performance is better than a model without continued pretraining.

My question now is, is there a script I missed so we can dyna-quant our own merged models ourselves? Or should we use save_method merged_4bit when merging?
If the answer is the latter, maybe add a user warning to recommend this saving method when using vision models in 4bit mode.

@Nazzaroth2
Copy link
Author

alright i did a second test also with merging_4bit option and merging_4bit_forced in save_method parameter. Both of them printed out in the console that the model is getting merged as 16bit and both options have the same accuracy loss when trying to load in 4bit.
So we definitly need a dynamic quant script or a new merging method for vlm's

@shimmyshimmer shimmyshimmer added the feature request Feature request pending on roadmap label Dec 23, 2024
@shimmyshimmer
Copy link
Collaborator

Ah yes I get what you mean - we'll need to release the text based models first before the dynamic 4bit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request pending on roadmap
Projects
None yet
Development

No branches or pull requests

2 participants