Skip to content
← Back to YouBlog

Published article

Lithos-metal 200 tokens/s claim on M5 Max

Drafted with AI from the video "Qwen 3.8 27B Just Hit 200 Tokens/s on Mac M5.", then reviewed and published by Gustavo Miranda.

Plain decoding of a 27-billion-parameter model on an M5 Max should top out near 38 tokens/s. Lithos-metal claims more than 200, and its README separately lists 168 tokens/s at a 128-token context as a projection that leaves out drafting and rewind.

What the Lithos-metal 200 tokens/s headline actually measures

Lithos-metal's 200 tokens/s figure for Qwen 3.8 27B on an M5 Max is a peak projection, not a measured end-to-end generation rate. The lithos-metal repository documents its 168 and 127 tokens/s numbers as projections that exclude drafting, verification and state rewind, and the blog announcement gives the 200-plus figure with no context length.

Three different numbers circulate for the same engine and the same chip. Only one of them comes from a completed round of generation.

Measured: one full round took 43.188 ms on a 40-core M5 Max at a 128-token context. Dividing six accepted tokens by that round gives about 139 tokens/s. > Derived upper bound: the same round can yield at most eight tokens, which gives about 185 tokens/s. > Projected: 168 tokens/s at a 128-token context and 127 tokens/s at 32K, assuming six accepted tokens per eight-row pass, with drafting, acceptance processing and rewind left out.

The model card does not state how many tokens that measured round accepted. Six is the README's own working assumption, so the 139 figure inherits it. A round that accepted fewer tokens would produce a lower rate from the same 43 ms.

Why memory bandwidth caps plain decoding near 38 tokens/s

Apple's 614 GB/s peak memory bandwidth on the M5 Max caps plain single-token decoding of a 16.1 GB 4-bit model at roughly 38 tokens/s. That is arithmetic, not a lithos-metal benchmark, and the 614 GB/s is itself a peak figure, so real throughput sits lower.

The MLX build of the 4-bit Qwen 3.8 27B weighs 16.1 GB. One full read of those weights at 614 GB/s takes about 26 ms. If every token needs its own full read, the ceiling lands near 38 tokens per second. Apple's own research notes that memory bandwidth, not compute, limits generation after the first token.

This ceiling also ignores the key-value cache, the model's stored memory of the prompt. That cache grows with prompt length, and its reads and writes come on top of the weight traffic.

Two paths can change the picture. Removing idle time around each read moves you closer to the ceiling but cannot pass it. Getting several tokens out of one read is the only way through.

How Metal megakernels cut idle time

A Metal megakernel removes the idle gaps between kernel launches by keeping recurrent state and attention scores on-chip across a block of input. It raises bandwidth utilisation but leaves the 614 GB/s limit untouched.

The supporting evidence comes from Stanford's Hazy Research group on an H100 with a 1-billion-parameter Llama model, not from Apple silicon. Serving engines vLLM and SGLang split one pass through the model into roughly 100 small GPU programs, each with setup and teardown. Both engines used at most about 50% of memory bandwidth; one fused megakernel used 78%. Hazy Research reported about 2.5 times the speed of vLLM and over 1.5 times the speed of SGLang.

Lithos-metal brings the idea to Metal, Apple's GPU programming interface. A worker is a thread group running a bounded sequence of tasks in order. When one worker needs another's result, a progress protocol signals when it is ready.

The fusion is narrower than some descriptions suggest. Lithos-metal fuses only the mixer inside each layer, either the Gated DeltaNet part or the attention part. The feed-forward block stays a separate kernel. Qwen 3.8 27B has 64 layers: 48 Gated DeltaNet layers and 16 full-attention layers, in a repeating pattern of three Gated DeltaNet layers then one attention layer.

How DSpark speculative decoding reads weights once for eight rows

DSpark speculative decoding lets a small drafter propose up to seven tokens so the main model verifies eight rows in a single pass over its weights. Each additional token costs compute, not another weight read.

DSpark comes from DeepSeek and Peking University in a paper dated 6 July 2026. The drafter reads internal values from the big model and proposes a block of tokens in parallel. A small low-rank head lets each guess see the one before it, which keeps acceptance from falling toward the end of the block. A confidence head predicts how far a block is worth checking.

DeepSeek's production serving reported 60% to 85% faster per-user generation against an MTP1 baseline at the same total server load. That is a data-centre result, and it does not transfer to Apple silicon by default.

In lithos-metal the drafter is small: five layers, 1.136 GB in NVFP4, about 7% of the big model. On a 40-core M5 Max at a 128-token context the draft stage took 4.392 ms, well under the 26 ms needed for one read of the main weights.

Acceptance works in two modes. Greedy mode keeps a guess only if it matches the big model's token. Sampled mode accepts a guess with probability p divided by q, capped at one, where p is the big model's probability and q the drafter's. A merged pull request on 7 October 2026 added exact speculative sampling for random token selection.

The rewind step the speed figures leave out

After verification, lithos-metal must rewind three kinds of state to match the accepted tokens, and the published speed figures exclude that work. The three are the key-value cache, the short history kept by a small filter layer, and the recurrent state.

That omission matters because rewind time scales with how much state the engine has to roll back. A pass that accepts six of seven guesses still has to discard the seventh and restore the cache and recurrent state to the accepted length.

Datasets and settings also differ between the headline and the measured round. The blog's 200-plus figure carries no context length, prompt or acceptance rate. Without those, the number cannot be reproduced or compared against another engine's published rate.

Prefill latency: how long a 30K prompt waits

Prefill, the work of reading your prompt before the first output token, costs about 53 seconds on a 30K-token prompt on a 40-core M5 Max with 48 GB. The projected 127 tokens/s decode rate only applies after that wait.

