DeepSeek V4.1 Flash on M3 Ultra nearly doubles decode to 31 t/s with first public DSpark Metal port
IngeniousIdiocy · reddit · 2026-09-15
A developer forked antirez/ds4 and built the first public DSpark Apple Metal implementation for DeepSeek V4.1 Flash (Q4) on a 512GB M3 Ultra, sustaining a real 91-minute agent turn: 101k tokens decoded, 4.6M prefilled at 99.5% cache hit, 56 tool calls with zero mistakes.
vs upstream ds4 (same machine, Q4): decode 8k ctx 16.6→31.3 t/s; 300k ctx 14.0→28.3 t/s; prefill 62k 737→813 t/s; disk KV cache restore 0.23s vs 31s cold; DSpark speculative decode 40.5 t/s on code, 41.3 t/s on agent turns.
Key techniques: decode is bandwidth-bound (14GB weights/token, 50 t/s ceiling) with hundreds of small dispatches as the bottleneck — layers merged into one command buffer, 384-expert router as one dispatch, fused shared-expert kernels, 770 re-round dispatches removed. The compressed-attention 512-block selection chain caused 98% of long-context slowdown; layers now score only admitted blocks with bounded radix select, so 300k decodes at 90% of the 8k rate. Prefill gained only 10% (compute-bound; Metal GEMM at 23-24 TFLOPS). DSpark shares one weight stream across 6 verify rows (177→112ms/block, 213→337GB/s) with exact speculative sampling at temperature >0. Output is byte-identical to upstream under greedy decode, with SHA-256 manifests to reproduce.
More from coding & agent
- Tencent unveils Hyra 2.0, a research agent that builds reusable scientific tools — TencentHunyuan · 2026-11-02
- What broke when I ran a leaderless agent swarm with no orchestrator — 7 failure modes and fixes — LostHumanity67 · 2026-11-02
- Forced yes/no prompts push GPT and Claude to 95%+ confidence on Goldbach's unproved halt test — Nir777 · 2026-11-02
- Automation took over my daily work — so why am I still sitting in the office for 8 hours? — Am1rSori · 2026-11-02
- General Reasoning explains how to train agent swarms with RL and latency pressure — rosstaylor90 · 2026-11-02
- "Coding isn't the bottleneck anymore — usage windows are," says founder Kyle Gawley — kylegawley · 2026-11-02