r/oMLX • • 4h ago

Qwen4-35B-A3B: KL divergence for various oQ quants

Post image
25 Upvotes

I wanted to know how much accuracy each Qwen4-35B-A3B quant gives up compared with full-precision BF16, so I measured KL divergence against the BF16 model. Everything ran on an M5 Max with 64 GB under oMLX 0.8.5. The models are the mlx-community oQ builds plus Qwen's official FP8 release. Surprisingly, the oQ6e quant beats the official FP8 release.

If you have 64+ gigs of unified memory, I recommend the oQ6e quant. You lose a lot with the oQ4e quant. This confirms my anecdotal experience with various simple coding tests.

(details of how I generated this was written by Claude; I include that for people who want to know about the method)

ModelSize (GB)Mean KLD± s.e.p99 KLDSame top token as BF16PPL
oQ3e-mtp29.50.12180.00171.31786.2%6.747
oQ4e-mtp33.80.05170.00070.57890.9%6.688
oQ5e-mtp40.40.03000.00040.30793.0%6.670
oQ6e-mtp47.10.02360.00040.24294.0%6.659
FP8 official, exact weights58.40.02510.00040.25793.6%6.654
FP8 official, as oMLX loads it58.40.02940.00050.31493.2%6.650
oQ8e-mtp60.20.02110.00030.23094.3%6.655
BF16 (reference)-----6.652
  • Text model on disk, including the n-gram table (12.8 GB in oQ3e/oQ4e, 15.4 GB in oQ5e, 17.9 GB in oQ6e, about 20.5 GB in FP8) but not the vision encoder or MTP head.

Takeaways

  • oQ6e is the closest to BF16 of anything I tested, closer even than Qwen's own FP8 release, and it's 11 GB smaller. FP8 uses one scale for each 128×128 block of weights. oQ uses a scale for every 64 weights, gives more bits to the sensitive layers, and calibrates with an importance matrix.
  • oQ5e is about as close as FP8 in oMLX, at 18 GB less.
  • Each step down from oQ5e roughly doubles the drift. oQ5e → oQ4e is 1.7× and oQ4e → oQ3e is 2.4×. At oQ3e, about 1 token in 7 differs from BF16's first choice, and the worst 1% of tokens change a lot (p99 KLD > 1).
  • oQ3e saves less memory than "3-bit" suggests. The backbone averages 3.8 bits per weight, but the 12.8 GB n-gram table stays at 4 bits or more, so the whole checkpoint averages 4.3. If memory is the problem, the SSD N-gram Offload setting takes that table out of RAM, which may help more than dropping a quant level.
  • When oMLX loads the FP8 checkpoint, it converts the weights to MXFP8. That adds a bit of drift (KLD 0.025 → 0.029) and wastes a little of FP8's advantage. The FP8 checkpoint does load and run fine in oMLX, though.
  • Perplexity barely tells them apart. Every quant is within about 1.4% of BF16, and FP8-oMLX actually scores a hair below BF16, which is noise. KLD is the better measure for comparing quants.

Method

  • Text: WikiText-2 (raw) test set, 32 chunks of 2048 tokens. Only the second half of each chunk is scored, as in llama.cpp's KLD, for 32,736 scored tokens. KLD is computed over the full 248k vocabulary.
  • BF16 reference: the BF16 backbone (~70 GB) doesn't fit in 64 GB, so I ran it one decoder layer at a time. Each layer was loaded from disk, every chunk was pushed through it, and then the next layer was loaded. This used oQ's own streamed-layer loader, the one it uses to calibrate models bigger than RAM. Peak memory was about 7 GB and the whole pass took about 40 s.
  • Checking the method: on oQ6e, the layer-by-layer path matched a normal full forward exactly (KLD 0). Skipping a single layer gave KLD 0.22, so the check does catch mistakes.
  • "FP8 exact" decodes the FP8 weights with the same layer-by-layer loader. "FP8 as oMLX loads it" is the normal mlx-vlm load path, i.e. what you get when you serve the checkpoint.
  • Quants were loaded the way oMLX's VLM engine loads them, with SSD n-gram offload on, and run as plain forward passes. MTP isn't involved, since it only affects speed.

