Skip to content

Independent run on a Mac Studio M5 Ultra 256 GB: Qwen3.8 Flash Next numbers (MLX 0.32.2 exactness check passes) #22

Closed

Description

@sethforprivacy

Posted by Claude (Anthropic's AI assistant) on behalf of @sethforprivacy, as part of our local-inference tuning work on a Mac Studio M5 Ultra.

An independent run in the style of #7, on a Mac Studio M5 Ultra (80-core GPU, 256 GB, macOS 27.0), TensorFold 0.3.4 @ 2f8e514b0b7d, Python 3.12, MLX 0.32.2 / mlx-lm 0.31.3 (pip's default resolution).
Model: Vontra/Qwen3.8-Flash-Next-MLX-4bit-MTP @ dadefa8066, tensorfold serve <dir> --context 262144 --no-update-check, default MTP drafts.

Exactness check: on M5 Ultra with MLX 0.32.2, Flash Next's drafted-row check passes. Startup printed drafts: on, and acceptance runs 60–95 % depending on content.

Our standard OpenAI-endpoint suite, one request at a time unless noted. Decode = wall-time difference between 32- and 512-token completions. Thinking was off for the speed runs (chat_template_kwargs.enable_thinking: false):

TensorFold 0.3.4
decode, fresh prompts (median of 10, greedy) 200.7 tok/s
decode, 2K-token code prompt ~222 tok/s (from the server's per-request line)
prefill 2K · 8K · 32K · 128K · 256K 471 · 462 · 450 · 412 · 344 tok/s
decode after a 32K · 128K prompt 120.9 · 83.6 tok/s
warm follow-up turn (prefix cache), 8K · 32K 0.12 s · 0.17 s (cold: 17.7 s · 72.2 s)
aggregate at 1 · 2 · 4 · 8 concurrent streams 182 · 186 · 185 · 184 tok/s (max TTFT at 8 streams: 18 s)
agent-style edits (return a 140-line file with a rename · add docstrings · reproduce JSON with one change) 339 · 322 · 301 tok/s
12 reasoning prompts · tool calls · 127K three-code needle retrieval 12/12 · pass · pass
peak RAM 135 GB
KLD vs BF16 teacher logits (full vocab, 46,800 positions) 0.1285, top-1 0.873 (the same as mlx-community's plain 4-bit, 0.1276)

For context, on the same box with the same suite: oMLX 0.7.0rc1 (oQ6e checkpoint) gives 147 tok/s fresh and ~3,300–3,600 tok/s prefill, and mlx-serve 26.9.6 (its mixed 4/8 checkpoint) gives 160 tok/s fresh and ~3,000–3,800 prefill.
TensorFold has the fastest single-stream decode and the best warm-turn latency we've measured on this machine.

Two observations, in case they're useful:

  1. Prefill is 7–10× slower than the other MLX engines here (344–471 tok/s vs ~3,000+), so a cold 128K prompt takes ~5 minutes. The prefix cache hides this well on follow-up turns.
  2. Concurrent requests queue rather than batch: aggregate throughput is flat from 1 to 8 streams. That may well be by design; noting it for anyone serving several agents at once.

(KLD note for anyone scoring these Vontra Qwen exports through mlx-vlm: they store the zero-centred norms, hc_norm, PLE norm_*, indexer q/k_layernorm and attention q/k_norm, pre-shifted by +1. mlx-vlm 0.7.3 adds the 1 again, which gives KLD ≈ 9 until you subtract it. TensorFold itself is unaffected.)

Activity

  1. added
    documentation
    on Sep 27, 2026
  2. sethforprivacy commented on Sep 27, 2026

    @sethforprivacy
    ContributorAuthor

    Posted by Claude (Anthropic's AI assistant) on behalf of @sethforprivacy, as part of our local-inference tuning work on a Mac Studio M5 Ultra.

    Re-ran the same cell on 0.3.4.1 @ bb4b4a3: same M5 Ultra (80c / 256 GB, macOS 27.0), MLX 0.32.2 / mlx-lm 0.31.3, Vontra/Qwen3.8-Flash-Next-MLX-4bit-MTP @ dadefa8066, serve --context 262144 --no-update-check, default drafts. The exactness check still passes.

    0.3.4 0.3.4.1
    cold prefill 2K · 8K · 32K (tok/s) 471 · — · 450 2,708 · 2,805 · 2,324
    cold prefill 128K · 256K 412 · 344 689 · 391
    decode at depth 32K · 128K · 256K 120.9 · 83.6 · — 94.7 · 61.0 · 55.1
    decode, fresh prompt (greedy) · 2K code prompt 200.7 · ~222 187.3 · 223.5
    warm follow-up turn at 8K · 32K 0.12 s · 0.17 s 0.81 s · 0.20 s
    agent turns T=0: edit file · fix fn · JSON edit · diff · prose · new code 339 · 322 · 301 · 225 · 156 · 188 338 · 325 · 301 · 228 · 157 · 192
    c=1 · 2 · 4 · 8 aggregate 182 · 186 · 185 · 184 195 · 187 · 191 · 180
    12 reasoning checks · tool / 127K retrieval gates 12/12 · pass 12/12 · pass
    • Thanks for the prefill fix. Up to 32K it is 5–6× faster, and at 2K it now matches oMLX on this box (2,783 tok/s).
    • Past 32K it still tapers: 689 tok/s at 128K and 391 at 256K, where oMLX and mlx-serve hold ~3,300–3,750 on the same machine. Decode at depth falls too (61 tok/s at 128K; oMLX is ~80).
      That fits what M3 Ultra, Qwen3.8 Flash Next: 0.3.4.1 faster on short prompts, slower on long context than 0.2.0 (side-by-side numbers) #27 sees on an M3 Ultra (slower on 10–17K prompts). The long-context attention path looks like where the remaining time goes.
    • Short-context decode and agent turns are unchanged and still the fastest we've measured for this model on Apple silicon.
    • Minor: the warm 8K follow-up went from 0.12 s to 0.81 s. 32K is unchanged.

    Happy to rerun on a later tag, or with a flag if there's one to try for long prompts.

  3. ashhart commented on Sep 27, 2026

    @ashhart
    Owner

    Thanks @sethforprivacy for the independent measurements and exactness checks. 0.3.5 ships tonight with shared-round concurrency and faster long-prompt prefill for Flash Next. A rerun of your concurrent and long-prompt cases on it, with each stream compared against its solo result, would be very welcome. Closing this benchmark report with thanks.

  4. sethforprivacy commented on Sep 28, 2026

    @sethforprivacy
    ContributorAuthor

    Posted by Claude (Anthropic's AI assistant) on behalf of @sethforprivacy, as part of our local-inference tuning work on a Mac Studio M5 Ultra.

    As requested, a rerun on 0.3.6.1 @ 34bae79.

    • Machine: Mac Studio M5 Ultra (80-core GPU, 256 GB, macOS 27.0), MLX 0.32.2, serve --context 262144 --no-update-check, default drafts.
    • Concurrent vs solo: 8 different prompts, greedy, 256 tokens. Each ran alone first, then all 8 at once, and each stream's text was compared with its solo text.

    Qwen3.8 Flash Next (Vontra/Qwen3.8-Flash-Next-MLX-4bit-MTP @ dadefa8066):

    0.3.4 0.3.4.1 0.3.6.1
    cold prefill 2K · 8K · 32K 471 · — · 450 2,708 · 2,805 · 2,324 2,983 · 2,869 · 2,826
    cold prefill 128K · 256K 412 · 344 689 · 391 2,657 · 2,159
    decode at depth 32K · 128K · 256K 120.9 · 83.6 · — 94.7 · 61.0 · 55.1 131.5 · 126.9 · 175.2
    decode fresh (greedy) · 2K code prompt 200.7 · ~222 187.3 · 223.5 196.6 / 182.8 · 293.6 / 201.8 (two passes)
    warm follow-up 8K · 32K 0.12 · 0.17 s 0.81 · 0.20 s 0.09 · 0.13 s
    aggregate c=1 · 2 · 4 · 8 182 · 186 · 185 · 184 195 · 187 · 191 · 180 195 · 210 · 275 · 327
    agent turns T=0: edit · fix · JSON · diff · prose · new code 339 · 322 · 301 · 225 · 156 · 188 338 · 325 · 301 · 228 · 157 · 192 437 · 409 · 388 · 246 · 145 · 188
    8 concurrent streams identical to solo 8/8 (aggregate 326 tok/s vs 173 solo)
    12 reasoning checks · tool / 127K retrieval gates 12/12 · pass 12/12 · pass 12/12 · pass
    • Long prompts are fixed: 128K went from 689 to 2,657 tok/s, and decode at depth no longer collapses.
    • Concurrency now scales (1.7× at 8 streams), and every stream stayed identical to its solo run.

    GLM-5.3-Flash on a Mac, first run here. TensorFold loaded our own oMLX checkpoint directly:

    • dfp-official/GLM-5.3-Flash-oQ4e-mtp, with the missing layer-45 MTP head grafted from Vontra/GLM-5.3-Flash-MLX-4bit-MTP.
    • The log reported 542 non-4-bit tensors "through the 8/6/5-bit row kernels", with drafts on.
    TensorFold 0.3.6.1
    decode fresh · 2K code prompt 76.6 / 77.7 · 102.6 / 152.7
    cold prefill 2K · 8K · 32K · 128K · 256K 1,114 · 1,047 · 1,027 · 856 · 630
    warm follow-up 8K · 32K 0.13 · 0.57 s
    aggregate c=1 · 2 · 4 · 8 84 · 94 · 108 · 121
    agent turns T=0: edit · fix · JSON · diff · prose · new code 123 · 100 · 123 · 71 · 71 · 73
    8 concurrent streams identical to solo 8/8 (aggregate 123 tok/s)
    12 reasoning checks · tool / 127K retrieval 12/12 · pass
    image request not supported (the checkpoint has a vision tower; image parts aren't accepted)

    For context, oMLX main (with jonathan308's GLM-5.3 prefill work, now merged) on the same weights prefills at 2,233 tok/s at 32K and 2,024 at 256K. So GLM long-prompt prefill looks like the biggest gap left.

    Exactness under concurrency: 8/8 on both models, where the same test gives 1/8 (GLM) and 3/8 (Qwen) on oMLX. Thanks for the fast turnaround!

  5. sethforprivacy commented on Oct 12, 2026

    @sethforprivacy
    ContributorAuthor

    Posted by Claude (Anthropic's AI assistant) on behalf of @sethforprivacy, as part of our local-inference tuning work on a Mac Studio M5 Ultra.

    A follow-up for 1.0: native 1.0.7 against the Python engine, Qwen3.8 Flash Next on one Mac.

    • Machine: Mac Studio M5 Ultra (80-core GPU, 256 GB, macOS 27.0).
    • Checkpoint: TensorFold/Qwen3.8-Flash-Next-MLX-6bit-MTP @ 45032a1.
    • Native: the 1.0.7 macOS release archive, serve --context 262144; it loaded in 34 s.
    • Python: the build our lane serves, 0.6.5 plus our own patches (prompt passes for 6-bit weights, tensor-unit prompt attention, image input on Metal), --parallel 16, MLX 0.32.3.
    • Method: both served in turn on the same port with the same requests. Greedy (temperature: 0, which 1.0.7 accepts), thinking off, real-text prompts, each cold prompt opening with its own line so no cache held it.
    Native 1.0.7 Python (0.6.5 + patches)
    Cold prefill, 6.5K / 25.7K / 114K tokens 4,009 / 4,362 / 4,409 tok/s 3,534 / 3,631 / 3,303 tok/s
    114K-token prompt to its first token 25.8 s 34.4 s
    Decode, one stream, 512 tokens: code / prose / edit 215 / 136 / 197 tok/s 162 / 118 / 156 tok/s
    Agent history of 81K tokens, cold 18.3 s 25.1 s
    Next three turns, +1K tokens each (cached) 0.44 s 0.52–0.53 s
    Four requests at once, 256 tokens each: aggregate, first token mean / max 151 tok/s, 2.71 / 5.49 s 196 tok/s, 0.25 / 0.45 s
    • One request is clearly faster on native: prefill 13–33 % (the gap grows with depth, so it holds its speed where 0.6.x slows), decode 15–33 %, and about 0.09 s off each cached turn.
    • Overlapping requests still favour the Python engine, since 1.0.7 runs one Flash Next request at a time: the fourth of four waited 5.5 s for its first token.
    • What keeps our lane on 0.6.x for now: shared rounds, sampled requests (any temperature but 0 gets a 400), and image input (Native image and video inputs in the server (Python frontend's preparation, data and HTTPS URLs), before any family consumes them #565). Our lane serves a coding agent that sends all three.
    • Prompt cache: 1.0.7 kept 5.7 GiB for it, what its 70 % cap leaves after the 6-bit model. That holds only a few long agent conversations at once, where our Python lane keeps 16 GiB in memory plus a 64 GiB spill.

    We'll rerun when Flash Next gets shared rounds on native.

  6. sethforprivacy commented on Oct 12, 2026

    @sethforprivacy
    ContributorAuthor

    Posted by Claude (Anthropic's AI assistant) on behalf of @sethforprivacy, as part of our local-inference tuning work on a Mac Studio M5 Ultra.

    The rerun promised above: native with Flash Next's shared rounds, sampling and images. As of today it serves our production lane, replacing the Python build (0.6.5 plus our patches). It is cwschroeder's shared sessions (#606) on BobClawblaw's flashnext-video (images, video, the load limit), plus #719's sampling and one commit of ours. Details of our commit are on #606 and #565, and the idle-memory fix is in #732.

    Same Mac, checkpoint and method as before (TensorFold/Qwen3.8-Flash-Next-MLX-6bit-MTP @ 45032a1), at the lane's settings:

    • 16 streams in 200 GiB.
    • A 16 GiB prompt cache with a 64 GiB disk spill.
    • Images at 4,096 tokens each, 65,536 a request.
    Native, shared rounds (ours) Python (0.6.5 + patches) 1.0.7 release
    Cold prefill, 6.5K / 25.7K / 114K tokens (tok/s) 3,962 / 4,218 / 4,140 3,534 / 3,631 / 3,303 4,009 / 4,362 / 4,409
    Decode, one stream, 512 tokens: code / prose / edit (tok/s) 213 / 134 / 195 162 / 118 / 156 215 / 136 / 197
    Sampled ladder at 2 / 4 / 8 / 16 streams (aggregate tok/s) 153 / 196 / 232 / 255 133 / 177 / 213 / 259 one at a time; no sampling
    Mean first token in that ladder (s) 0.31 / 0.50 / 0.90 / 1.73 0.44 / 0.68 / 1.35 / 2.46
    • Speed: one request keeps native's speed, because a lone request runs on the single-reply driver's GPU-side rounds and moves to the shared rounds when a second arrives. Overlapping requests now match or beat the Python build up to 16 streams.
    • Exact output:
      • Concurrent replies equal solo replies (3/3, 8/8), and so do replies handed between the two paths mid-reply.
      • Image streams beside text streams equal their solo replies.
      • An image conversation resumes its prefix every turn, and its replies equal a server with no prompt cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions