Repository navigation
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.
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.
| 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.
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.
Documentation home · Quickstart · Troubleshooting · Repository · PyPI
Public source 8d42d0c29 declares package version 7.12.4. Individual pages identify their source revisions. Choose a method · Dtypes and formats. Maintained by ModelCloud.ai.
🧭 1 · Choose and understand
🚀 2 · Use it
- Installation and Quickstart
- Loading and Inference
- LeapQuant recurrent-state quantization
- Evaluation
- Serving
- Troubleshooting and FAQ
- Memory, Offload, Multi-GPU
- MLX / Apple Silicon
- Tenstorrent / Block Floats
- Hugging Face Integration
- Multimodal and MoE Models
🎛️ Methods and representations
Each guide: choose → examples → math / advanced
- GPTQ / GPTAQ / G2PTQ / ADMM-Q / RTN
- SINQ
- JointQ
- AWQ
- QQQ
- MACaQ / MXFP4
- EXL3
- CPTC
- VPTQ
- Paro
- FP8 and NVFP4
- NF12: lossless BF16 storage
- GGUF families
- BitsAndBytes: NF4 / FP4 / INT8
🧰 Refinement and execution
🧠 3 · Theory and advanced reference