Repository navigation
FITQ
🏠 Home · 🧭 Choose a method · 🚀 Quickstart · 🧰 Help
On this page
FITQ (Fewest-Instruction Trellis Quantization) compresses linear weights into 16 × 16 trellis-coded tiles in a Hadamard-rotated basis. It supports seven rates from 2 to 6 bits per weight, including 2.5 and 3.5. Each output row has an FP16 scale in addition to the tile bitstream.
Choose FITQ when you have representative calibration data and want to compare a low-bit trellis checkpoint with alternatives such as EXL3. Both dimensions of every quantized projection must be multiples of 16. FITQ kernels require aligned projections and have no automatic padding.
Use FITQConfig or QuantizeConfig(method="fitq", ...). Pass representative calibration texts or tokenized rows as calibration in the example.
from gptqmodel import CalibrationConfig, FITQConfig, GPTQModel
model = GPTQModel.load(
"ibm-granite/granite-3.1-1b-a400m-instruct",
quantize_config=FITQConfig(bits=3),
)
model.quantize(CalibrationConfig(dataset=calibration, batch_size=4))
model.save("granite-fitq-t3")
reloaded = GPTQModel.load("granite-fitq-t3")FITQ uses the calibration inputs to estimate a Hessian and feeds each 16-column block’s quantization error into the remaining columns. GPT-QModel uses a beam search to choose the trellis codes. When the native encoder is unavailable, quantization uses the Torch reference encoder. Leave CalibrationConfig.exclude_attention_sinks unset or set it to False.
bits |
Code | Default beam width when keep=None
|
|---|---|---|
2 |
t2 |
2048 |
2.5 |
t2p5 |
512 |
3 (default) |
t3 |
128 |
3.5 |
t3p5 |
1024 |
4 |
t4 |
1024 |
5 |
t5 |
1024 |
6 |
t6 |
1024 |
For mixed rates, use a dynamic rule such as dynamic={r"+:.*down_proj.*": {"bits": 3.5}}. Per-module overrides accept only bits. Use exclusion rules to skip modules.
Start with the default encoder settings. scale_grid supplies positive multipliers of the rotated row RMS and defaults to (1.0,). The solver keeps the candidate with the lowest Hessian-weighted error. refit_scales=True also tries a closed-form scale update for the chosen codes. The refit is off by default. Check held-out model quality before using it. See the config reference for all FITQ-specific fields.
Automatic selection prefers fitq_cuda on Linux CUDA or ROCm. Native execution requires NVIDIA SM80 (compute capability 8.0) or newer, or AMD RDNA4 gfx1200/gfx1201, and a buildable native extension. If the native path is unavailable, the layer falls back to Torch.
| Backend | Execution |
|---|---|
fitq_cuda |
For 1–8 input rows, decodes tiles in registers for GEMV. For 9–64 rows, fuses tile decode with tensor-core GEMM. Above 64 rows, decodes into a BF16 workspace for vendor GEMM. |
fitq_torch |
Portable Torch path for CPU, CUDA, ROCm, XPU, and MPS. Caches a dense FP32 reconstruction in the rotated basis. Budget memory for that cache when loading on a device without native FITQ execution. |
Select the portable path explicitly with GPTQModel.load("granite-fitq-t3", backend="fitq_torch"). Both backends accept FP16, BF16, and FP32 activations and use eager execution.
model.save() writes a GPT-QModel safetensors checkpoint with the fitq format. Reload the checkpoint directory with GPTQModel.load(). Standalone .fitq export is unavailable.
| Buffer | Content |
|---|---|
fitq_streams |
INT32 trellis words in row-major tile order |
fitq_s_row |
One FP16 scale per output row, stored as INT16 bit patterns |
fitq_sign_in, fitq_sign_out
|
Packed INT32 sign masks for the input and output rotations |
fitq_meta |
Four INT32 values for the code index, input and output rotation widths, and FP32 decode-unit bits |
Documentation home · Quickstart · Troubleshooting · Repository · PyPI
Public source 780f1bbfc declares package version 7.15.0. 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
- FITQ
- VPTQ
- Tetra
- TWLA
- Paro
- FP8 and NVFP4
- NF12: lossless BF16 storage
- GGUF families
- BitsAndBytes: NF4 / FP4 / INT8
🧰 Refinement and execution
- GSQ refinement / allocation
- EoRA adapters
- Rotation, Smoothing, Norm Tuning
- Projection Fusion
- TurboQuant KV cache
🧠 3 · Theory and advanced reference