Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 5 min read Announcement easyNovice

Smaller is better: Q8-Chat, an efficient generative AI experience on Xeon

SmoothQuant enables accurate 8-bit (INT8) post-training quantization of LLMs by mathematically shifting activation outliers into the weights, which makes Transformer layers quantization-friendly. Intel applied it to OPT, LLaMA, Alpaca, Vicuna, BloomZ and MPT-7B-chat models, roughly halving model size. On many LM Evaluation Harness tasks the quantized models matched or slightly improved accuracy, and most remaining tasks degraded only marginally. Running on a single 32-core Sapphire Rapids Xeon socket at batch size 1, the quantized models deliver low per-token latency, demonstrated in the Q8-Chat Space, with Optimum Intel integration via Intel Neural Compressor planned.

Assumes: Transformer basicsmodel quantization

Related posts

  • A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using transformers, accelerate and bitsandbytes

    Hugging Face mediumAdept

    LLM.int8() makes 8-bit inference of 175B-class transformers possible with no measurable quality loss. It handles the systematic outlier features that emerge beyond about 6B parameters through mixed-precision decomposition: hidden-state columns with values of magnitude 6 or more are multiplied in FP16, and everything else goes through vector-wise int8 quantization before being dequantized and summed. The method is built on FP32/FP16/BF16 trade-offs and absmax and zero-point quantization, and it halves memory relative to half precision. On OPT-175B and BLOOM-176B, lm-eval-harness benchmarks stay within standard error. It is integrated into Hugging Face transformers via bitsandbytes and Accelerate.

  • Making LLMs lighter with AutoGPTQ and transformers

    Hugging Face mediumAdept

    AutoGPTQ is now integrated into Hugging Face Transformers (via Optimum), letting users quantize and run LLMs at 8, 4, 3 or 2 bits with the GPTQ post-training method. GPTQ needs a calibration dataset and quantizes only the weights: int4 weights are dequantized on the fly in a fused kernel while compute stays in fp16. That gives nearly 4x memory savings with negligible accuracy loss at 4-bit. On an A100 at batch size 1, Llama-2-7B with the exllama kernel dropped peak memory from about 29 GB to 10.5 GB with slightly better per-token latency than fp16. Text-Generation-Inference can now serve a 70B model on a single 80GB GPU and PEFT adapters can be fine-tuned on top, but the kernels slow down at larger batch sizes and W4A8 or Triton kernels remain open work.

  • Blazing Fast SetFit Inference with 🤗 Optimum Intel on Xeon

    Hugging Face mediumAdept

    Post-training static int8 quantization of a SetFit model body with Optimum Intel and Intel Neural Compressor speeds up inference on Xeon CPUs by up to 7.8x in throughput with negligible accuracy loss. The walkthrough calibrates on 100 rotten_tomatoes samples, quantizes a bge-small SetFit model with the IPEX backend, and benchmarks it against fp32 Transformers and IPEX bf16 with TorchScript. At batch size 1, latency drops from 15.69 ms to 4.55 ms (3.45x), model size shrinks from 127 MB to 45 MB, and sst2 accuracy moves only from 88.4% to 88.1%.

  • CPU Optimized Embeddings with 🤗 Optimum Intel and fastRAG

    Hugging Face mediumAdept

    Post-training static int8 quantization of BGE embedding models (small, base, large) with Optimum Intel, Intel Neural Compressor and IPEX gives up to 4.5x lower latency and up to 4x higher throughput on 4th-gen Xeon CPUs compared with a bf16 PyTorch baseline. Accuracy loss stays small: under 0.3% on MTEB reranking and up to 1.55% on retrieval. The guide covers calibration with a qasper subset, loading the model with IPEXModel, and the benchmark setup (ipexrun, TCMalloc, single socket). It also shows how to plug the quantized models into fastRAG's QuantizedBiEncoderRetriever and QuantizedBiEncoderRanker for RAG indexing and reranking.

  • Introducing Optimum: The Optimization Toolkit for Transformers at Scale

    Hugging Face easyNovice

    Optimum is a new open source Hugging Face library that targets production performance for Transformer models by wrapping hardware-specific acceleration tooling built with hardware partners. Its first integration uses Intel Neural Compressor to quantize Transformers for Intel Xeon CPUs. Quantization is hard to do by hand: ops must be swapped for quantized kernels, quantize/dequantize nodes inserted, observers, schemes and int8/uint8/int16 types chosen, and accuracy loss balanced. Neural Compressor handles this through post-training, quantization-aware and dynamic quantization driven by a YAML config that can be stored on the Model Hub.

The quest for software engineering knowledge.

Look:
Layout: