Skip to content

Releases

v26.11.4-botdev.5 — Argmax-First JSON/<think> Spec, 4→2 Group Syncs & Per-State Prefetch

Choose a tag to compare

@jeberly jeberly released this 29 Nov 22:10

Unified v26.11.4 M5 Ultra fork — bit-exact (0 diffs vs serial) DeepSeek-V4.1 & GLM-5.3 speedups + hardened constrained spec parity:

Highlights (v26.11.4-botdev.5)

  • Argmax-first constrained verify (prepareArgmax): replaces 16-op topK(64) + dual Metal argsorts with a 2-op suppression-aware argmax + scalar gather across DeepSeek-V4.1, GLM-5.3, and serial JSON. Skips topK on 95–99.9% of legal <think> and JSON verify rows, routes rare NaN-free misses to single-row topK, and routes NaN/-inf directly to full-mask argmax (guaranteeing full-vocab NaN parity).
  • DeepSeek-V4.1 4→2 exact group verify syncs & per-State prefetch: fuses batched verify + argmax into one eval with async group finish, moves draft-ahead prefetch onto per-slot State (0 multi-slot prefetch misses), enables --dspark-overlap on constrained rounds, and mirrors reasoning-phase truncation in copy rounds (<think> copy hits).
  • Hardened constrained reasoning parity & error-path safety: preserves atomic </think> closers that overlap EOS IDs (skip_eos_check), aligns reasoning repetition-loop recovery to the exact serial token index, and hardens DeepSeek commitMain / dsparkRoundQueued / dspark_group rollback error paths.

Verified M5 Ultra Results (0 Bit Diffs)

Setup Solo (drafted / plain) Concurrent batched spec (N=2/3/4) JSON-schema + <think> spec (0 diffs) Peak Wired
DeepSeek-V4.1-Flash Lossless (512 GB) 136–167 / 61 109.9 / 148.9 / 157.7 tok/s 97.1 agg / 136.6 peak (2.28×) 301.3 GiB
DeepSeek-V4.1-Flash twig (256 GB) 149–187 / 70 127.1 / 160.0–168.4 / 166.3–170.0 tok/s 107.1 agg / 129.9 router / 143.6 peak (2.06×) 216.0 GiB
Full 744B GLM-5.3 4-bit (512 GB) 48–58 / 27 52.7 / 58.3 / 61.8–62.2 tok/s 41.5–43.3 agg / 55.2 peak (1.81×) 407.9 GiB

Full build guide & launch recipes: BOTDEV.md

v26.11.4-botdev.4 — Bit-Exact JSON-Schema Spec Decode, GLM-5.3 Zero-Barrier vqmv & DSpark Overlap

Choose a tag to compare

@jeberly jeberly released this 29 Nov 22:10

Bit-exact greedy speculative decoding under JSON grammar (response_format: json_schema / json_object, including unbounded <think> → JSON reasoning spans), hybrid zero-barrier vqmv verify kernels for GLM-5.3, and async draft-ahead overlap / GPU-queued drafting for DeepSeek-V4.1 — all verified at 0 bit diffs against 1-row serial decode.

Verified Mac Studio M5 Ultra Results

