Instructions to use HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64") model = AutoModelForCausalLM.from_pretrained("HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64
- SGLang
How to use HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64 with Docker Model Runner:
docker model run hf.co/HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64
GLM-5.3 Int4/Int8 mixed-precision AWQ, group 64
A mixed-precision quantization of GLM-5.3 (754B-parameter MoE, model type glm_moe_dsa) made from the
original BF16 release (zai-org/GLM-5.3-BF16, not the derived FP8 checkpoint). Built for the
DGPP inference engine on four NVIDIA DGX Sparks (TP=4), where the whole model has to fit
in ~100 GiB per rank with room left for context.
| Total size | 398 GiB (≈ 99.8 GiB per rank at TP=4) |
Routed experts, layers 3–77 (mlp.experts.*.{gate,up,down}_proj) |
int4 symmetric, group 64, bf16 scales, AWQ |
Attention (q_a, q_b, kv_a_proj_with_mqa, kv_b, o_proj) and shared experts, layers 3–77 |
int8 symmetric, group 64, bf16 scales |
Dense layers 0–2, DSA indexers, MoE routers, norms, embeddings, lm_head, the whole MTP block (layer 78) |
bf16, byte-exact from the source |
| Format | compressed-tensors pack-quantized (weight_packed int32, weight_scale bf16, weight_shape), declared in config.json |
Method
- AWQ (activation-aware weight quantization) via llm-compressor 0.13.0, applied one decoder layer at a time by a layer-wise driver that is bit-exact against llm-compressor's single-pass sequential pipeline (verified on a reduced model, both group sizes). Activations propagate through the smoothed, unquantized layer, as in the reference implementation.
- Calibration: 512 sequences × 2048 tokens (1.05M tokens) drawn with a fixed seed from a mixed corpus of prose, code, math and conversational / tool-use transcripts. Each routed expert is calibrated on the tokens actually routed to it. A second, independent 512-row draw reproduced the layer output error to within 0.1 %, so the calibration size is not a limiting factor.
- Fold correction (important). llm-compressor's AWQ mapping for
glm_moe_dsafolds the smoothing scale ofpost_attention_layernorminto the norm but does not rescale the MoE router (mlp.gate), and likewise leaves the DSA indexer'swk/weights_proj/wq_buncompensated in the 18 layers that own an indexer. As saved by llm-compressor those modules receivex / s, and the per-layer error is 5–10× worse than plain round-to-nearest. Every MoE shard here has the affected weight columns rescaled by the recovered scale (original_norm / smoothed_norm), which restores the layer to slightly better than round-to-nearest. Corrected shards carry the safetensors metadata keyfold_corrected. The defect and fix are described in the issue draft shipped with this card's tooling.
Measured error (per layer)
Relative RMS error against the bf16 layer on 32 × 2048 real, held-out tokens. "Contribution" is the error of what the layer adds (output minus input); "residual" is the error of the full residual stream leaving the layer, which is the quantity that propagates.
| layer | variant | contribution | residual |
|---|---|---|---|
| 3 | this checkpoint (AWQ int4 g64, corrected) | 2.38 % | 0.53 % |
| 3 | RTN int4 g64 (no AWQ) | 2.40 % | 0.54 % |
| 3 | AWQ as llm-compressor saved it (uncorrected, g128) | 12.5 % | 2.80 % |
| 3 | fp8 e4m3 g128 on every projection, for reference | 2.46 % | 0.55 % |
| 6 (owns an indexer) | this checkpoint | 3.27 % | 1.50 % |
| 6 | RTN int4 g64 | 3.44 % | 1.58 % |
| 6 | AWQ uncorrected | 30.5 % | 14.0 % |
| 21 | this checkpoint | 10.95 % | 0.58 % |
| 21 | RTN int4 g64 | 11.09 % | 0.59 % |
| 42 (owns an indexer) | this checkpoint | 9.85 % | 2.00 % |
| 42 | RTN int4 g64 | 9.89 % | 2.01 % |
| 63 | this checkpoint | 12.50 % | 2.34 % |
| 63 | RTN int4 g64 | 12.50 % | 2.34 % |
The contribution metric grows with depth because each layer's addition shrinks relative to the residual stream; the residual error rises from 0.5 % (layer 3) to 2.3 % (layer 63). On this model the int4/int8 mix lands at the error of an all-fp8 recipe at half the bytes. AWQ's advantage over round-to-nearest is 0.9 / 4.8 / 1.2 / 0.4 / 0.02 % of the error at layers 3 / 6 / 21 / 42 / 63: real in the shallow indexer layer, negligible at depth. Per layer, this checkpoint and the round-to-nearest companion are equivalent.
No end-to-end evaluation yet (perplexity, benchmarks): the numbers above are per-layer. Treat this as a carefully validated but not yet benchmarked checkpoint.
A companion checkpoint with the same recipe but plain round-to-nearest instead of AWQ (no smoothing, no fold
correction needed) is at HawkBearPig/GLM-5.3-Int4-Int8Mix-RTN-g64.
Loading
Standard compressed-tensors layout: model.safetensors.index.json, per-layer shards layer-NNN.safetensors,
passthrough.safetensors (embeddings, norms, lm_head, MTP block), config.json with quantization_config,
tokenizer files. Any loader that understands glm_moe_dsa and compressed-tensors pack-quantized W4A16/W8A16
should read it; only DGPP has been exercised. vLLM / transformers loading is untested.
Tooling: llm-compressor 0.13.0, compressed-tensors 0.18.0, transformers 5.14.1, torch 2.13.0 (CUDA 13), one B200.
License: MIT, inherited from GLM-5.3.
- Downloads last month
- -
Model tree for HawkBearPig/GLM-5.3-Int4-Int8Mix-AWQ-g64
Base model
zai-org/GLM-5.3-BF16