Skip to content
Qubitium edited this page Nov 30, 2026 · 1 revision

SINQ

🏠 Home · 🧭 Choose a method · 🚀 Quickstart · 🧰 Help

On this page

SINQ (Sinkhorn-normalized quantization) fits 2-, 3-, 4-, or 8-bit integer weights without calibration data. It balances the row and column scales of each weight tile before fitting an asymmetric affine grid. Use it when you have the original model weights and can deploy the resulting checkpoint through GPT-QModel.

Quantize, save, and load

import torch
from gptqmodel import BACKEND, GPTQModel, SINQConfig

model = GPTQModel.load(
    "Qwen/Qwen3-0.6B",
    quantize_config=SINQConfig(device="cpu"),
    dtype=torch.bfloat16,
)
model.quantize()
model.save_quantized("Qwen3-0.6B-sinq")

quantized = GPTQModel.load(
    "Qwen3-0.6B-sinq",
    device="cpu",
    dtype=torch.bfloat16,
    backend=BACKEND.GPTQ_TORCH,
)

BACKEND.AUTO also selects SinqLinear for compatible SINQ checkpoints. The kernel supports BF16 and FP16 activations on CPU, NVIDIA CUDA, and AMD ROCm. It decodes a temporary weight for each forward and returns the activation dtype. Use this path for eager inference.

Configuration

Field Default Accepted values and behavior
bits 4 2, 3, 4, or 8. Three-bit packing requires both input and output widths divisible by 32.
group_size 64 -1 for the full input width, or 8, 16, 32, 64, 128, 256, 512, or 1024. A trailing partial group is fitted separately.
sinkhorn_iters 16 Positive integer iteration limit. The normalization keeps the best balance found for each tile.
kurtosis_threshold 5.0 Positive finite value or None. The layer uses plain asymmetric RTN if its weight kurtosis exceeds the threshold or is non-finite. Set None to bypass the gate.
tiling_mode "1d" One tile per input-channel group.

QuantizeConfig(method="sinq", ...) also constructs a SINQConfig. SINQ uses torch.int32 packing, sym=False, and desc_act=False. Per-module dynamic rules can select bits or group size and exclude modules. The Sinkhorn controls apply to the whole run. See QuantizeConfig Reference.

Checkpoint layout and compatibility

Each quantized linear stores GPTQ-shaped qweight, qzeros, scales, and g_idx, plus a required sinq_scale vector with one value per input channel. The row multiplier is folded into the stored group scales. Inference applies the column multiplier to the decoded weight before the linear reduction:

effective_weight = (codes - logical_zero_points) * group_scales * sinq_scale

Fresh quantization writes sinq_scale in FP32. Loading also accepts finite, positive FP16 or BF16 vectors of the same length. Both in-memory and file-based dequantization apply the column scale when reconstructing the dense weight.

Saved metadata advertises quant_method: "gptqmodel_sinq" and uses "sinq" for the method and format. Load the checkpoint with GPTQModel.load. Transformers 5.23's SINQ reader expects a separate W_q / meta layout, and plain Transformers treats gptqmodel_sinq as unknown. See Hugging Face integration.

Source and further reading

Clone this wiki locally