Downloads · 30 days
2.4K
5% of all-time downloads
amd/GLM-5.1-MXFP4
GLM-5.1-MXFP4 is a machine learning model from amd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
- Model Architecture: GLM-5.1 - Input: Text - Output: Text - Supported Hardware Microarchitecture: AMD MI350/MI355 - ROCm: 7.0.0 - PyTorch: 2.10.0 - Transformers: 5.2.0 - Operating System(s): Linux - Inference Engine:…
Downloads · 30 days
2.4K
5% of all-time downloads
All-time downloads
48.5K
Public
Parameters
408B
425 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors425 GB · 100%
How the weights are stored.
U8392B · 96%
From the Hugging Face model README
This model was built with GLM-5.1 model by applying AMD-Quark for MXFP4 quantization.
The model was quantized from zai-org/GLM-5.1 using AMD-Quark. The weights and activations are quantized to MXFP4.
Quantization scripts:
from quark.torch import LLMTemplate, ModelQuantizer
# --- Register template ---
GLM5_template = LLMTemplate(
model_type="glm_moe_dsa",
kv_layers_name=["*kv_a_proj_with_mqa", "*kv_b_proj"],
q_layer_name="*q_a_proj",
exclude_layers_name=["lm_head"],
)
LLMTemplate.register_template(GLM5_template)
print(f"[INFO]: Registered template '{GLM5_template.model_type}'")
# --- Configuration ---
model_dir = "zai-org/GLM-5.1"
output_dir = "amd/GLM-5.1-MXFP4"
quant_scheme = "mxfp4"
exclude_layers = [
"*self_attn*",
"*mlp.gate",
"*lm_head",
"*mlp.gate_proj",
"*mlp.up_proj",
"*mlp.down_proj",
]
# --- Build quant config from template ---
template = LLMTemplate.get("glm_moe_dsa")
quant_config = template.get_config(scheme=quant_scheme, exclude_layers=exclude_layers)
# --- File-to-file quantization (memory-efficient, no full model loading) ---
quantizer = ModelQuantizer(quant_config)
quantizer.direct_quantize_checkpoint(
pretrained_model_path=model_dir,
save_path=output_dir,
)
print(f"[INFO]: Quantization complete. Output saved to {output_dir}")
This model can be deployed efficiently using the vLLM backend.
The model was evaluated on GSM8K benchmarks.
The GSM8K results were obtained using the lm-evaluation-harness framework, based on the Docker image rocm/vllm-dev:nightly_main_20260526, with vLLM pre-installed inside the image and lm-eval compiled and installed from source.
export VLLM_ROCM_USE_AITER=1
export VLLM_ROCM_USE_AITER_FP8BMM=0
export VLLM_ROCM_USE_AITER_FP4BMM=0
vllm serve amd/GLM-5.1-MXFP4 \
-tp 8 \
--block-size 1 \
--trust-remote-code \
--max-model-len 4096
lm_eval \
--model local-completions \
--model_args '{"model": "amd/GLM-5.1-MXFP4", "base_url": "http://localhost:8000/v1/completions", "num_concurrent": 32, "max_retries": 10, "max_gen_toks": 2048, "tokenizer_backend":"None","tokenized_requests":"False" }' \
--tasks gsm8k \
--batch_size auto \
--num_fewshot 5 \
--trust_remote_code
Modifications Copyright(c) 2026 Advanced Micro Devices, Inc. All rights reserved.