Repository navigation
JointQ
🏠 Home · 🧭 Choose a method · 🚀 Quickstart · 🧰 Help
On this page
JointQ refines a calibrated GPTQ solution by optimizing each weight group's scale and integer codes together. It starts from GPTQ and clipping-based candidates, refits their scales, and searches for integer changes with the affected group's scale refit at each step. The solver uses the calibration Hessian to score reconstruction error.
Source revision 9ec8da22a.
Pass jointq=JointQConfig() inside GPTQConfig. Use representative calibration text as with GPTQ.
from gptqmodel import CalibrationConfig, GPTQConfig, GPTQModel, JointQConfig
qcfg = GPTQConfig(bits=4, group_size=128, sym=True, jointq=JointQConfig())
model = GPTQModel.load("Qwen/Qwen3-0.6B", quantize_config=qcfg)
model.quantize(CalibrationConfig(dataset=calibration_texts))
model.save("qwen3-0.6b-jointq")
quantized = GPTQModel.load("qwen3-0.6b-jointq")jointq defaults to None. It accepts a JointQConfig, a dictionary of its fields, or True for defaults. Use False or None to disable it. A matching dynamic rule can enable, replace, or disable JointQ for its modules. Omitting jointq from the rule inherits the run-level setting.
JointQConfig field |
Default | Effect |
|---|---|---|
regularization |
"paper" |
Uses the paper's layer-specific strengths for W4G128, W4 per-channel, W3G128, W3 per-channel, and W2G32. Other settings resolve to zero. A nonnegative number sets the strength directly. |
eta |
0.5 |
Exponent of the activation-energy weights used by the diagonal regularizer. |
adaptive_retry |
None |
Automatically retries a layer with zero resolved regularization if its relative weight error reaches the threshold and the width is at least 3 bits. A boolean overrides the width-based policy. |
retry_ratio |
0.2 |
Relative weight-error threshold for the retry. |
retry_regularization |
0.01 |
Regularization strength used by the retry. |
tolerance |
1e-12 |
Absolute tolerance for improvement in integer search and joint scale refitting. |
inner_stall_fraction |
0.1 |
Stops a group search when more than this fraction of rows has no improving move. |
outer_active_fraction |
0.1 |
Stops the layer search when fewer than this fraction of rows remain active. |
re_solve_low |
0.2 |
Refit joint scales for rows whose fraction of changed groups is below this threshold. |
re_solve_high |
0.6 |
Refit joint scales for rows whose fraction of changed groups is above this threshold. |
max_iterations_per_group |
None |
Caps the integer moves per group. None uses 10 times the effective group size. |
max_passes |
100 |
Caps the number of refinement passes per layer. |
device |
"auto" |
Runs refinement on the Hessian device. Set "cpu" to move the refinement workspace to CPU. |
dtype |
"float64" |
Solver precision. Set "float32" explicitly to reduce workspace memory. The solver falls back to FP32 if the device lacks FP64 linear algebra. |
The GPTQ warm start inherits damp_percent, mse, desc_act, and act_group_aware from the effective module config.
- JointQ supports calibrated symmetric integer GPTQ at 2–8 bits on eligible linear projections, including MoE expert linears. It supports GPTQ grouping, including
group_size=-1for per-channel quantization, and GPTQ activation ordering. Check the target backend's support for the saved layout and bit width before exporting. - The solver rejects
sym=False,static_groups=True, mock quantization, GPTAQ, G2PTQ, FOEM, enabled GSQ or staged GSQ training, embedding tables, and tensor-parallel padded projections. Weight-only quantization, EXL3, and the DeepSeek V4.1 Flash projection port cannot use JointQ. - Saved checkpoints use the selected GPTQ layout with the usual
qweight,qzeros,scales, andg_idxtensors. The run-level settings are saved asmeta.jointqin the quantization config andquant_methodremains"gptq". Sequential quantization checkpoint continuation rejects JointQ, including when a dynamic rule enables it. - The refinement uses a wide Hessian and temporary reconstruction tensors. If these exceed device memory, try
JointQConfig(device="cpu")orJointQConfig(dtype="float32").
See the algorithm and validation notes, config source, solver source, and JointQ paper.
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
- 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