Text Generation
Transformers
Safetensors
glm_moe_dsa
glm
glm-5.1
Mixture of Experts
quantized
fp8
float8
conversational
compressed-tensors
Instructions to use mconcat/GLM-5.1-FP8-Dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mconcat/GLM-5.1-FP8-Dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mconcat/GLM-5.1-FP8-Dynamic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mconcat/GLM-5.1-FP8-Dynamic") model = AutoModelForCausalLM.from_pretrained("mconcat/GLM-5.1-FP8-Dynamic", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mconcat/GLM-5.1-FP8-Dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mconcat/GLM-5.1-FP8-Dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mconcat/GLM-5.1-FP8-Dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mconcat/GLM-5.1-FP8-Dynamic
- SGLang
How to use mconcat/GLM-5.1-FP8-Dynamic 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 "mconcat/GLM-5.1-FP8-Dynamic" \ --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": "mconcat/GLM-5.1-FP8-Dynamic", "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 "mconcat/GLM-5.1-FP8-Dynamic" \ --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": "mconcat/GLM-5.1-FP8-Dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mconcat/GLM-5.1-FP8-Dynamic with Docker Model Runner:
docker model run hf.co/mconcat/GLM-5.1-FP8-Dynamic
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -83,12 +83,32 @@ vllm serve mconcat/GLM-5.1-FP8-Dynamic \
|
|
| 83 |
|
| 84 |
## Notes
|
| 85 |
|
| 86 |
-
- This is a 754B MoE model (~40B active per token). Requires multi-GPU setup for inference.
|
| 87 |
- FP8 E4M3 provides ~2x compression over BF16 with minimal quality degradation.
|
| 88 |
-
- Compatible with Hopper (SM90) and Blackwell
|
| 89 |
- Dynamic activation scaling — scales computed at inference time, not baked into the checkpoint.
|
| 90 |
- GLM-5.1 does not ship MTP weights despite `num_nextn_predict_layers=1` in config.
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
## Quantization Process
|
| 93 |
|
| 94 |
- **Tool**: Custom layer-by-layer pipeline with native `torch.float8_e4m3fn` dtype
|
|
|
|
| 83 |
|
| 84 |
## Notes
|
| 85 |
|
| 86 |
+
- This is a 754B MoE model (~40B active per token). Requires multi-GPU setup for inference (8x 80GB+ GPUs recommended).
|
| 87 |
- FP8 E4M3 provides ~2x compression over BF16 with minimal quality degradation.
|
| 88 |
+
- Compatible with Hopper (SM90) and Blackwell GPUs.
|
| 89 |
- Dynamic activation scaling — scales computed at inference time, not baked into the checkpoint.
|
| 90 |
- GLM-5.1 does not ship MTP weights despite `num_nextn_predict_layers=1` in config.
|
| 91 |
|
| 92 |
+
## Blackwell SM120 Patch (RTX PRO 6000 / Workstation GPUs)
|
| 93 |
+
|
| 94 |
+
If running on Blackwell workstation GPUs (SM 12.0), vLLM 0.19.0 requires patches for FlashMLA sparse attention support:
|
| 95 |
+
|
| 96 |
+
```bash
|
| 97 |
+
# Patch 1: FlashMLA ops - add SM120 to sparse support check
|
| 98 |
+
FLASHMLA_OPS=$(python -c "import vllm, os; print(os.path.join(os.path.dirname(vllm.__file__), 'v1/attention/ops/flashmla.py'))") && \
|
| 99 |
+
sed -i 's/is_device_capability_family(90)\s*or current_platform.is_device_capability_family(100)/is_device_capability_family(90) or current_platform.is_device_capability_family(100) or current_platform.is_device_capability_family(120)/' "$FLASHMLA_OPS"
|
| 100 |
+
|
| 101 |
+
# Patch 2: FlashMLA sparse backend - add SM12 to capability check
|
| 102 |
+
FLASHMLA_SPARSE=$(python -c "import vllm, os; print(os.path.join(os.path.dirname(vllm.__file__), 'v1/attention/backends/mla/flashmla_sparse.py'))") && \
|
| 103 |
+
sed -i 's/return capability.major in \[9, 10\]/return capability.major in [9, 10, 12]/' "$FLASHMLA_SPARSE"
|
| 104 |
+
|
| 105 |
+
# Patch 3: FlashMLA dense backend (if exists)
|
| 106 |
+
FLASHMLA_DENSE=$(python -c "import vllm, os; print(os.path.join(os.path.dirname(vllm.__file__), 'v1/attention/backends/mla/flashmla.py'))") && \
|
| 107 |
+
sed -i 's/return capability.major in \[9, 10\]/return capability.major in [9, 10, 12]/' "$FLASHMLA_DENSE" 2>/dev/null || true
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
These patches add SM120 (Blackwell workstation) to the supported compute capability list for GLM-5.1's DSA sparse attention.
|
| 111 |
+
|
| 112 |
## Quantization Process
|
| 113 |
|
| 114 |
- **Tool**: Custom layer-by-layer pipeline with native `torch.float8_e4m3fn` dtype
|