Views
No views yet
weight_block_size: [128, 128], dynamic activation scaling), which dramatically reduces memory footprint and enables fast inference on FP8-capable hardware while retaining BF16-level quality on the non-quantized layers.| Architecture | GlmMoeDsaForCausalLM (Mixture-of-Experts with Deep Sparse Attention) |
| Total parameters | ~754B |
| Active parameters per token | ~39B |
| Hidden layers | 78 |
| Quantization | FP8 (block-FP8, weight_block_size: [128, 128], dynamic activation) |
| Non-quantized layers | BF16 / F32 (norms, embeddings, router biases, attention projections) |
| Tensor types | F32, BF16, F8_E4M3 |
| License | MIT (inherited from base model) |
| Recommended runtime | transformers >= 5.12 or vLLM with FP8 support |
reasoning_effort=high, temperature 1.0, top_p 0.95. The "GLM-5.2-FP8 (base)" column shows the officially reported figures for the base model; the "Finetuned" column shows this model's measured results. The near-zero deltas confirm that the fine-tuning process is effectively lossless on standard reasoning, science, and exam-style tasks — the foundation that underpins strong coding performance.| Benchmark | GLM-5.2-FP8 (base, reported) | Finetuned (measured) | Delta |
|---|---|---|---|
| AIME 2026 (n=30) | 99.2 | 99.2 | 0.0 |
| GPQA-Diamond (n=198) | 91.2 | 91.0 | -0.2 |
| HLE (n=150) | 40.5 | 40.8 | +0.3 |
Note on coding evaluation: The benchmarks above measure general reasoning, science, and exam competence, which correlate strongly with coding ability. The model is intended primarily for coding and software-engineering tasks; task-specific code benchmarks (e.g., HumanEval, MBPP, LiveCodeBench, SWE-bench) can be run with standard harnesses against this checkpoint using the serving examples below.
transformers >= 5.12 (for tp_plan="auto" and glm_moe_dsa support).1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4MODEL_ID = "jelegend/GLM-5.2-FP8-Finetuned"
5
6model = AutoModelForCausalLM.from_pretrained(
7 MODEL_ID,
8 dtype="auto",
9 tp_plan="auto",
10 trust_remote_code=True,
11 experts_implementation="grouped_mm",
12)
13tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
14
15# --- Fast, direct answer (thinking OFF) ---
16prompt = tokenizer.apply_chat_template(
17 [{"role": "user", "content": "Refactor this Python function to be async and add type hints:\n\ndef fetch_all(urls):\n return [requests.get(u).json() for u in urls]"}],
18 tokenize=False,
19 add_generation_prompt=True,
20 enable_thinking=False,
21)
22inputs = tokenizer([prompt], return_tensors="pt").to("cuda")
23out = model.generate(**inputs, max_new_tokens=1024, do_sample=False,
24 pad_token_id=tokenizer.pad_token_id)
25print(tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
26
27# --- With explicit chain-of-thought reasoning (thinking ON) ---
28prompt = tokenizer.apply_chat_template(
29 [{"role": "user", "content": "Find the off-by-one bug in this binary search and explain your reasoning."}],
30 tokenize=False,
31 add_generation_prompt=True,
32 enable_thinking=True,
33 reasoning_effort="high",
34)1vllm serve jelegend/GLM-5.2-FP8-Finetuned \
2 --tensor-parallel-size 8 \
3 --kv-cache-dtype fp8 \
4 --max-model-len 256000 \
5 --trust-remote-code/v1/models.scale_fmt: float). Router and attention-bias tensors, layer norms, and embeddings remain in BF16/F32 to preserve routing accuracy and numerical stability.--tensor-parallel-size) sized to your GPU count.TRANSFORMERS_DISABLE_DEEPGEMM_LINEAR=1 (transformers) as a workaround.--kv-cache-dtype fp8 in vLLM) is recommended to maximize usable context within VRAM.LICENSE file for full text.zai-org), released under the MIT license.