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.

Requirements

Runtime vLLM โ€” the architecture is in vLLM โ‰ฅ 0.15.0; tested here with vLLM 0.32.0.
vLLM install vLLM 0.32 itself needs Python 3.11โ€“3.14, torch 2.13 (CUDA 13.0 build, so an NVIDIA driver with CUDA 13 support), transformers โ‰ฅ5.16.1,<5.20 and compressed-tensors 0.17.0 (both pinned by vLLM; 0.17.0 reads this checkpoint, which was saved with 0.19.0 โ€” do not upgrade it separately).
GPU NVIDIA Turing (sm75, e.g. T4) or newer. FP8 math runs on Ada / Hopper / Blackwell (sm89+); on Turing and Ampere vLLM switches to weight-only FP8 automatically. V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.)
Memory Weights: 32.2 GB. Add KV cache (grows with context length ร— concurrent requests) and a few GB for activations / CUDA graphs; use --tensor-parallel-size N when the weights do not fit one GPU.
Transformers (without vLLM) transformers>=5.15.0.
trust_remote_code not needed

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 (W8A8) ์–‘์žํ™” ๋นŒ๋“œ ยท ์ œ์ž‘ axteam

๊ฐœ์š”

ํ•ญ๋ชฉ ๋‚ด์šฉ
์›๋ณธ ๋ชจ๋ธ zai-org/GLM-4.7-Flash
์–‘์žํ™” ๋ฐฉ์‹ FP8 ๋™์  ์–‘์žํ™” (W8A8)
์ €์žฅ ํ˜•์‹ compressed-tensors float-quantized (scheme FP8_DYNAMIC)
๋ชจ๋ธ ๊ตฌ์กฐ MoE (GLM-4.7 Lite, Glm4MoeLite) ยท 31.2B ยท ์ปจํ…์ŠคํŠธ 202K ยท ํ…์ŠคํŠธ ์ „์šฉ
์šฉ๋Ÿ‰ 32.2 GB
๋ณด์ • ๋ฐ์ดํ„ฐ ์—†์Œ (๋ณด์ • ๋ฐ์ดํ„ฐ ๋ถˆํ•„์š”)

์–‘์žํ™” ์ƒ์„ธ

  • ๊ฐ€์ค‘์น˜: FP8(E4M3), ์ถœ๋ ฅ ์ฑ„๋„๋ณ„ ์Šค์ผ€์ผ
  • ํ™œ์„ฑํ™”: ์‹คํ–‰ ์‹œ ํ† ํฐ๋ณ„ ๋™์  FP8
  • ๋ฐฉ์‹: PTQ(ํ•™์Šต ํ›„ ์–‘์žํ™”, ์žฌํ•™์Šต ์—†์Œ) ยท ๊ฐ€์ค‘์น˜ ์Šค์ผ€์ผ์€ ๋ฏธ๋ฆฌ ๊ณ„์‚ฐ, ํ™œ์„ฑํ™” ์Šค์ผ€์ผ์€ ์‹คํ–‰ ์‹œ ํ† ํฐ๋งˆ๋‹ค ๊ณ„์‚ฐ
  • BF16 ์œ ์ง€: ํ† ํฐ ์ž„๋ฒ ๋”ฉยทLM ํ—ค๋“œยท๋ชจ๋“  RMSNormยทMoE ๋ผ์šฐํ„ฐ(mlp.gate, e_score_correction_bias ํฌํ•จ)
  • ์–‘์žํ™” ๋Œ€์ƒ: ์–ดํ…์…˜ยทMLP projection (MTP ์ธต model.layers.47๋„ ๋‹ค๋ฅธ ์ธต๊ณผ ๊ฐ™์ด ์–‘์žํ™”)
  • ์›๋ณธ๊ณผ ๋™์ผ: ํ† ํฌ๋‚˜์ด์ €ยทchat templateยทgeneration config

ํ’ˆ์งˆ (์‹ค์ธก)

  • ๋ฒค์น˜๋งˆํฌ ํ‰๊ท : 66.56 โ€” MMLUยทGSM8KยทARC-ChallengeยทWinograndeยทKMMLUยทHAE-RAE, lm-evaluation-harness(vLLM) (์›๋ณธ์€ ๋ฏธ์ธก์ •)

