Skip to content

TandemEngine 0.20.0

Latest

Choose a tag to compare

@0xBakeer 0xBakeer released this 04 Dec 22:25
· 1 commit to main since this release

TandemEngine v0.20.0 and TandemApp v0.16.5: Qwen4-35B-A3B and MiniCPM5-15B-A2.5B speedups on one DGX Spark

TandemEngine v0.20.0 adds full support for Qwen4-35B-A3B (40-layer hybrid GDN/QSA sparse MoE, 4-stream Hyper-Connections, layer-1 n-gram PLE, bundled 27-layer FP32 vision tower, and causal DFlash2 drafting) alongside SM121a prefill and decode optimizations across both Qwen4-35B-A3B and OpenBMB's MiniCPM5-15B-A2.5B on one NVIDIA DGX Spark (GB10, sm_121a). It also adds Constraint(ban_in_think=...) for forced tool calls inside open <think> blocks, canonical tool-eval-bench and long-context measurement files under models/<id>/measurements/, and optional tool_eval schema validation for Setup Guide cards in TandemApp v0.16.5.

Installing or upgrading

  • Run the v0.20.0 installer on a DGX Spark: curl -fsSLO https://raw.githubusercontent.com/TandemLLM/TandemEngine/v0.20.0/install.sh && bash install.sh --setup --yes.
  • Switch a running box to Qwen4-35B-A3B (qwen4-35b-a3b-nvfp4, fetches RadixArk/Qwen4-35B-A3B-Dflash2 automatically with no Hugging Face token): bash ~/TandemLLM/run/ops/use-profile.sh qwen4-35b-a3b-nvfp4.
  • Switch or keep MiniCPM5-15B-A2.5B (minicpm5-15b-a2.5b-nvfp4, fetches openbmb/MiniCPM5-15B-A2.5B-DSpark automatically): bash ~/TandemLLM/run/ops/use-profile.sh minicpm5-15b-a2.5b-nvfp4.
  • Both models also appear in TandemApp v0.16.5's Setup Guide with served speed rows and tool_eval scores.

Qwen4-35B-A3B on one DGX Spark

Qwen4-35B-A3B cold HTTP prefill and 8-lane decode on one DGX Spark

engine/models/qwen4_moe (docs/qwen4-35b-a3b.md) serves RadixArk/Qwen4-35B-A3B-NVFP4 (46.92 GB) and the causal DFlash2 drafter checkpoint (0.79 GB, fetched automatically from Hugging Face) across up to 8 concurrent 262,144-token lanes in 59.46 GiB allocated GPU memory (60.68 GiB reserved, leaving about 53.26 GiB free; 17.03 s cold load). Load-time CUDA self_check passes all 35 cases across rows 1 to 32 plus the sparse QSA boundary (L=2,060) with first difference None, and DFlash2 matches plain greedy decode with 0 diffs out of 128 tokens.

Measured against the live 8-lane qwen4-35b-a3b-nvfp4 server (tools/parallel_card.py, --max-len 262144, --vision on, X-Tandem: raw, cache_prompt: false, suffix store off, response cache off, thinking off, card-prompts-v1.json, 256 output tokens, 3-run medians, 0 errors):

context prompt tokens TTFT cold prefill tok/s vs initial bring-up
2k 2,044 0.39 s 5,179 (5,406 warm) +27.8 %
8k 8,190 1.55 s 5,282 +42.0 %
32k 32,763 6.36 s 5,148 +52.8 %
64k 65,536 13.00 to 13.31 s 4,925 to 5,041 +61.5 to +65.3 %
128k 131,072 26.93 to 27.68 s 4,735 to 4,868 +72.6 to +77.5 % (-20.9 s)
248k 248,000 56.86 to 57.75 s 4,294 to 4,361 new full-window run
  • Served card-v1 greedy decode reaches 99.4 tok/s on code (peak 110.7, +20.6 % vs initial bring-up), 60.0 tok/s solo prose (C1 53.6), and 77.9 / 121.3 / 178.5 tok/s (75.5 / 115.9 / 166.8 wall, +44.8 % at 8 streams) across 2 / 4 / 8 concurrent prose streams (at_once == N verified via /health). Sampled decode (T=0.7, top_k=20, top_p=0.95) reaches 92.9 tok/s code and 50.9 / 76.4 / 117.7 / 173.3 tok/s across 1 / 2 / 4 / 8 streams.
  • Served long-context greedy decode holds 48.1 tok/s at 32k, 47.0 tok/s at 64k, and 44.7 tok/s at 128k (under 7 % drop across 4x context).
  • Key kernels: blocked-16×16 bf16x3-state Triton GDN WY prefill, fused SM121a BF16 Tensor Core QSA block scoring with 2-pass radix top-512 and adaptive L2-split block-4 Triton FlashAttention, zero-SMEM __ldg NVFP4 MoE decode with FlashInfer grouped prefill, native BF16 Hyper-Connection mixers (KL 0.02084 / 96.88 % top-1 vs unmodified NVFP4 BF16-dense), batched 8-lane fast_commit (2.17 ms), fused SM121a DFlash2 (3.00 ms B=1, 4.52 ms packed B=8, 0.0 max prob diff vs PyTorch), FP32 ViT with TF32 off (0 NaNs), and per-request StairCut carryover damping across slot 0 and side slots.

MiniCPM5-15B-A2.5B SM121a speedups