Model / Pack Hardware JSON-Schema Spec (0 diffs) Concurrent Batched Spec (N=2 / N=3 / N=4) Peak Wired
Full 744B GLM-5.3 (4-bit) 512 GB M5 Ultra 43.3 tok/s agg (1.43× serial; 45–46.4 strict, 55.2 json_object 1.81×) 52.7 / 58.3 / 61.8 tok/s (0 diffs; solo ddalcu#2/+7%, ddalcu#3/+16%) 407.9 GiB
DeepSeek-V4.1-Flash twig Hybrid 256 GB M5 Ultra 105.5 tok/s agg (1.56× serial incl. <think>; 112–119 strict, 143.2 json_object 2.06×) 123.3 / 162.7 / 167.7 tok/s (0 diffs; +5.9% at N=4 with overlap+queue) 214.4 GiB
DeepSeek-V4.1-Flash Lossless 512 GB M5 Ultra Supported (dspark constrained greedy) 102.6 / 146.2 / 153.6 tok/s (0 diffs) 300.8 GiB

What's New

  • Bit-exact greedy JSON-schema & <think> speculative decoding (src/engines/mlx/grammar/greedy.zig, src/engines/mlx/spec/dspark_constrained.zig): Admits clean greedy grammar-constrained requests on native draft stages across all HTTP API surfaces (chat_completions, responses, anthropic, ollama, cli, batch), truncating drafts against the JSON grammar automaton (and unbounded <think> reasoning boundaries) before verify, selecting exact constrained argmax via a GPU top-64 shortlist with full-mask fallback on misses, and rolling back on first mismatch (0 diffs vs serial, including SSE streaming and <think> → JSON hand-offs).
  • GLM-5.3 hybrid zero-barrier vqmv verify kernels (src/plugins/glm_moe_dsa/): Dispatches K <= 4 to zero-barrier streaming L1 glm_dec_qmv2_l1_slice_h (cutting 78-layer qkv+o verify from 25.4 → 9.9 ms at R=3 and 17.9 → 10.8 ms at R=4) and K > 4 to double-buffered direct-u4 TG SRAM (NB <= 8, 18.6 ms at R=8), with R=2..16 self-check coverage and GLM-5.3 absent/unknown effort defaulting to high (thinking-off to low).
  • DeepSeek-V4.1 async draft-ahead overlap & GPU-queued drafting (--dspark-overlap, --dspark-queue 0.65): Wires real dsparkPrefetch overlap and dsparkRoundQueued (chaining speculative full-accept commit + next draft behind asyncEval(am32) with exact state save/restore on partial accept), cutting GPU wait by ~28% (8.29 → 5.98 ms) and lifting twig N=4 from 158.4 → 167.7 tok/s (+5.9%) and N=1 copy by +10.7%.
  • scripts/serve-twig.sh: Enables --dspark-overlap --dspark-queue 0.65 on the 256 GB profile by default.

v26.11.4-botdev.3 — Bit-Exact Batched Speculative Decoding (N=2..4)

Choose a tag to compare

@jeberly jeberly released this 29 Nov 06:05

Bit-exact batched speculative decoding across N=2..4 concurrent streams on both flagship models — one unified ReleaseFast binary, 0 bit diffs against 1-row serial decode across greedy, mid-stream join/leave, cancel, and seeded stochastic runs.

Verified Mac Studio M5 Ultra Results

Model / Pack Hardware Solo Decode Concurrent Batched Spec (N=2 / N=3 / N=4) Peak Wired
Full 744B GLM-5.3 (4-bit) 512 GB M5 Ultra 47–49 tok/s (57.9 code; 27 plain) 53.4 / 59.5 / 62.2 tok/s (0 diffs; +17% to +24% vs plain batched) 407.8 GiB
DeepSeek-V4.1-Flash Lossless 512 GB M5 Ultra 136–167 code/edit (61 plain) 102.6 / 146.2 / 153.6 tok/s (0 diffs; +14% to +34% vs plain batched) 300.8 GiB
DeepSeek-V4.1-Flash twig Hybrid 256 GB M5 Ultra 149–187 code/edit (70 plain) 123.4 / 161.5 / 163.6 tok/s (0 diffs; +31% to +53% vs plain batched) 216.2 GiB

What's New

  • GLM-5.3 (glm_moe_dsa): Bit-exact batched speculative decoding (batched_spec=on for N=2..4), vec<T,4> threadgroup SRAM verify kernels avoiding Apple GPU's 16 KiB occupancy cliff (-20.5 ms on R=8 qkv+o), R=2..16 dual-64-bit ballot MoE dedup, batched depth-by-depth MTP draftBatch sharing lm_head and MTP MoE across active slots, confidence-gated bonus verify rows (R <= 10, cum_p >= 0.94), and position-keyed RNG parity for seeded sampling (temp > 0).
  • DeepSeek-V4.1 (deepseek_v41): --exact-group-verify for bit-exact concurrent DSpark drafting + verification up to R=16, fused batched stage drafting (stageInputFused / stageAttention / stageMoeFused + slim tiled draft in_proj), 128-bit ballot --dec-hyb-dedup lifted to R=2..16 (register-chunked shared expert + colliding hot MXFP4 dedup), true-round draft_ms group pricing + GroupCost compile-spike guard, and startup R=2..16 pre-warming under --dspark-warm.
  • scripts/serve-twig.sh: Enables --exact-group-verify (both 256 GB and 512 GB profiles) and --dec-hyb-dedup on the 256 GB profile by default.