Offline quantization is recommended over online quantization for better performance, usability, and convenience.
Quantization Types
Offline Quantization
Load pre-quantized model weights. Required for GPTQ, AWQ, and optimal for FP8/FP4.
Online Quantization
Dynamically quantize weights at runtime. Convenient but slower startup and higher memory usage.
Offline vs Online
Offline Quantization
Load pre-quantized models directly. The quantization method is automatically detected from the model configuration.Basic Usage
Per-Channel Quantization
For per-channel quantized models (INT8/FP8) with per-token dynamic quantization, you can optionally specify--quantization to use sgl-kernel instead of vLLM kernels:
Quantization Tools
Unsloth (Recommended)
We strongly recommend Unsloth for quantization and deployment.NVIDIA ModelOpt
NVIDIA ModelOpt provides advanced quantization optimized for NVIDIA hardware.Quick Start
Available Methods
FP8
modelopt_fp8 - Optimal on NVIDIA Hopper and Blackwell GPUsFP4
modelopt_fp4 - Optimal on NVIDIA Blackwell GPUsPython API
Pre-Quantized Models
Load existing pre-quantized ModelOpt models:auto-round
Supports multiple quantization formats and both LLMs and VLMs.LLM Quantization
VLM Quantization
Command Line
GPTQModel
LLM Compressor
From the vLLM project, supports FP8 and other formats.Online Quantization
Quantize weights dynamically at server startup.FP8 Online
TorchAO Quantization
SGLang supports torchao quantization methods:Supported Methods
int8dq- INT8 dynamic quantization (⚠️ disable CUDA graph with--disable-cuda-graph)int8wo- INT8 weight-onlyfp8wo- FP8 weight-onlyfp8dq-per_tensor- FP8 dynamic per-tensorfp8dq-per_row- FP8 dynamic per-rowint4wo-32,int4wo-64,int4wo-128,int4wo-256- INT4 weight-only with different group sizes
AMD GPU Quantization
For AMD GPUs (CDNA3/CDNA4), usequark_int4fp8_moe to quantize MoE layers:
- MoE layers: weights to INT4, upcasted to FP8 for compute
- Other layers: weights to FP8 directly
Pre-Quantized Model Sources
Unsloth
High-quality quantized models
NVIDIA ModelOpt
NVIDIA-optimized models
NeuralMagic
Sparse and quantized models
Performance Impact
Memory Reduction
Throughput Improvements
Quantization typically provides:- 1.5-2× throughput with FP8/INT8
- 2-3× throughput with FP4/INT4
- Lower latency due to reduced memory bandwidth
- Higher batch sizes due to memory savings
Known Limitations
Mixed-bit Quantization
Mixed-bit Quantization
Not fully supported due to vLLM’s layer fusion (e.g., QKV fusion). Different bit-widths within fused layers can cause compatibility issues.
Quantized MoE Models
Quantized MoE Models
May encounter issues due to kernel limitations. Try skipping problematic layers like
mlp.gate.Quantized VLMs
Quantized VLMs
Limited support. Some format combinations may fail. AWQ format typically works best.
