Quantization
GPTQ is a post-training quantization method to make the model smaller. It quantizes the layers by finding a compressed version of that weight, that will yield a minimum mean squared error like below 👇 Given a layer 𝑙 l with weight matrix 𝑊 𝑙 W l and layer input 𝑋 𝑙 X l , find quantized weight ℎ 𝑎 𝑡 𝑊 𝑙 hatW l : ( 𝑊 ^ 𝑙 ∗ = 𝑎 𝑟 𝑔 𝑚 𝑖 𝑛 𝑊 𝑙 ^ ∣ ∣ 𝑊 𝑙 𝑋 − 𝑊 ^ 𝑙 𝑋 ∣ ∣ 2 2 ) ( W ^ l ∗ =argmin W l ^ ∣∣W l X− W ^ l X∣∣ 2 2 ) TGI allows you to both run an already GPTQ quantized model (see available models here) or quantize a model of your choice using quantization script. You can run a quantized model by simply passing —quantize like below 👇 Note that TGI’s GPTQ implementation doesn’t use AutoGPTQ under the hood. However, models quantized using AutoGPTQ or Optimum can still be served by TGI. To quantize a given model using GPTQ with a calibration dataset, simply run This will create a new directory with the quantized files whi
Quantization · Hugging Face text-generation-inference documentation Quantization text-generation-inference 🏡 View all docs AWS Trainium & Inferentia Accelerate Argilla AutoTrain Bitsandbytes CLI Chat UI Dataset viewer Datasets Deploying on AWS Diffusers Distilabel Evaluate Google Cloud Google TPUs Gradio Hub Hub Python Library Huggingface.js Inference Endpoints (dedicated) Inference Providers Kernels LeRobot Leaderboards Lighteval Microsoft Azure OpenEnv Optimum PEFT Reachy Mini Safetensors Sentence Transformers TRL Tasks Text Embeddings Inference Text Generation Inference Tokenizers Trackio
related reading
- 2210.17323arxiv.org
- GPTQ: Accurate Post-Training Quantization for Generative Pre-Trained Transformersarxiv.org
- A Guide to Quantization in LLMs | Symbl.aisymbl.ai
- Efficient LLM inferencefinbarrtimbers.substack.com
- TheBloke/Mistral-7B-Instruct-v0.1-AWQ · Hugging Facehuggingface.co
- Quantization from the ground upngrok.com
- Together AI | The AI Native Cloudtogether.ai
- 2305.14314arxiv.org
- Hugging Face – The AI community building the future.huggingface.co
- AI Model & API Providers Analysis | Artificial Analysisartificialanalysis.ai
- GPT in 60 Lines of NumPy | Jay Modyjaykmody.com
- Tinkerthinkingmachines.ai