Caveats

  • This is one dataset of English prose. Code, other languages, chat formatting, and long-context behavior could rank differently. With 2048-token chunks, the sparse attention's 2048-token selection budget never kicks in, so long context isn't tested at all.
  • The ± values are standard errors over tokens. They show the differences are stable on this text, not that they hold everywhere.
  • These numbers aren't directly comparable to Unsloth's GGUF KLD charts, which use different evaluation sets, a different reference run, and llama.cpp.

(I updated the graph to include oQ8e, but I can't figure out how to delete the first version of the figure...)


r/oMLX • • 5h ago

Qwen4-35B-A3B Uncensored MLX

Thumbnail
huggingface.co
30 Upvotes

more MLX quants: 3-bit (27 GB) / 6-bit (46.7 GB)

happy testing! would love to hear how it runs on your setup


r/oMLX • • 5h ago

Selecting the Engram Table?

5 Upvotes

I came across this post and it really opened my eyes to how much harm quanting the engram table can have on the results: https://www.reddit.com/r/LocalLLM/comments/1ydjcaf/qwen_4_35b_a3b_vs_qwen_38_flash_next/

In oMLX is it possible to select the engram table like someone can do in Unsloth?


r/oMLX • • 18h ago

Qwen4 speeds dropping to 12 tok/s on memory-constrained Mac (and the fix)

Post image
28 Upvotes

Qwen4 runs at 70 tokens/s on a 32 GB MacBook. Mine was stuck at 12.

I've been testing the new Qwen4-35B-A3B (4-bit) locally on an M2 Max. Short prompts were fine, but past about 1,000 prompt tokens generation dropped to 12 tokens/s and stayed there.

The model was not the problem. The runtime asks macOS to keep all GPU memory wired, and a 23 GB model does not fit that way on a 32 GB machine. Every GPU call was paying about 4 ms to re-wire memory, 19 times per token.

Two fixes, both measured:
→ Turn the wired limit off: 12 → 69 tokens/s
→ Memory-map the weights: same speed, and RAM drops from 23 GB to 14 GB

With MTP (speculative decoding) it goes from 7 to over 70.

One machine, one run per cell, so treat the numbers as a pointer. But if your Qwen4 feels slow on a Mac that it nearly fills, check wired memory before blaming the model.

Details and repro in the oMLX issue: https://github.com/jundot/omlx/issues/5996


r/oMLX • • 5h ago

How fast can local LLM inference get on Apple Silicon?

Thumbnail
reddit.com
0 Upvotes

r/oMLX • • 21h ago

Qwen4-35B-A3B running at up to 280 Tok/s on M5 Ultra Superfluid

Post image
14 Upvotes

We’ve been working on day-zero support for Qwen4 in Superfluid and are already seeing upto 280 tok/s decode on an M5 Ultra. Really impressed by what this model can do with just 3B active parameters in terms of agentic capabilities running locally.

Give it a try and let u know what you think. https://github.com/basecompute/baseRT


r/oMLX • • 9h ago

Tradeoffs of oQe vs oQh quants?

1 Upvotes

What are the tradeoffs of enabling or disabling the rotated codes? Isn't oQh just always better? Is it considerably slower or something vs oQe? Why is it not default/more widely used?


r/oMLX • • 1d ago

oMLX 0.8.5: Qwen4 support,Transformers engine for day-0 models

Thumbnail
gallery
179 Upvotes

Hi everyone!

Sorry for the late post. I actually released oMLX 0.8.5 a few hours ago.
Qwen4-35B-A3B just came out, and it already runs on oMLX.
https://github.com/jundot/omlx/releases/tag/v0.8.5

Qwen4 MoE Support

Qwen4-35B-A3B now work with Lightning MTP, image input and oQ.

I tried Qwen4-35B-A3B on my M5 Ultra and it's really fast. Prefill stays above 10,000 tok/s all the way up to a 64K prompt. Decode runs at 200+tok/s for one request with MTP, and 600+tok/s total with 8 requests at once.

Its tokenizer ships as code in the model repo, please turn on Trust Remote Code before you load it.

External Transformers engine

oMLX can now run models with Hugging Face Transformers too, so a new model works on day zero, even before anyone ports it to MLX. It's still experimental, and you can turn it on in Settings > Integrations > Transformers.

Faster decode

  • DeepSeek V4.1 Flash, rewriting a file: 191 -> 279 tok/s (+46%)
  • Inkling 2 Mini, two 98K requests at once: 75.5 -> 97.8 tok/s (+30%, M3 Ultra)
  • GLM-5.3 Flash, 4 requests at once: 52.0 -> 65.4 tok/s (+26%)
  • Qwen3.6 35B-A3B + DFlash: 282 -> 337 tok/s (+20%)
  • Qwen3.8 27B + MTP: 144 -> 163 tok/s (+13%)

All on M5 Ultra unless noted.

ERNIE 5.5 Flash Preview now runs straight from Baidu's FP4 and FP8 releases, Inkling 2 can keep its KV cache in 8 bits to save memory on long sessions, and watchdog panics are fixed.

Release notes: https://github.com/jundot/omlx/releases/tag/v0.8.5

82 PRs from 31 people went into this release, and 7 of them sent their first one.
Thank you so much, everyone! Let me know how Qwen4 runs on your Mac. 🤗


r/oMLX • • 1d ago

Qwen4 without Trust Remote Code?

13 Upvotes

Any chance or anyone know how to run the new qwen4 without trusting remote code execution?

That's a risk I'm not willing to take.


r/oMLX • • 1d ago

📌 Jundot/omlx — Daily Digest (2026-12-03 09:01 -> 2026-12-04 09:01)

7 Upvotes

✅ 5 issues closed · 7 PRs merged

# BUG
#5922 oQ quantization ignores per-model trust_remote_code — Qwen4-35B-A3B calibration always loads with trust_remote_code=False

#5905 Decode TPS regression for Qwen3.8-Flash-Next-oQ4e-mtp on M3 Ultra (0.8.5dev1 → 0.8.5rc2)

#5900 Transformers engine cannot decode: cached step passes 2-D hidden states to Qwen3 attention (torch 2.15 / MPS)

#5886 MTP: per-cycle INFO logging in batch_generator bloats server.log to ~500MB/day under long MTP workloads

# FEATURE
#5921 Add qwen4_moe support
#5077 feat: remote backend, use an oMLX server on another Mac from this install

# FIX
#5914 fix(updater): create the DMG mount point before diskutil attaches it
#5904 fix(splash): load explicitly serialized GGUF tokenizers
#5906 perf(inkling2): MoE offload parity (overlapped fetches, decay eviction, asymmetric looped-core slots)
#5895 fix(dflash): store a quantized kept context as a tuple

# MR
#5924 fix(qwen4_exp): keep HC fusion and compile for non-verify decode with MTP

Also closed:
- #5912 Updater can't mount the release DMG: diskutil image attach mount point doesn't exist


r/oMLX • • 1d ago Heartwarming

*squeee*

Post image
105 Upvotes

r/oMLX • • 1d ago Bravo

Qwen4-35B-A3B-oQ4e-mtp benchmarks on M3U and M5U

Post image
24 Upvotes

M3U on the left, M5U on the right. Both are base CPU/GPU configs. N-Gram tables offloaded to SSD.


r/oMLX • • 1d ago

Qwen4-35B-A3B-oQ8e-mtp fails to load – trust_remote_code=True required?

4 Upvotes

Hi everyone,

I’m trying to load mlx-community/Qwen4-35B-A3B-oQ8e-mtp in oMLX, but the model fails to load.
I’m getting the following error:

HTTP 409: Model 'Qwen4-35B-A3B-oQ8e-mtp' is unavailable after a previous load failure.
The repository contains custom code which must be executed to correctly load the model.
Please pass the argument `trust_remote_code=True` to allow custom code to be run.

For context, I’m running oMLX on an Apple Silicon Mac with an M5 Max and 128 GB of unified memory.

Other models load without any issues, including:

  • gemma-4-26B-A4B-it-oQ4e-mtp
  • Qwen3.8-Flash-Next-Uncensored-oQ5e-mtp
  • Qwen3.8-27B-Uncensored-oQ8e-mtp

Only the Qwen4 model seems to have this problem.
My questions:

  1. Is there a way to enable trust_remote_code=True for a specific model in oMLX?
  2. Does the current oMLX loader support this model architecture?
  3. Is there something I need to change in the model configuration or repository files to make it work?

I’d appreciate any suggestions or pointers. Thanks!


r/oMLX • • 1d ago

M5 Ultra 64-core vs 80-core GPU (and 1TB vs 2TB SSD) for oMLX?

6 Upvotes

Looking to buy an M5 Ultra with 256GB RAM for local AI with oMLX .
Two quick questions for those using it:

  1. 64-core GPU vs. 80-core GPU: Is the ~€1,500 upgrade worth it for real-world prefill speeds, or does oMLX prefix caching make the difference negligible?
  2. 1TB vs. 2TB SSD: Is 1TB enough for storing a few large models + oMLX disk cache, or should I just bite the bullet and get 2TB?
    Appreciate any real-world insights!

r/oMLX • • 1d ago

Qwen4-35B-A3B vs Qwen3.8-Flash-Next on an M5 Max: - (OMLX)

Thumbnail
reddit.com
1 Upvotes

r/oMLX • • 1d ago

Made a better fidelity model 8-9% increase (Mac MLX only atm)

Thumbnail
huggingface.co
1 Upvotes

r/oMLX • • 2d ago

Please bring me back to local AI...

34 Upvotes

Guys, talk some sense into me before I give up on local completely.
I just sold my M3 Ultra 96GB (got almost what I paid for it, couldn't say no) with the full plan to upgrade to an M5** **Ultra 256GB (~€11k here in Europe) to run oMLX with bigger context and parallel agents.
While waiting to buy the new Mac, I temporarily pointed my coding and agent workflows to the Qwen API… and honestly, I’m kind of ruined now.
The results are great, I’m getting unquantized weights instead of oQ4, multiple agents run in parallel without choking, and my monthly API bill is literally about the same as what I was paying in electricity to keep the Studio running. At this rate, €11k pays for like 15 years of API calls.
I love tinkering with oMLX and having everything local, and yeah, keeping sensitive company/accounting stuff off the cloud still matters—but dropping €11k on hardware right now feels crazy when APIs are this cheap and good.
Anyone running a 256GB+ Studio right now? Why are you still doing it? Bring me back to the local side.

EDIT: Well, you guys officially brought me back.
Looking at the comments, the real dividing line finally clicked: cheap APIs win hands down for interactive coding, while local hardware is really about not building business dependencies on rented cloud pricing, rate limits, and third-party data retention.


r/oMLX • • 1d ago

best llm for m4 24gb?

1 Upvotes

i dont wanna fry my internal ssd im very new at running local models


r/oMLX • • 1d ago

Agentic coding with subagents

1 Upvotes

I’m really new to the local AI scene, but I’m getting there. I run oMLX on a headless Mac Studio M3Ultra with 96G shared ram. I’ve already used various models to build a chat app, a rag system and some other stuff. Generally, this is one session at a time via opencode, occasionally multiple sessions. My dream, though, is to be able to have at least one session with a main model to do planning, write specs, etc and have it kick off a subagent or 2 to do the actual implementation. I keep running into roadblocks like memory, subagent abilities, etc.

I’ve tried Qwen3.8-27B (and some variants) as the main, and they code good enough, but they’re too heavy to be subagents. I’ve tried doing some tests with various sub-10G subagents with limited context windows and thinking, but they always seem to fail at file edits or other problems. Atm, I’m using a Qwen3.8-27b variants to do testing of subagent workloads. I have the entire omlx git repo in my local rag setup, so I can have it optimize per what the actual code says.

So, my questions:

  • Is this even realistic? Is what I want actually possible on the hardware I’m using and staying local?
  • If its possible, which models would be recommended for the primary and for the subagents?
  • What kind of settings should I use with the subagent?
  • Anything else I should know or look into to get this working?

Thanks!


r/oMLX • • 1d ago

Sorry 🤷🏼‍♂️

Post image
3 Upvotes

r/oMLX • • 1d ago

pretty wow. went from 80 to 104 with this latest rc

Post image
0 Upvotes

r/oMLX • • 2d ago

Deepseek w/ loop and loopcd coming soon?

8 Upvotes

Hey guys,

Been following the loop/loopcd progress people are doing with qwen/deepseek and was wondering if this is something we could possibly be seeing coming to omlx in the future. Pretty comfortable using omlx, so the idea of switching to sushi to test really doesn't interest me much.


r/oMLX • • 2d ago

Just wanted to drop a thank you!

21 Upvotes

Powered this guy on (and promptly reformat - still had Sequoia on it 😂) for the first time in easily well over a year and a half. AI wasn’t even on my radar when I was using it. And duh never even really made the connection that this thing has unified memory.

I only local ai (Linux: 5080+5090+96gb ddr5, 48gb vram). It’s a great setup for what I’m doing but can get a bit frustrating having to constantly juggle models, point Opencode to the wrong place, have to reload ComfyUI yet again, rag server when I’m working in obsidian, etc.

And bam just like that, oMLX essentially doubled my real workflow tool chest. I’m still testing and figuring things out, but I can run Qwen 27b (mlx) at what pretty much feels like how fast I was using it before (iow, not a benchmark but it’s fast enough for me) while I’m also working on game art, etc.

2023 Mac Pro M2 Ultra 64GB
(+ a few pcie/nvme cards, lots of space)


r/oMLX • • 2d ago

How much performance is still on the table?

8 Upvotes

I have a Mac Studios on order, and I’m curious how much faster things could get on the same hardware as the software matures, mainly for concurrent users, clustering, and efficiency gains

do you think we’re already close to the hardware limit, no where near it or somewhere in between?


r/oMLX • • 3d ago

📌 Jundot/omlx — Daily Digest (2026-11-28 09:00 -> 2026-11-29)

9 Upvotes

✅ 2 issues closed · 19 PRs merged

#5689 [BUG] Back To Back System Crashes
macOS app (DMG) on M5 Ultra 256GB running oMLX 0.8.4 with DeepSeek-V4.1 model crashes repeatedly.

#4222 [BUG] model_settings.enable_thinking never reaches BatchedEngine / VLMBatchedEngine
Feature flag `enable_thinking` is silently ignored for non-distributed engines like `BatchedEngine`.

#5762 perf(inkling2): batched verify rows with bits of their decode steps
Optimizes verify step by batching rows with decode step bits at any batch size.

#5761 perf(inkling2): 8-bit decode and verify attention on tensor units
Implements 8-bit attention on tensor units for decode and verify phases.

#5760 perf(inkling2): shared-tile verify with rows bit-identical to decode steps
Ensures verify rows are bit-identical to their corresponding decode steps via shared tiles.

#5758 perf(mtp): merge replaced batch rows one layer at a time
Merges replaced batch rows sequentially per layer to handle private cache commits.

#5757 fix(turboquant): keep each row's end when rows join ragged batch
Preserves row boundaries when joining rows into a ragged batch for draft acceptance.

#5756 perf(inkling2): int8 Q.K^T for prefill global attention over affine8 keys
Uses int8 Q.K^T for prefill global attention over affine8 keys in Inkling 2.

#5755 perf(inkling2): 8-bit affine KV cache with decode and verify over codes
Introduces 8-bit affine KV cache supporting decode and verify over codes for Inkling 2.

#5751 feat(glm5_next): opt-in INT8-activation (A8) prefill
Adds opt-in INT8-activation prefill routing for GLM-5.3-Flash using existing oq_q8_a8_nax.

#5521 chore(deps): update transformers requirement
Updates transformers dependency range to >=5.14.0,<5.24.

#5747 perf(qwen): fold four-row Q4 routing into gate-up
Optimizes Qwen by folding four-row Q4 routing directly into gate-up operations.

#5741 fix(admin): keep API key out of browser auth flows
Removes server long-lived API keys from browser auth flows in favor of admin sessions.

#4955 fix(audio): protect multipart engines during upload reads
Prevents multipart transcription engines from losing selected state during disk-backed upload reads.

#4198 feat(adapter): parse LLM-jp-4 Harmony output
Parses LLM-jp-4 Harmony outputs into distinct reasoning and tool call components.

#5730 feat: hadamard verify kernels
Implements Hadamard verify kernels based on suggestions for MTP support.

#5722 fix(inkling2): report malformed tool calls
Fixes Inkling 2 parser to properly report malformed tool calls instead of suppressing payloads.

#5728 perf(vlm): accelerate 2-bit Hadamard verify forwards
Accelerates 2-bit Hadamard verify forward passes on prism_hadamard models.

#5726 feat(ernie5_5): build ERNIE 5.5 Flash as oQh
Enables building ERNIE 5.5 Flash as oQh from FP4 release with expert walk reuse.

#5680 perf(inkling2): batched Lightning MTP with ragged KV rollback
Implements batched Lightning MTP with ragged KV rollback, boosting throughput at long contexts.

#5720 feat(ernie5_5): support ERNIE 5.5 Flash Preview
Adds native support for ERNIE 5.5 Flash Preview with fused kernels and long-context handling.