์š”๊ตฌ์‚ฌํ•ญ

  • ์‹คํ–‰ ์—”์ง„: vLLM 0.15.0 ์ด์ƒ โ€” vLLM 0.32.0์—์„œ ์‹ค์ธก
  • vLLM 0.32 ์„ค์น˜ ์กฐ๊ฑด: Python 3.11~3.14, torch 2.13(CUDA 13.0 ๋นŒ๋“œ โ€” CUDA 13 ์ง€์› ๋“œ๋ผ์ด๋ฒ„ ํ•„์š”), transformers 5.16.1 ์ด์ƒ 5.20 ๋ฏธ๋งŒ, compressed-tensors 0.17.0 (vLLM ๊ณ ์ • ๋ฒ„์ „์œผ๋กœ ์ด ์ฒดํฌํฌ์ธํŠธ ๋กœ๋“œ ๊ฐ€๋Šฅ, ๋ณ„๋„๋กœ ์˜ฌ๋ฆฌ์ง€ ๋ง ๊ฒƒ)
  • GPU: NVIDIA Turing(sm75, ์˜ˆ: T4) ์ด์ƒ โ€” FP8 ์—ฐ์‚ฐ์€ AdaยทHopperยทBlackwell(sm89 ์ด์ƒ)์—์„œ ์ˆ˜ํ–‰, ๊ทธ๋ณด๋‹ค ์˜ค๋ž˜๋œ GPU๋Š” vLLM์ด ๊ฐ€์ค‘์น˜ ์ „์šฉ FP8๋กœ ์ž๋™ ์ „ํ™˜. V100(sm70) ๋ฏธ์ง€์›
  • ๋ฉ”๋ชจ๋ฆฌ: ๊ฐ€์ค‘์น˜ 32.2 GB + KV ์บ์‹œ(์ปจํ…์ŠคํŠธ ๊ธธ์ด ร— ๋™์‹œ ์š”์ฒญ ์ˆ˜์— ๋น„๋ก€) + ํ™œ์„ฑํ™”ยทCUDA graph ์ˆ˜ GB โ€” ํ•œ ์žฅ์— ๋“ค์–ด๊ฐ€์ง€ ์•Š์œผ๋ฉด --tensor-parallel-size N
  • Transformers๋กœ ์ง์ ‘ ์‚ฌ์šฉ: transformers 5.15.0 ์ด์ƒ
  • trust_remote_code: ๋ถˆํ•„์š”

์‚ฌ์šฉ๋ฒ•

  • ์„œ๋ฒ„ ์‹คํ–‰: vllm serve axteam/GLM-4.7-Flash-FP8-dynamic --max-model-len 32768 โ€” OpenAI ํ˜ธํ™˜ API (๊ธฐ๋ณธ ํฌํŠธ 8000)
  • Python: LLM(model="axteam/GLM-4.7-Flash-FP8-dynamic").chat(...) โ€” ์ „์ฒด ์˜ˆ์‹œ๋Š” ์œ„ Usage ์ฐธ๊ณ 
  • ๊ถŒ์žฅ ์ƒ˜ํ”Œ๋ง: temperature=1.0
  • thinking ๋ชจ๋“œ: ๊ธฐ๋ณธ ์ผœ์ง โ€” ๋„๋ ค๋ฉด chat_template_kwargs={"enable_thinking": False}
  • KV ์บ์‹œ ์ ˆ๊ฐ(์„ ํƒ): --kv-cache-dtype fp8 โ€” ๊ธด ๋ฌธ๋งฅยท๋Œ€๋Ÿ‰ ์š”์ฒญ์—์„œ KV ๋ฉ”๋ชจ๋ฆฌ ์•ฝ ์ ˆ๋ฐ˜, ๊ฐ€์ค‘์น˜ ์–‘์žํ™”์™€ ๋ณ„๊ฐœ์ธ ์‹คํ–‰ ์˜ต์…˜

๋ผ์ด์„ ์Šค

  • ๋ผ์ด์„ ์Šค: MIT โ€” ์›๋ณธ ๋ชจ๋ธ์˜ ๋ผ์ด์„ ์Šค๋ฅผ ๊ทธ๋Œ€๋กœ ๋”ฐ๋ฆ„
  • ๊ถŒ๋ฆฌ: ์›๋ณธ ๊ฐ€์ค‘์น˜ยทํ† ํฌ๋‚˜์ด์ €์˜ ๊ถŒ๋ฆฌ๋Š” Z.ai์— ์žˆ์œผ๋ฉฐ, ์ด ๋ฆฌํฌ๋Š” ์–‘์žํ™” ํŒŒ์ƒ๋ฌผ
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