Skip to main content
SGLang supports various quantization methods to reduce memory usage and increase throughput. Quantization converts model weights from high-precision formats (BF16/FP16) to lower-precision formats (INT8/FP8/INT4/FP4).
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

Do NOT add --quantization when loading pre-quantized models. The quantization method is parsed from the model config.

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

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 GPUs

FP4

modelopt_fp4 - Optimal on NVIDIA Blackwell GPUs

Python 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.
Deploy:

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-only
  • fp8wo - FP8 weight-only
  • fp8dq-per_tensor - FP8 dynamic per-tensor
  • fp8dq-per_row - FP8 dynamic per-row
  • int4wo-32, int4wo-64, int4wo-128, int4wo-256 - INT4 weight-only with different group sizes
int8dq has issues with CUDA graph capture. Always use --disable-cuda-graph with this method.

AMD GPU Quantization

For AMD GPUs (CDNA3/CDNA4), use quark_int4fp8_moe to quantize MoE layers:
This quantizes:
  • 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
Always validate quantized models via benchmarks post-quantization to guard against quality degradation.

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

Not fully supported due to vLLM’s layer fusion (e.g., QKV fusion). Different bit-widths within fused layers can cause compatibility issues.
May encounter issues due to kernel limitations. Try skipping problematic layers like mlp.gate.
Limited support. Some format combinations may fail. AWQ format typically works best.

References