Views
No views yet
zai-org/GLM-5.2-FP8 base model, enabling faster
inference through speculative decoding. DSpark extends the DFlash parallel draft
backbone with two lightweight heads: a Markov logit-bias head (low-rank
intra-block token dependency) and a per-position confidence head (accept-rate
prediction). Trained with the speculators
library.main is the final epoch-3 checkpoint (best validation)./chat/completions)block_size=8, full vocabulary (154,880), aux layers [8, 23, 39, 55, 70]main = the final (epoch-3) checkpoint;
each epoch is also a permanent revision.| revision | epoch | status |
|---|---|---|
epoch-1 | 1 / 3 | ✅ available |
epoch-2 | 2 / 3 | ✅ available |
epoch-3 | 3 / 3 | ✅ final (= main) |
1from transformers import AutoModel
2model = AutoModel.from_pretrained(
3 "RedHatAI/GLM-5.2-speculator.dspark", trust_remote_code=True # or revision="epoch-3"
4)| metric | value |
|---|---|
| mean accepted length | 3.967 |
| full accuracy | 0.613 |
| mean acceptance rate | 0.584 |
| confidence abs error | 0.044 |
0.829 / 0.723 / 0.646 / 0.587 / 0.539 / 0.500 / 0.464Magpie-Align/Magpie-Llama-3.1-Pro-300K-Filtered and HuggingFaceH4/ultrachat_200k,
with responses regenerated by GLM-5.2-FP8 itself (published as
mgoin/GLM-5.2-FP8-magpie-ultrachat).1python scripts/prepare_data.py \
2 --model zai-org/GLM-5.2-FP8 \
3 --trust-remote-code \
4 --data ./regenerated_data.jsonl \
5 --output ./output \
6 --seq-length 8192 \
7 --assistant-pattern '<\|assistant\|>((?:(?!<\|user\|>|<\|assistant\|>).)*)'--assistant-patternis currently needed for GLM-5.2's inline-reasoning chat format (the<think>...</think>trace is kept inside the assistant turn); it may be auto-detected by future speculators versions.
1CUDA_VISIBLE_DEVICES=0,1,2,3 python scripts/launch_vllm.py \
2 zai-org/GLM-5.2-FP8 \
3 --target-layer-ids 8 23 39 55 70 \
4 -- --port 8000 \
5 --tensor-parallel-size 4 \
6 --gpu-memory-utilization 0.9 \
7 --max-model-len 8192 \
8 --trust-remote-code1CUDA_VISIBLE_DEVICES=4,5,6,7 torchrun \
2 --standalone \
3 --nproc_per_node 4 \
4 scripts/train.py \
5 --verifier-name-or-path zai-org/GLM-5.2-FP8 \
6 --speculator-type dspark \
7 --num-layers 5 \
8 --block-size 8 \
9 --data-path ./output \
10 --vllm-endpoint http://localhost:8000/v1 \
11 --save-path ./output/checkpoints \
12 --epochs 3 \
13 --lr 0.0006 \
14 --scheduler-type cosine \
15 --total-seq-len 4096 \
16 --draft-arch qwen3 \
17 --draft-hidden-act silu \
18 --target-layer-ids 8 23 39 55 70 \
19 --max-anchors 1024 \
20 --markov-rank 256 \
21 --enable-confidence-head \
22 --confidence-head-with-markov \
23 --loss-fn '{"ce": 0.1, "tv": 0.9}' \
24 --confidence-head-alpha 1.0 \
25 --checkpoint-freq 0.2 \
26 --on-missing generate \
27 --on-generate delete \
28 --seed 42 \
29 --log-freq 100 \
30 --prefetch-factor 2 \
31 --num-workers 8 \
32 --trust-remote-code--draft-vocab-size trains on the full vocabulary; pass
--draft-vocab-size 32000 for a reduced draft vocab.--markov-rank, --enable-confidence-head,
--confidence-head-with-markov, --confidence-head-alpha. Dropping them (and
using --speculator-type dflash) recovers a plain DFlash draft.1vllm serve zai-org/GLM-5.2-FP8 \
2 --tensor-parallel-size 4 \
3 --max-model-len 16384 \
4 --trust-remote-code \
5 --speculative-config '{
6 "model": "RedHatAI/GLM-5.2-speculator.dspark",
7 "num_speculative_tokens": 7,
8 "method": "dspark"
9 }'