MiniCPM5-15B-A2.5B SM121a prefill and 8-lane decode speedups on one DGX Spark

Custom SM121a kernels in engine/models/minicpm5_moe (docs/minicpm5-15b-a2.5b.md) eliminate the long-context prefill drop-off and lift single-stream and 8-lane decode while preserving all 67/67 bit-exact CUDA self_check cases, 0/128 DSpark greedy diffs, and strictly lower KL vs BF16 than v0.19.0 (0.06295 vs 0.06666 on the apples-to-apples 3-domain 96-position evaluation set). Cold weight load drops from 7.6 s to 3.42 s (2.2x faster), and 8 lanes at 262,144 tokens fit in 14.54 GiB allocated (15.59 GiB reserved, leaving about 99.6 GiB free).

Measured against live minicpm5-15b-a2.5b-nvfp4 (tools/parallel_card.py, 8 lanes, 262k window, X-Tandem: raw, cache_prompt: false, 3-run medians, 155 of 155 requests OK):

workload v0.19.0 v0.20.0 gain
cold prefill 8k / 32k 8,491 / 5,784 tok/s 9,468 / 7,432 tok/s +11.5 % / +28.5 %
cold prefill 64k / 128k 3,772 / 2,258 tok/s 5,418 / 3,383 tok/s +43.6 % / +49.8 % (-19.3 s)
cold prefill 248k - 1,973 tok/s (128.7 s, 88.7 GiB free) verified full window
solo code decode (greedy / sampled) 146.0 / 134.3 tok/s 164.5 / 163.6 tok/s (pk 185.1) +12.7 % / +21.8 %
solo prose decode (C1 greedy) 90.4 tok/s 110.0 tok/s (105.8 solo) +21.7 %
2 / 4 / 8 concurrent prose (greedy) 132.6 / 190.7 / 263.7 tok/s 157.6 / 226.5 / 336.8 tok/s (307.4 wall) +18.9 % / +18.8 % / +27.7 %
8 concurrent prose (sampled) 255.7 tok/s 319.9 tok/s (293.7 wall) +25.1 %
  • Steady long-context greedy decode reaches 76.1 tok/s at 32k, 49.1 tok/s at 64k, and 35.6 tok/s at 128k (93 to 98 % of GB10 DRAM plain floor).
  • Key kernels: 24 KiB SMEM (occ=3) SM121a FP8 MMA causal 16:1 GQA FlashAttention for long chunks with FlashInfer HND FA2 tail dispatch (T < 192), fused qkv + q_gate reusing FP8 activations from add_rms_cuda, progressive split-K (24..248) decode GQA, fused E=161, k=17 zero-SMEM __ldg NVFP4 MoE decode with cached FP8 prefill shared experts, batched FP8 Cauchy-Schwarz DSpark Markov pruning, and calibrated marginal confidence-head inputs for StairCut with short-context skip reset.

Memory headroom, tool calling, verification, and TandemApp v0.16.5

8-lane memory headroom, flat long-context decode, fidelity, and tool-eval-bench

  • Constraint(ban_in_think=...) (engine/grammar.py, server/app.py): model-neutral mask active only while <think> is open under a constrained output or tool_choice="required", banning EOS tokens and single-token opening tool-call markers until </think> closes so required tool calls cannot emit inside an unclosed reasoning block (TC-45).
  • Canonical structured measurements: raw parallel-*, 2026-12-04-long-context.json, and 2026-12-04-tool-eval-bench.json files live under models/minicpm5-15b-a2.5b/measurements/ and models/qwen4-35b-a3b/measurements/, indexed in docs/tool-eval-bench.md.
  • Independent stress certification passed for both models with 0 HTTP 5xx, 0 errors, 0 CUDA IMAs, 0 ViT NaNs, and 0 KV pool reclaims: Qwen4-35B-A3B (fb6c5b1f, 499 HTTP requests, 128k NIAH exact recall at 4,794.6 tok/s prefill / 44.6 tok/s decode, 37-scenario 15-category tool-eval-bench subset 96/100 71/74 pts, TC-45 2/2) and MiniCPM5-15B-A2.5B (5b29c7ba, 270 served requests up to 205k context, 69-scenario baseline tool-eval-bench 89/100 121/136 pts, 5/5 DFA-cap retest, and 33-scenario stress subset 97/100 64/66 pts).
  • TandemApp v0.16.5 registers the Qwen4-35B-A3B Setup Guide model card, refreshes MiniCPM5-15B-A2.5B measurements, and surfaces optional tool_eval scores next to KL on weight cards and in the measured table (hidden automatically on older engines).

Known limits

  • Qwen4-35B-A3B tool-eval-bench covers 37 scenarios across all 15 categories A to O (--parallel 4) plus targeted TC-45 (--parallel 1); the remaining 32 scenarios at --parallel 1 and official BF16/FP8 checkpoint benchmarks are not run yet.
  • MiniCPM5-15B-A2.5B served multi-lane tools/parallel_card.py tables for mxfp8 and bf16, a fresh full 69-scenario tool-eval-bench run on 5b29c7ba (beyond the 33-scenario stress subset), and context past 262,144 tokens are not run yet.

Full details live in CHANGELOG.md, docs/qwen4-35b-a3b.md, docs/minicpm5-15b-a2.5b.md, docs/tool-eval-bench.md, and TandemApp v0.16.5.