Accelerate your models with π€ Optimum Intel and OpenVINO
Optimum Intel now integrates OpenVINO, letting Transformers models run on OpenVINO Runtime across Intel processors and be quantized with the Neural Network Compression Framework (NNCF). A walkthrough applies post-training static quantization to a ViT image classifier fine-tuned on food101, using 300 calibration samples, then exports to OpenVINO IR and loads the result via OVModelForImageClassification pipelines. The quantized model shrinks 3.8x (344MB to 90MB) and cuts per-sample latency 2.4x (98ms to 41ms) with no measurable accuracy loss (87.6). Warm up the model before benchmarking, because compilation happens on the first inference. Encoder-decoder quantization is not yet supported.
Related posts
- Introducing Optimum: The Optimization Toolkit for Transformers at Scale
Hugging Face easyNoviceOptimum 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.
- Intel and Hugging Face Partner to Democratize Machine Learning Hardware Acceleration
Hugging Face mediumAdeptIntel has joined Hugging Face's Hardware Partner Program, and the two are collaborating on Optimum Intel, an open-source library built on Intel Neural Compressor that applies quantization, pruning and distillation to Transformer models on Xeon CPUs. A worked example applies post-training dynamic quantization to a DistilBERT review classifier with a 5% tolerable accuracy loss and up to 10 tuning trials. The run converts all 38 Linear and 2 Embedding operators to INT8, dropping accuracy from 0.574 to 0.546 while making evaluation 1.34x faster.
- Accelerated Inference with Optimum and Transformers Pipelines
Hugging Face mediumAdeptOptimum 1.2 adds inference support via ONNX Runtime with ORTModelForXxx classes that drop into Hugging Face Transformers pipelines in place of AutoModelForXxx. An end-to-end tutorial converts deepset/roberta-base-squad2 to ONNX, applies graph optimization (operator fusion, constant folding) with ORTOptimizer, then dynamic int8 quantization with ORTQuantizer targeting AVX512-VNNI on an m5.xlarge. Quantization shrinks the model from 473MB to 292MB while keeping 99.61% of original accuracy on SQuAD v2 (F1 81.83 vs 82.15), and latency is then benchmarked at sequence length 128.
- Blazing Fast SetFit Inference with π€ Optimum Intel on Xeon
Hugging Face mediumAdeptPost-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%.
- Get your VLM running in 3 simple steps on Intel CPUs
Hugging Face mediumAdeptSmolVLM2-256M can run locally on Intel CPUs by converting it to OpenVINO IR with Optimum Intel, quantizing it, and running generation, with optional Intel GPU offload via device="gpu". Two post-training options are covered: 8-bit weight-only quantization, and a mixed setup that applies calibrated static quantization to the vision encoder and weight-only quantization to the language model. On a Core Ultra 7 265K, converting to OpenVINO cut time to first token from 5.15s to 0.42s and raised decoding throughput from 0.7 to 47 tokens/s. Adding 8-bit weight-only quantization pushed TTFT to 0.25s and throughput to 64 tokens/s.