News for hackers. Stuff that matters.
Re:Qwen3-Coder: Agentic coding in the world by gnulinux on Wednesday July 23, 2025 @01:45AM (#44656039)
Do 2bit quantizations really work? All the ones I've seen/tried were completely broken even when 4bit+ quantizations worked perfectly. Even if it works for these extremely large models, is it really much better than using something slightly smaller on 4 or 5 bit quant?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @01:52AM (#44656068)
Oh the Unsloth dynamic ones are not 2bit at all - it's a mixture of 2, 3, 4, 5, 6 and sometimes 8bit.

Important layers are in 8bit, 6bit. Less important ones are left in 2bit! I talk more about it here: https://docs.unsloth.ai/basics/unsloth-dynamic-2.0-ggufs

Re:Qwen3-Coder: Agentic coding in the world by blensor on Wednesday July 23, 2025 @03:52AM (#44656749)
Not an AI researcher here so this is probably common knowledge for people in this field, but I saw a video about the quantization recently and wondered exactly about that, if it's possible to compress a net by using more precision where it counts and less precision where it's not important. And also wondered how one would go about deciding which parts count and which don't

Great to know that this is already a thing and I assume model "compression" is going to be the next hot topic

Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @05:24AM (#44657238)
Yes you're exactly thinking correctly! We shouldn't quantize a model naively to 2bit or 4bit, but we should do it smartly!
Re:Qwen3-Coder: Agentic coding in the world by qxfys on Wednesday July 23, 2025 @10:25AM (#44659587)
How do you pick which one should be 2, which one should be 4, etc. Is this secret sauce? or, something open?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Thursday July 24, 2025 @06:42PM (#44677203)
Oh I wrote about it here: https://docs.unsloth.ai/basics/unsloth-dynamic-2.0-ggufs We might provide some scripts for them in the future!
Re:Qwen3-Coder: Agentic coding in the world by qxfys on Friday July 25, 2025 @03:55AM (#44680761)
Thanks! But, I can't find any details on how you "intelligently adjust quantization for every possible layer" from that page. I assume this is a secret?

I am wondering about the possibility that different use cases might require different "intelligent quantization", i.e., quantization for LLM for financial analysis might be different from LLM for code generation. I am currently doing a postdoc in this. Interested in doing research together?

Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Friday July 25, 2025 @07:39AM (#44682038)
Oh we haven't yet published about it yet! I talk about in bits and pieces - we might do a larger blog on it!

Yes different use cases will be different - oh interesting! Sorry I doubt I can be of much in our research - I'm mainly an engineering guy so less research focused!

Re:Qwen3-Coder: Agentic coding in the world by CMCDragonkai on Wednesday July 23, 2025 @02:02AM (#44656106)
How do you decide which layers are the important ones?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @02:34AM (#44656287)
I wrote approximately in the blog about it and linked some papers! I also wrote about it here - https://unsloth.ai/blog/dynamic-4bit - one has to inspect the activation and weight quantization errors!
Re:Qwen3-Coder: Agentic coding in the world by blensor on Wednesday July 23, 2025 @11:25AM (#44660281)
So you are basically looking at "fMRI" of the "brain" while it's doing a wide range of things and cutting out the things that stay dark the most?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @07:26PM (#44665136)
Oh that's a good analogy! Yes that sounds right!
Re:Qwen3-Coder: Agentic coding in the world by menaerus on Wednesday July 23, 2025 @04:50AM (#44657038)
> The key reason to use Unsloth quants is because of our deep involvement in fixing critical bugs across major models

sounds convincing, eh ... /s

On the less cynical note, approach does look interesting but I'd also like to understand how and why does it work, if it works at all.

Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @05:26AM (#44657249)
Oh we actually fixed bugs! We fixed a few bugs in Gemma - see https://news.ycombinator.com/item?id=39671146, a gradient accumulation bug see https://news.ycombinator.com/item?id=41859037, Phi bugs, Llama bugs and more! See https://unsloth.ai/blog/reintroducing for more details!
Re:Qwen3-Coder: Agentic coding in the world by menaerus on Wednesday July 23, 2025 @05:32AM (#44657286)
What does your approach with dynamics weights has to do with those bugs? All those bugs seem uncorrelated to the technique.
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @06:22AM (#44657554)
Oh apologies I got confused - it's because when we calculate our dynamic quants, we have to do it on the fixed model!

For example in Phi 3 for example, the end of sentence token was wrong - if we use this, then our quants would be calibrated incorrectly, since chatting with the model will use the actual correct token.

Another is Llama 4 - https://github.com/ggml-org/llama.cpp/pull/12889 in which I fixed a RoPE issue - if we didn't fix it first, then again the calibration process would be incorrect.

Re:Qwen3-Coder: Agentic coding in the world by menaerus on Wednesday July 23, 2025 @07:29AM (#44657975)
Ok, this then goes to say that your approach doesn't work without applying whatever fixes to the vanilla models. What I'm trying to understand is the approach itself. Why does it and how does it work?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @09:27AM (#44659023)
Re:Qwen3-Coder: Agentic coding in the world by PeterStuer on Wednesday July 23, 2025 @04:58AM (#44657079)
If you don't mind divulging, what resources and time did it take to dynamically quantize Qwen3-Coder?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @05:24AM (#44657228)
It takes a few hours to compute the imatrix on some calibration dataset since we use more than 1-3 million tokens of high quality data. Then we have to decide on which layers to quantize to higher bits or not, which takes more time. And the quantization creation also takes some hours. Uploading also takes some time as well! Overall 8 hours maybe minimum?
Re:Qwen3-Coder: Agentic coding in the world by jychang on Wednesday July 23, 2025 @06:47AM (#44657704)
What cluster do you have to do the quantizing? I'm guessing you're not using a single machine with a 3090 in your garage.
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @09:28AM (#44659028)
Oh definitely not! I use some spot cloud instances!
Re:Qwen3-Coder: Agentic coding in the world by sleight42 on Wednesday July 23, 2025 @05:02PM (#44664014)
But you can get one of these quantized models to run effectively on a 3090?

If so, I'd love detailed instructions.

The guide you posted earlier goes over my (and likely many others') head!

Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Wednesday July 23, 2025 @07:27PM (#44665143)
Oh yes definitely! Oh wait is the guide too long / wordy? This section https://docs.unsloth.ai/basics/qwen3-coder-how-to-run-locall... shows how to run it on a 3090
Re:Qwen3-Coder: Agentic coding in the world by sleight42 on Thursday July 24, 2025 @06:06PM (#44676889)
Kind of you to respond! Thanks!

I have pretty bad ADHD. And I've only run locally using kobold; dilettante at DIY AI.

So, yeah, I'm a bit lost in it.

Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Thursday July 24, 2025 @06:45PM (#44677223)
Oh sorry - for Kobold - I think it uses llama.cpp behind the hood? I think Kobold has some guides on using custom GGUFs
Re:Qwen3-Coder: Agentic coding in the world by tomdekan on Thursday July 24, 2025 @07:31AM (#44669472)
Thanks Daniel. Do you recommend any resources showing the differences between different quantizations?
Re:Qwen3-Coder: Agentic coding in the world by danielhanchen on Thursday July 24, 2025 @06:43PM (#44677213)
Oh our blog https://docs.unsloth.ai/basics/unsloth-dynamic-2.0-ggufs compares the accuracy differences for each different quantization method for Llama 4 Scout and also Gemma 3 27B - they should apply to other quants (like Qwen 3 Coder)