Evaluation of various MLX quantizations #945
Replies: 15 comments 5 replies
|
I would appreciate it if someone with enough RAM could provide Qwen3.6-27B results, and I'd handle the chart part. AFAIK, MoE models are more sensitive to quantization than dense ones. |
|
It turns out that quantization of a sensitivity model itself is way more important than I thought, especially for producing oQ4 and below. Re-quantizing and re-uploading my Qwen3.6 collection, have updated the chart and data. It's not like something was dramatically wrong, but quick test shows that more precise affine Q8 forces oQ algorithm to make slightly different choice on some tensors in comparison to MXFP4 I used previously. All |
|
Dear diary, it's me again. Have switched to Aes Sedai's combined_all_micro.txt prompt dataset instead of a pure "prose", ran it with 16384 tokens context, and now KLD results seem to be of the same magnitude as Unsloth UD MLX Dynamic Quants (yes, they also provide MLX quants). So I might come up with the third scatterplot data layer. WIll continue digging, it's been an interesting journey. |
|
@deepsweet I followed the guide on your mlx-kld and here are the results I got
KLD benchmark for MLX oQ quant
KLD benchmark for MLX Q quant
ThoughtsI thought that dense model is less sensitive to quant than MoE model, but why we are seeing the opposite thing? The results for MoE is much more impressive. |
|
Hello everyone. I've just updated the comparison with MLX UD quantizations, so we have 4 layers now:
See detailed results. Everything has been measured against the most normal multimodal BF16 version. The KLD metric itself has been expanded to KLD mean, KLD p95 and KLD p99. @nmqanh thanks for the data! I'll try to visualize it and we'll see. Just a quick note: have you also added mlx_lm.convert \
--hf-path ~/.cache/huggingface/models/Qwen/Qwen3.6-27B \
--mlx-path /path/to/Qwen3.6-27B-MLX \
--dtype float16It's important to have everything as identical and comparable as possible. It's not that FP16 narrower dynamic range could possibly be a real issue here, but just in case. Also, could you please try it again with the most unexpected values in your opinion with the updated mlx-kld? And look at KLD p95 and KLD p99 specifically. UPD: just noticed that you've provided both BF16 and FP16 already. Make sure that you've also regenerated reference data: |
|
@nmqanh it feels a bit odd indeed, I'll try to squeeze some low quants into my M2 Max 64GB and double check everything. |
|
Other options to consider: mlx_lm.convert --help
…
--quant-predicate {mixed_2_6,mixed_3_4,mixed_3_5,mixed_3_6,mixed_3_8,mixed_4_6,mixed_4_8}
Mixed-bit quantization recipe. |
|
@deepsweet I tested a bit more and UD quant > oQ > Q . But the results does not match the quality on UD official MLX benchmark.
|
|
What actually matters more is the relative numbers across one test suite using the same data. I've used a single 16384-token prompt using Aes Sedai's combined_all_micro.txt, which looks challenging and would unlikely to ever match the absolute numbers of other KLD tests. People often use WikiText-2, but I find it rather lower-entropy and monotonous. See wikitext-2-raw-v1 test split.
It's all very debatable, and I'm open to re-running my tests against a different dataset. |
can you also test nvfp4 since mlx can run it (pls) |
|
❤️🔥
We are going to have extra So far, reference PPL mean: 5.906250 oQ5: KLD mean: 0.010254 Again, absolute values are not as interesting as the relative difference within one test suite using the same data. |
|
I've added Interesting observation that is actually pretty much aligned with "Why Maybe We're Measuring LLM Compression Wrong": Zero perplexity delta alone doesn't mean that a quantization is flawless. On the contrary: PPL only cares about a "true token" prediction, but not the rest of the probability distribution. So a quantized model might predict all the tokens with perfect accuracy, but the "whole picture" might be wrong. Thus, oQ6+ and Q5+ have zero perplexity delta, but their KLD still show us a slightly off-road path. I'm glad to see that nuance in my own practical results. @nmqanh I finally had time to try out 27B, and the results are pretty wild. I'll definitely dive into it deeper, but so far it feels like the dense model just really falls off on such a diverse prompt. |
|
I've come to a very interesting conclusion regarding the Qwen3.6-27B evaluation. It gets completely blown away by the very diverse and unpredictable combined_all_micro.txt prompt:
My intention is to keep this flaw exposed as is, because a true evaluation should not aim to please its target. One could try to get nicer and more community-aligned numbers by using wikitext-2-raw-v1 test split. |
|
👋
Carefuly picked 6 different dataset domains, processed 16384 tokens of each, calculated per-domain mean metrics, and then the overall mean of everything altogether… And I found it being fragile and not reliable at all the moment I provide a different random seed to re-shuffle domain dataset records. On the contrary, I like the combined_all_micro.txt more and more. Dense gemma-4-31B (not
Will add it to the results later.
|
|
Long time no see! Finished Qwen3.6-27B: And Qwen3.6-35B-A3B: New quantizations: And lots of methodology and metrics explanation, as well as detailed results. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
See detailed results for more information:
All reactions