Skip to content

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

Latest

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.