GPTQ is a one-shot post-training weight quantization method for generative pretrained transformers. It uses approximate second-order information to compress models to 3 or 4 bits per weight with negligible accuracy loss. section 6.4.1 section 6.5
It is used to shrink large models enough for practical inference on limited hardware, while keeping performance close to the uncompressed baseline. section 6.4.1 section 6.5
Typical treatment centers on these implementation steps:
- Configure 4-bit quantization parameters such as bit width and group size. section 6.4.1
- Load the pretrained model and a calibration dataset. section 6.4.1
- Run quantization, save the quantized model, and reload it for inference. section 6.4.1
AutoGPTQ workflow
The example quantizes GPT-2 XL with AutoGPTQ, uses Wikitext-2 for calibration, saves a 4-bit model, reloads it on CUDA, and generates text from the prompt “Auto-GPTQ is”. section 6.4.1
