r/LocalLLM • • Oct 10 '26

Tutorial GLM-5.3-Flash (320B) on an M5 Ultra Mac Studio with llama.cpp: 61 tok/s, 262K context

https://jvlewis.dev/glm-5-3-flash-320b-on-an-m5-ultra-mac-studio-with-llama-cpp-61-tok-s-262k-context-c184f21f6286

Test machine: M5 ultra. 36/80. 256GB.

TL;DR

  • ~61 tok/s generation with GLM’s built-in MTP head (probabilistic drafting, 3 draft tokens), up from 39.7 without it.
  • Prompt reading is the weak spot: ~765 tok/s at 4K tokens and ~630 tok/s at 59K. A 29K-token prompt takes 45 s.
  • The full 262K context fits with ~15 GiB to spare, and long-context recall was correct at 58.8K tokens.
  • The catches: images and MTP can’t be on at the same time, and deep context on Metal needs a fix has yet to be merged.
60 Upvotes

29 comments sorted by

14

u/ilarp Oct 10 '26

model supports 1M

10

u/ColoredTriangles Oct 10 '26

Damn I was expecting more prefill from the m5 ultra. I can get triple the prefill of this mac with the 5090 on this model with the same context and quant size.

5

u/DankpawsDev Oct 10 '26

That prefill speed isn't even approaching what the M5 Ultra is capable of. We're currently in the 4k/s range for the M5 Ultra.

5

u/ObjectiveVegetable48 Oct 11 '26

Who's we? Is this a product that is/will be available?

1

u/voyager256 Oct 11 '26

I'd like to see this 4k/s prefill for GLM 5.3 Flash too. I'm sure the 700/s using llama.cpp isn't near the maximum you can get on M5 Ultra , but I'm skeptical of getting 4k/s

3

u/voyager256 Oct 10 '26

using what inference engine and system RAM bandwidth and size? I suspect a custom one like strata and a workstation rather than a PC with dual channel DDR5.

2

u/ColoredTriangles Oct 10 '26

I have a freetoken fork that runs exl3 quants specifically for my system. I have dual channel ddr5 6000 cl no workstation z890 board with 285k. I run GLM 5.3 flash 4.05 bpw around 2k prefill drops to 1800 at 260k context and 35 drops to 30 decode.

1

u/voyager256 Oct 11 '26

ok , I wasn’t expecting that on a PC , even with a 5090 , thanks for sharing

1

u/ColoredTriangles Oct 11 '26

The 5090 is great but it's really the frontier models that are out right now that can optimize engines per your hardware. That is the trend that is happening right now with Strata and the various other engines on social media. So more than the hardware constraints if you already have a subscription to a frontier model you should just look at what you can squeeze out of your setup by forking the engine that best fits your needs per model.

1

u/thilog Oct 10 '26

Hm, TFA is inaccessible due to a Cloudflare error...

3

u/bakawolf123 Oct 10 '26

I have ~73tps with dflash on patched omlx, images working, 400k context, ram only (no ssd cache) - avg sesh data. Greedy bench is up to 141 tps at 128k context.

On a oQ4e, affine 4 bit is faster.
Long prefill is 2.4k for affine, ~2.35k for calibrated checkpoint (so restarting old sesh from hot-only isn't painful, I'm worried about ssd wear more).

MTP works out of the box already and is decently optimized. Should be around 65-70 for a long sesh. Getting much more perf out of 3-4 block verify is going to be hard.

The caveat with dflash is that you have to patch it, I did sneak 2 perf PRs in, but getting images and proper cache for dflash requires big rework, that patch is not getting merged.

1

u/Nomski88 Oct 11 '26

nice! is 400k with with a single concurrency and maxxed out memory? Trying to get an idea because I'm getting ready to preorder the same M5U model as OP.

1

u/bakawolf123 Oct 11 '26

you can use full 1M context if you want, but I'm using a threshold what fits comfortably enough so I can run other apps and so that model doesn't get lost (it's a 4 bit quant after all).
You can offload all kv cache to ssd without it being noticeably slower - I don't do that only because I'm worried about ssd wear from too much writing, as the traffic quickly adds up.

1

u/NaiRogers Oct 12 '26

Pretty good, is this with GLM-5.3-Flash-oQ4e-mtp? Do you think the high (135tps+) decode numbers on some of the oMLX Community Benchmarks are inaccurate? Trying to understand what to expect.
Also would be good to know what happens to the decode rates with 2 concurrent requests where both have say 256k context used?

2

u/bakawolf123 Oct 12 '26

A lot of those 140+ tps are mine, experimenting with various stuff. Bench is greedy decoding + it highly depends where bench offset lands, hence you see results vary heavily across different context sizes. But this variance is also not far from real world usage.

I have merged dflash for glm5_next into vlmbatched engine, now I often have ~85 sustained.

1

u/NaiRogers Oct 12 '26 edited Oct 12 '26

Thanks, it’s good to see something representative.
What's the performance with 2 sessions in parallel like?

3

u/bigsybiggins Oct 10 '26

Seems really poor compared to other reports like here https://www.reddit.com/r/LocalLLaMA/comments/1wy8k3m/m5_ultra_256_running_glm_53_flash_688_toks/ that thread also has someone else reporting 2k+ prefill with links to benchmarks here https://omlx.ai/benchmarks/performance/zozd30ox

2

u/thilog Oct 10 '26

Does prefix caching compensate slow prompt reading for interactive usage?

1

u/Southern_Sun_2106 Oct 10 '26

it helps when you process a large prompt once, and then only chat about it back and forth.

Once another big chunk comes around, it's back to slow pp.

1

u/[deleted] Oct 10 '26

[removed] — view removed comment

1

u/starkruzr Oct 10 '26

it does. these fresh context tests are useful for some forms of agentic work but if you're doing interactive development you're going to be leaning on prefix cache pretty hard.

2

u/NaiRogers Oct 12 '26

Seems much slower than the oMLX results here GLM-5.3-Flash-oQ4e-mtp

2

u/Inchmine Oct 10 '26

Damn that is slow for sure. I rather spend a bit more and get a rtx 6000

1

u/nomorebuttsplz 3d ago

hope you got it faster than this by now. I am getting almost this fast on the m3u which lacks the neural cores on the gpu.

1

u/topgoysilky Oct 11 '26

Did none of yall dumb asses read the “catches” line? i swear humanity is cooked.

1

u/StardockEngineer 2x5090, 2xPro6000, 2xA6000, 4xSpark, M5 Pro, M4Pro Oct 11 '26

It can do better.

1

u/Southern_Sun_2106 Oct 10 '26

How did Apple claim "4X" prefill? Was there some small font that it was measured against the M1 or something?

0

u/tat_tvam_asshole Oct 10 '26

I get 100+ tok/s with k=5 (albeit I'm on proper nvidia)