---
title: "Introducing Optimum: The Optimization Toolkit for Transformers at Scale"
description: "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."
url: "https://swe.quest/articles/introducing-optimum-the-optimization-toolkit-for-transformers-at-scale-a074b17981960e1a"
canonical: "https://huggingface.co/blog/hardware-partners-program"
source: "Hugging Face"
published: "2021-09-14"
difficulty: "easy"
kind: "Announcement"
reading_minutes: 4
tags: ["inference","machine-learning","open-source","hardware"]
---

# Introducing Optimum: The Optimization Toolkit for Transformers at Scale

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2021-09-14, 4 min read, Announcement. Original: [https://huggingface.co/blog/hardware-partners-program](https://huggingface.co/blog/hardware-partners-program)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)

## Prerequisites

- Transformer models
- model quantization basics ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))

## Keywords

Optimum, Hugging Face Transformers, Intel Neural Compressor, Intel Xeon, quantization, torch.fx, PyTorch

## Related posts

- [Intel and Hugging Face Partner to Democratize Machine Learning Hardware Acceleration](https://swe.quest/articles/intel-and-hugging-face-partner-to-democratize-machine-learning-hardware-0de59c0019e6704c.md): Hugging Face · 2022-06-15 · Medium · 7 min read · Inference & serving, Machine learning, Performance engineering, Hardware
  Intel 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.
- [Accelerate your models with 🤗 Optimum Intel and OpenVINO](https://swe.quest/articles/accelerate-your-models-with-optimum-intel-and-openvino-6481f69a8bf224aa.md): Hugging Face · 2022-11-02 · Medium · 5 min read · Inference & serving, Python, Hardware, Computer vision
  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).
- [Accelerated Inference with Optimum and Transformers Pipelines](https://swe.quest/articles/accelerated-inference-with-optimum-and-transformers-pipelines-9ff6245f88a35ca0.md): Hugging Face · 2022-05-10 · Medium · 12 min read · Inference & serving, Python, Performance engineering, Machine learning
  Optimum 1.2 adds inference support via ONNX Runtime with ORTModelForXxx classes that drop into Hugging Face Transformers pipelines in place of AutoModelForXxx.
- [Blazing Fast SetFit Inference with 🤗 Optimum Intel on Xeon](https://swe.quest/articles/blazing-fast-setfit-inference-with-optimum-intel-on-xeon-804c53c4c80ba1a3.md): Hugging Face · 2024-04-03 · Medium · 6 min read · Inference & serving, Performance engineering, Hardware, Python
  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.
- [Quanto: a PyTorch quantization backend for Optimum](https://swe.quest/articles/quanto-a-pytorch-quantization-backend-for-optimum-8330ba5aea428b63.md): Hugging Face · 2024-03-18 · Medium · 5 min read · Inference & serving, Python, Machine learning, Open source
  Quanto is a PyTorch quantization backend for Optimum that works in eager mode on any device (CPU, CUDA, MPS), supports int2/int4/int8/float8 weights and int8/float8 activations, and accelerates int8-int8, fp16-int4, bf16-int8 and bf16-int4 matmuls on CUDA.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