A merged pull request from 7 October 2026 reports the before-and-after numbers on that configuration.

4K-token prompt: 6.6 s, down from 13.0 s > 17K-token prompt: 26.9 s, down from 39.1 s > 30K-token prompt: 53.3 s, down from 71.3 s

A 32K prompt would take a little longer than 53 s. Any claim that lithos-metal works at long context covers decode speed only, and the first-token wait sits in front of it.

Which Macs get full acceleration

Full lithos-metal acceleration depends on chip tier, and only the 40-core M5 Max has measured recipes for the large model. Other chips either get measured kernels for smaller models or fall back to an unmeasured native path.

The repository dates from the 8 October 2026 blog announcement, so it is days old at the time of writing and the support matrix can move quickly. It uses the Apache 2.0 licence and requires macOS 26 or later.

ChipSupport level
40-core M5 MaxMeasured recipes for large models
M5 ProMeasured kernels for smaller models only
32-core M5 MaxUnmeasured native fallback
M4 ProUnmeasured native fallback

On the fallback path there is no automatic megakernel fusion and the tensor accelerator is turned off. The engine supports one model family plus an experimental 35-billion-parameter mixture-of-experts model, and it runs one generation at a time.

The reference hardware for the headline is a 40-core M5 Max with 48 GB. The projected 168 and 127 tokens/s figures are stated for that machine.

Does the speed hold up, and what should you actually test?

There is no published ablation, so nobody can say how much of lithos-metal's Apple silicon gain comes from the megakernel and how much from DSpark. The megakernel numbers come from an H100, and the DSpark gain comes from data-centre serving. Splitting the credit requires a test that toggles each technique alone.

Output correctness has one published check. All 512 generated tokens across four short prompts matched a BF16 reference, so on those prompts the faster path gave the same tokens. That says nothing about speed and nothing about other prompts. The README separately notes that a default fusion step changes how 16-bit numbers are rounded.

The blog puts lithos-metal at roughly 1.8 to 2 times MLX and Ollama at short contexts and above 2 times vLLM Metal, and labels those as target-compute projections that leave out drafting and rewind. If that ratio applied to 168 tokens/s, MLX would run near 90 tokens/s, far above the 38-token ceiling for plain decoding. Either the baselines use other settings or the ratio applies to a different number. The sources do not say which.

If you have a 40-core M5 Max with 48 GB and run Qwen 3.8 27B on short prompts, lithos-metal is worth trying. Measure it yourself and compare against the 38 tokens/s that plain decoding allows. On another chip, with long prompts, or with several concurrent generations, wait for independent tests.

Frequently asked questions

  • Is the 200 tokens/s figure for Qwen 3.8 27B on M5 Max measured? No. It comes from the blog announcement and the README reports no context length, prompt or acceptance rate behind it. The one published measured round on a 40-core M5 Max took 43.188 ms.
  • What is the highest measured round lithos-metal publishes? One complete round at a 128-token context took 43.188 ms on a 40-core M5 Max, per the model card. The card does not say how many tokens that round accepted, so the resulting rate depends on an assumption.
  • Why can plain decoding not exceed roughly 38 tokens/s on an M5 Max? A 16.1 GB 4-bit model read once per token at 614 GB/s peak bandwidth takes about 26 ms per token. Real bandwidth sits below the 614 GB/s peak, so real throughput is lower still.
  • Do the megakernel and DSpark speedups come from Apple hardware tests? No. The megakernel evidence is an H100 result from Stanford's Hazy Research, and the DSpark gain is a data-centre serving result from DeepSeek. Neither measured the two techniques together on Apple silicon.
  • Is the code open source? Yes, the lithos-metal engine is published under the Apache 2.0 licence, per the repository, and requires macOS 26 or later. The model weights carry their own terms.
  • How long does a long prompt take before the first token? A 30K-token prompt took 53.3 seconds of prefill after the 7 October 2026 pull request, down from 71.3 seconds. The projected decode rate only begins after that wait.
  • Which Macs get the full megakernel path? Only the 40-core M5 Max has measured recipes for the large model. The 32-core M5 Max and M4 Pro fall back to an unmeasured native path with the tensor accelerator off.
  • Does the faster path change the model's output? On four short prompts, all 512 generated tokens matched a BF16 reference. Other prompts and sampling settings remain untested in the published material.
  • What should I watch before relying on the 168 tokens/s figure? Track whether an ablation appears that isolates each technique, and whether a measured end-to-end rate is published with its acceptance rate and context length. Until then, treat 168 as a projection.

Turn the audit habit into written content

The useful part of this story is the habit of separating a headline from a measurement. The same discipline applies to technical videos: a 12-minute explanation often holds a clear argument, a set of numbers and a caveat or two, and all of it usually stays trapped inside the video.

YouBlog turns a YouTube link into a transcript and then into a written article you can edit and publish. If you have an explanation, an interview or a teardown sitting in a video, YouBlog is the path from that recording to a readable page.

Developers around Dev doido and the Crazystack typescript community publish plenty of this kind of material. Working through Crazystack shows how much technical detail gets shared verbally and never written down.

Source video

YouTube thumbnail: Qwen 3.8 27B Just Hit 200 Tokens/s on Mac M5.

Source video

Qwen 3.8 27B Just Hit 200 Tokens/s on Mac M5.

Create from this video

This article was created automatically from a new video.

Automate my channel

Turn your YouTube videos into articles

Built for creators with a backlog and no editor on staff. This page started as a video. YouBlog drafts from the transcript, you review every word, then publish on a first-party /p/{slug} page. Nothing goes live until you publish it.

Turn your videos into articles

Published with YouBlog