GLM-4.7-Flash Β· FP8 (dynamic)

8-bit quantization of zai-org/GLM-4.7-Flash for vLLM serving. Quantized by axteam.

Base model zai-org/GLM-4.7-Flash
Method FP8 (dynamic)
Format compressed-tensors float-quantized (scheme FP8_DYNAMIC)
Weights / activations W8A8 β€” FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations
Architecture MoE (GLM-4.7 Lite Β· Glm4MoeLite) Β· 31.2B Β· 202K context Β· text-only
Size on disk ~32.2 GB
Calibration None (data-free)
License mit

Quantization details

  • Scheme β€” W8A8 β€” FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations, stored as compressed-tensors float-quantized (scheme FP8_DYNAMIC).
  • Kept in BF16 β€” token embeddings, the LM head, and all RMSNorms. Only attention & MLP projections are quantized. In addition, the MoE router (mlp.gate, incl. e_score_correction_bias) is kept in BF16. The MTP layer (model.layers.47: eh_proj, shared_head.head) is quantized like the other layers.
  • Post-training quantization (no retraining). Tokenizer / chat_template identical to the original.

Usage (vLLM)

Start an OpenAI-compatible server:

vllm serve axteam/GLM-4.7-Flash-FP8-dynamic --max-model-len 32768

Query it:

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "axteam/GLM-4.7-Flash-FP8-dynamic",
  "messages": [{"role": "user", "content": "λŒ€ν•œλ―Όκ΅­μ˜ μˆ˜λ„λŠ” μ–΄λ””μΈκ°€μš”?"}],
  "temperature": 1.0, "max_tokens": 512
}'

Offline inference in Python:

from vllm import LLM, SamplingParams

llm = LLM(model="axteam/GLM-4.7-Flash-FP8-dynamic", max_model_len=32768)
params = SamplingParams(temperature=1.0, max_tokens=1024)
out = llm.chat([{"role": "user", "content": "Explain model quantization in two sentences."}], params)
print(out[0].outputs[0].text)

Recommended sampling (from the original generation_config.json): temperature=1.0. Thinking mode is on by default in the chat template; to turn it off pass chat_template_kwargs={"enable_thinking": False} (Python llm.chat(..., chat_template_kwargs=...), or "chat_template_kwargs": {"enable_thinking": false} in the request body).

Reducing KV-cache memory (optional, serve-time)

The KV cache is kept in BF16 by default. KV-cache precision is a runtime choice, independent of the weight quantization above; for long contexts or large batches FP8 roughly halves KV-cache memory:

vllm serve axteam/GLM-4.7-Flash-FP8-dynamic --kv-cache-dtype fp8

License

Quantized derivative of zai-org/GLM-4.7-Flash (mit).


ν•œκ΅­μ–΄ μš”μ•½

zai-org/GLM-4.7-Flash λ₯Ό FP8 (dynamic) 둜 μ–‘μžν™”ν•œ μ„œλΉ™μš©(8-bit) λͺ¨λΈμž…λ‹ˆλ‹€. μž‘μ„±: axteam.

  • 방식 β€” FP8 E4M3, κ°€μ€‘μΉ˜ 채널별 μŠ€μΌ€μΌ, ν™œμ„±ν™” 동적 FP8. ν˜•μ‹ compressed-tensors float-quantized (scheme FP8_DYNAMIC).
  • BF16 μœ μ§€ β€” μž„λ² λ”©Β·LM ν—€λ“œΒ·λͺ¨λ“  norm. attentionΒ·MLP projection 만 μ–‘μžν™”. μΆ”κ°€λ‘œ MoE λΌμš°ν„°(mlp.gate, e_score_correction_bias 포함)도 BF16 μœ μ§€. MTP μΈ΅(model.layers.47 의 eh_projΒ·shared_head.head)은 λ‹€λ₯Έ 측처럼 μ–‘μžν™”λ¨.
  • PTQ(μž¬ν•™μŠ΅ μ—†μŒ), ν† ν¬λ‚˜μ΄μ €Β·chat_template 원본 동일.
  • μ‹€ν–‰ β€” vllm serve axteam/GLM-4.7-Flash-FP8-dynamic --max-model-len 32768 둜 OpenAI ν˜Έν™˜ μ„œλ²„(포트 8000), λ˜λŠ” Python LLM(model="axteam/GLM-4.7-Flash-FP8-dynamic").chat(...) (μœ„ μ˜ˆμ‹œ). ꢌμž₯ μƒ˜ν”Œλ§ temperature=1.0. thinking 끄기: chat_template_kwargs={"enable_thinking": False}.
  • KV μΊμ‹œ 절감(λŸ°νƒ€μž„) β€” --kv-cache-dtype fp8.
Downloads last month
-
Safetensors
Model size
31B params
Tensor type
F32
Β·
BF16
Β·
F8_E4M3
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for axteam/GLM-4.7-Flash-FP8-dynamic

Quantized
(111)
this model