加载中…
加载中…
zai-org/GLM-5.3-Flashdflash2ESuperseded (2026-09-24) by
canada-quant/GLM-5.3-Flash-DFlash2-F, and on 2026-09-25 bycanada-quant/GLM-5.3-Flash-DFlash2-G(current) — same architecture and serve contract (drop-in: change the path, keepnum_speculative_tokens: 7). Same 8× B300, same protocol:-G3.676 /-F3.626 / this drafter 3.561 mean acceptance at K=7 vs the incoai reference's 3.632. This repo stays up unchanged as the record behind the numbers below and the Spark A/B of 2026-09-15/16.
Self-trained DFlash2 block-diffusion speculative-decoding drafter for GLM-5.3-Flash, trained against our INT4 quant canada-quant/GLM-5.3-Flash-W4A16-MTP. Trained from scratch on self-generated data — no third-party drafter weights or traces anywhere in the training path — and adopted on 2026-09-15 as the authors' serving drafter-of-record on their 2× DGX Spark (SM121) stack, superseding our previous best dflash2DF2 (owner ruling; the swap is verified and the stack serves continuously since).
| Field | Value |
|---|---|
| Type | DFlash2 block-diffusion drafter (DFlash2DraftModel, Qwen3-style backbone) |
| Layers | 8 decoder layers, full attention (no sliding window) |
| Hidden / heads | 4096 (intermediate 12288) · 32 attention heads / 8 KV heads · head_dim 128 |
| Target taps | 9 hidden-state taps at target layers [5, 9, 14, 19, 24, 28, 33, 38, 42] |
| Block size | 8 → K = 7 speculative tokens (num_speculative_tokens: 7) |
| Selector | rank 256, top_k 16, grouped dynamic conv (kernel 2, group 16) — selector + conv are trained, not vestigial (verified 2026-09-16 against the shipped checkpoint: 3 selector + 32 conv tensors) |
| Mask embedding | learnable, shipped as mask_embedding.pt (mask_token_id 154856) |
| Size | ~1.84B drafter parameters · 6.2 GB bf16 checkpoint (ships untied embed_tokens + lm_head for standalone loading) |
| Max positions | 1,048,576 |
dflash2DF2 (L8T9 lineage, third refinement round).selfgen_v13), 35,021 steps, lr 1e-4.PROVENANCE.txt in this repo is the verbatim training record (run name, warm-start source, data, steps, eval numbers).500 never-trained-on prompts, thinking ON, T=1.0 / top_p 0.95, max_tokens 1024, greedy drafts, H200 TP=4 (concurrency 16; the c1 row is 100 prompts at concurrency 1):
| Metric (acceptance length / output tok/s) | K=7, c16 | K=4, c16 | K=7, c1 |
|---|---|---|---|
dflash2E (this) |
3.568 / 1277.5 | 3.067 / 1250.4 | 3.585 / 267.2 |
| incoai reference (same protocol) | 3.602 | 3.123 | — |
Per-position acceptance (K=7, c16): 0.744 · 0.545 · 0.405 · 0.306 · 0.237 · 0.185 · 0.147.
Prebuilt vLLM image + one-command launcher: canada-quant/vllm-glm53-flash-sm121 (docker pull ghcr.io/canada-quant/vllm-glm53-flash-sm121:v2-w4a16-dflash2e). The drafter is bind-mounted at runtime — swap drafters without a rebuild; K follows the drafter's block size (E: block 8 → num_speculative_tokens=7, the trained value).
All three drafters measured on the same rig within ~10 hours, same 500-prompt holdout family, same W4A16 target:
| Cell (accept / tok/s) | dflash2DF2 (our previous best) |
dflash2E (this) |
incoai reference |
|---|---|---|---|
| smoke 20×c1×512 | 3.9464 / 29.35 | 4.0137 / 29.78 | 4.0698 / 31.17 |
| c16 500×16×1024 (primary) | 3.5020 / 69.33 | 3.5788 / 70.87 | 3.6274 / 72.98 |
| c1 100×1×1024 | 3.5100 / 27.56 | 3.5970 / 28.12 | 3.5760 / 28.97 |
Honest read:
dflash2DF2): wins every cell — c16 +0.077 acceptance / +2.2% throughput; c1 +0.087 / +2.0%; smoke +0.067. This is why it was adopted.Pairs with canada-quant/GLM-5.3-Flash-W4A16-MTP (the quant it was trained against) or BF16 GLM-5.3-Flash. vLLM speculative config:
{"method": "dflash", "model": "/models/GLM-5.3-Flash-DFlash2-E", "num_speculative_tokens": 7}
Ready-to-run recipe: launch_dflash2_tp2.sh ships in this repo — the complete TP=2 DGX-Spark serving launcher (defaults to the W4A16 target + this drafter; GRAPHS/EAGER knobs, DRAFTER_HOST_PATH override to serve any other DFlash2 drafter).
Hard constraints (all measured, not stylistic):
num_speculative_tokens: 7 (= block_size − 1) is the trained and measured value. k=5 also boots on the SM121 image (2026-09-26, not
benchmarked); an earlier version of this card said other counts boot-wedge the stack, which was wrong.mask_embedding.pt must sit next to the weights. Verify the boot log carries Loaded DFlash mask embedding for mask_token_id 154856 from mask_embedding.pt — absence means the mask was silently ignored; do not serve.dflash_config.target_layer_ids of length 9 (upstream vLLM DFlash2 does — vllm-project/vllm#52816).FullAttentionSpec drafter KV in the GLM-5 KV fast path. The stock upstream DFlash2 image cannot boot this drafter; see the W4A16 card's SM121 serving section for the working stack (patched SM121 build, fabric tuning, launcher).Our serving configuration: 2× DGX Spark GB10, TP=2 + expert-parallel, 262K context, fp8_e4m3 KV cache, K=7 greedy drafts — left up and serving since 2026-09-15 (smoke 4.243 @ 31.2 tok/s, c1 3.617 @ 28.2 tok/s post-swap verification, zero stream errors). Serving state (updated 2026-09-16): the stack now runs the ruled graphs-ON g4 config — CUDA-graphs FULL_AND_PIECEWISE capture [1,2,4,8,16,24,32] + VLLM_USE_BREAKABLE_CUDAGRAPH=0, GMU=0.795, KV 8 GiB (pool 366,749 tokens); the flip boot re-verified all five production gates (pool discriminator, graphs live on both ranks, mask-loader line, zero-error smoke, zero engine faults). The DFlash2 speculator + selector walk the vLLM V2 GPU-worker path at serve time (confirmed 2026-09-16 from the boot bytes) — no V1-proposer silent-skip.
This drafter's 8 layers use full attention, so each keeps a KV cache for the whole context (same architecture as -F / -G); the incoai reference drafter keeps a
2,048-token sliding window. KV pools measured by the authors on 2× DGX Spark (fp8 KV):
| drafter | KV pin | max model len | KV pool | date |
|---|---|---|---|---|
| incoai reference | 9 GiB | 1,048,576 | 1,360,420 tokens (≈7.1 KB/token) | 2026-08-31 |
-E / -G |
8 GiB | 262,144 | 366,749 tokens (≈22 KB/token) | 2026-09-16 |
-G |
16 GiB | 800,000 | 888,729 tokens (≈19 KB/token) | 2026-09-26 |
That is about 3× less context per GiB of KV. A 9 GiB pin holds ≈450K tokens with -E / -F / -G — less than one 1M request — so
1M context on 2× Spark is validated only with the incoai drafter; with our drafters the validated contexts are 262K (8 GiB) and 800K
(16 GiB).
{"method":"mtp","num_speculative_tokens":3}) for long
context, non-English text, or KV headroom.-G, 2× Spark, our SM121 image, single stream, llama-benchy pp2048/tg128): 31.4 / 30.7 / 15.3 / 10.0
tok/s at context depth 0 / 4K / 65K / 100K (2026-09-28; the 100K cell from 2026-09-26).-G usable context fell
from ≈930K to ≈330K tokens and decode was 20–30% slower on non-English text (faster on English code).canada-quant/vllm-glm53-flash-sm121.model.safetensors (sha256 af0d8d16f01f…), config.json (699bdf29…), mask_embedding.pt (2474994c…), PROVENANCE.txt (verbatim record).This card was assembled from sha-pinned banked measurement artifacts; reviewed by a human (the maintainer) before publication.