Downloads · 30 days
137
1% of all-time downloads
bullpoint/GLM-4.6-AWQ
GLM-4.6-AWQ is a text generation model from bullpoint. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
High-performance AWQ quantization of ZHIPU AI's GLM-4.6 (357B MoE) optimized for vLLM inference
Downloads · 30 days
137
1% of all-time downloads
All-time downloads
13.2K
Public
Parameters
51.5B
189 GB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors189 GB · 100%
How the weights are stored.
I32348B · 98%
From the Hugging Face model README
High-performance AWQ quantization of ZHIPU AI's GLM-4.6 (357B MoE) optimized for vLLM inference
This is a professionally quantized 4-bit AWQ version of Z.ai's GLM-4.6 optimized for high-throughput production deployment with vLLM.
Tested on 4× NVIDIA RTX PRO 6000 Blackwell Max-Q (96GB each, 384GB total VRAM):
| Configuration | Throughput | VRAM/GPU | Total VRAM | Use Case |
|---|---|---|---|---|
| With Expert Parallelism | ~60 tok/s | ~47GB | ~188GB | Recommended: Multi-model deployment |
| Without Expert Parallelism | ~65 tok/s | ~95GB | ~384GB | Single model, maximum speed |
| Method | Accuracy | Speed | Disk Size | VRAM | Status |
|---|---|---|---|---|---|
| AWQ 4-bit | Best (indistinguishable from BF16) | Fast (Marlin kernels) | 176GB | 188GB | ✅ This model |
| GPTQ 4-bit | Lower (2× MMLU drop vs AWQ) | Similar | ~180GB | ~188GB | ⚠️ Overfits calibration data |
| FP8 | Higher precision | 3.5× slower | ~330GB | ~330GB | ❌ Unoptimized kernels |
| BF16 | Highest | N/A | ~714GB | 800GB+ | ❌ Too large for most setups |
Research shows: AWQ has ~1 point MMLU drop while GPTQ has ~2 points. AWQ performance is indistinguishable from full BF16 on real-world benchmarks.
| Setup | GPUs | VRAM/GPU | Total VRAM | Disk | Performance |
|---|---|---|---|---|---|
| Tested | 4×RTX PRO 6000 Blackwell Max-Q (96GB) | ~47GB | 384GB | 176GB | ~60 tok/s |
| Optimal | 4×H100 (80GB) | ~47GB | 320GB | 176GB | ~75-80 tok/s |
| Budget | 4×A100 (80GB) | ~47GB | 320GB | 176GB | ~50-55 tok/s |
| High-Speed | 2×H200 NVL | ~95GB | 192GB | 176GB | ~100+ tok/s |
pip install vllm>=0.11.0
# Or install from source for latest features
git clone https://github.com/vllm-project/vllm.git
cd vllm && pip install -e .
Recommended Configuration (Expert Parallelism for Multi-Model Deployment):
vllm serve <model_path> \
--tensor-parallel-size 4 \
--enable-expert-parallel \
--tool-call-parser glm45 \
--reasoning-parser glm45 \
--enable-auto-tool-choice \
--served-model-name glm-4.6-awq \
--max-model-len 131072 \
--gpu-memory-utilization 0.9 \
--trust-remote-code \
--port 8000
Maximum Speed Configuration (Single Model):
vllm serve <model_path> \
--tensor-parallel-size 4 \
--tool-call-parser glm45 \
--reasoning-parser glm45 \
--enable-auto-tool-choice \
--served-model-name glm-4.6-awq \
--max-model-len 131072 \
--gpu-memory-utilization 0.9 \
--trust-remote-code \
--port 8000
from vllm import LLM, SamplingParams
# Initialize with expert parallelism (saves VRAM)
llm = LLM(
model="path/to/GLM-4.6-AWQ",
tensor_parallel_size=4,
enable_expert_parallel=True,
max_model_len=131072,
trust_remote_code=True,
gpu_memory_utilization=0.9
)
# Disable reasoning overhead for maximum speed
prompts = [
"Explain quantum computing in simple terms. /nothink",
"Write a Python function to calculate Fibonacci numbers. /nothink"
]
sampling_params = SamplingParams(
temperature=0.7,
top_p=0.95,
max_tokens=400
)
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
print(output.outputs[0].text)
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="dummy" # vLLM doesn't require authentication
)
response = client.chat.completions.create(
model="glm-4.6-awq",
messages=[
{"role": "user", "content": "Explain quantum computing /nothink"}
],
max_tokens=400,
temperature=0.7
)
print(response.choices[0].message.content)
Note on MTP (Multi-Token Prediction): The original GLM-4.6 includes a speculative decoding layer (layer 92) for drafting multiple tokens. This layer has been intentionally removed from this quantization because:
This model was quantized using the following configuration:
from llmcompressor import oneshot
from llmcompressor.modifiers.awq import AWQModifier
from datasets import load_dataset
# Load calibration data from Neural Magic's curated dataset
dataset = load_dataset("neuralmagic/LLM_compression_calibration", split="train")
dataset = dataset.shuffle(seed=42).select(range(512))
# Define ignore patterns and targets
ignore_patterns = [
"lm_head",
"model.embed_tokens",
"re:.*input_layernorm$",
"re:.*post_attention_layernorm$",
"model.norm",
"re:.*q_norm$",
"re:.*k_norm$",
"re:.*shared_experts.*",
"re:.*mlp\\.gate\\.weight$",
"re:.*mlp\\.gate\\..*bias$",
"re:model.layers.[0-2]\\.",
]
targets = [
"re:.*gate_proj.*",
"re:.*up_proj.*",
"re:.*down_proj.*",
"re:.*k_proj.*",
"re:.*q_proj.*",
"re:.*v_proj.*",
"re:.*o_proj.*",
]
# AWQ quantization recipe
recipe = [
AWQModifier(
ignore=ignore_patterns,
config_groups={
"group_0": {
"targets": targets,
"weights": {
"num_bits": 4,
"type": "int",
"symmetric": True,
"group_size": 128,
"strategy": "group",
"dynamic": False,
},
"input_activations": None,
"output_activations": None,
"format": None,
}
},
)
]
# Apply quantization
oneshot(
model=model, # Pre-loaded AutoModelForCausalLM
dataset=dataset,
recipe=recipe,
max_seq_length=2048,
num_calibration_samples=512
)
/nothink for Maximum SpeedGLM-4.6 includes a reasoning mode that adds thinking overhead. Disable it for ~9% speedup:
# Add /nothink to your prompts
prompt = "Your question here /nothink"
Distribute experts across GPUs to save VRAM for multi-model serving:
--enable-expert-parallel # Saves ~50GB total VRAM across 4 GPUs
Longer context = more KV cache memory:
--max-model-len 131072 # Recommended (vs default 202752)
--max-num-seqs 1 # Minimum KV cache (single request at max context)
--max-num-seqs 64 # Higher throughput (multiple concurrent requests)
This model is memory bandwidth bound. Faster GPUs see proportional speedups:
/nothink)AWQ quantization maintains excellent quality:
| Metric | BF16 Baseline | This AWQ 4-bit | GPTQ 4-bit | Difference |
|---|---|---|---|---|
| MMLU | 100.0% | ~99.0% | ~98.0% | AWQ: -1%, GPTQ: -2% |
| Perplexity | Baseline | +2-3% | +5-8% | AWQ significantly better |
| Real Tasks | 100.0% | ~100.0% | 95-97% | AWQ indistinguishable |
Key Finding: Research shows AWQ performs indistinguishably from BF16 on real-world benchmarks, while GPTQ shows measurable degradation due to overfitting on calibration data.
| Component | Per GPU (EP) | Total (4 GPUs) | Percentage |
|---|---|---|---|
| Model Weights | ~12GB | ~48GB | 25% |
| Expert Weights | ~28GB | ~112GB | 60% |
| KV Cache | ~5GB | ~20GB | 11% |
| Activation | ~2GB | ~8GB | 4% |
| Total | ~47GB | ~188GB | 100% |
Marlin is the state-of-the-art kernel for 4-bit quantized inference:
| Model | Parameters | Disk Size | Quantization | Speed | VRAM | Accuracy |
|---|---|---|---|---|---|---|
| GLM-4.6-AWQ (this) | 357B | 176GB | AWQ 4-bit | 60 tok/s | 188GB | Excellent |
| GLM-4.6-GPTQ | 357B | ~180GB | GPTQ 4-bit | 60 tok/s | 188GB | Good |
| GLM-4.6-FP8 | 357B | ~330GB | FP8 | 19 tok/s | 330GB | Better |
| GLM-4.6-BF16 | 357B | ~714GB | None | N/A | 800GB+ | Highest |
| DeepSeek-V3-AWQ | 671B | ~300GB | AWQ 4-bit | 45 tok/s | 250GB | Excellent |
| Qwen2.5-72B-AWQ | 72B | ~40GB | AWQ 4-bit | 120 tok/s | 48GB | Excellent |
Run the fix script to add required config:
python fix_awq_config_for_vllm.py --model /path/to/GLM-4.6-AWQ
--enable-expert-parallel--max-model-len 65536--gpu-memory-utilization 0.85--max-num-seqs 1/nothink is appended to promptsnvidia-smi dmon)If you use this quantized model, please cite:
@software{glm4_awq_2025,
title = {GLM-4.6-AWQ: Production-Optimized 4-bit Quantization},
author = {bullpoint},
year = {2025},
url = {https://huggingface.co/bullpoint/GLM-4.6-AWQ}
}
@article{lin2023awq,
title={AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration},
author={Lin, Ji and Tang, Jiaming and Tang, Haotian and Yang, Shang and Dang, Xingyu and Han, Song},
journal={arXiv preprint arXiv:2306.00978},
year={2023}
}
@software{zai2025glm46,
title={GLM-4.6},
author={Z.ai and ZHIPU AI},
year={2025},
url={https://huggingface.co/zai-org/GLM-4.6},
license={MIT}
}
MIT License - This quantized model inherits the MIT license from the original GLM-4.6 model.
You are free to:
See the base model repository for full license terms.
Want to quantize this model yourself? See the included quantize_glm46_awq.py script for the exact quantization configuration used.
This model was quantized on modest hardware with extensive CPU offloading:
Note: The quantization process offloads the full BF16 model (~714GB) to system RAM/swap since it exceeds available VRAM. Using 4 GPUs during quantization provides no speed benefit - the process is CPU memory-bound, not GPU-bound. The included script defaults to single-GPU mode (CUDA_VISIBLE_DEVICES=0) for optimal resource usage.
For issues and questions:
Status: ✅ Production Ready | Last Updated: October 2025 | Tested With: vLLM 0.11.0+