TLDRocket
Sign in

Quanto: a PyTorch quantization backend for Optimum

Hugging Face

Hugging Face dropped Quanto, a new quantization backend for Optimum that shrinks PyTorch models to run cheaper and faster. It works across CPUs, GPUs, and Apple chips, and plugs straight into transformers — no fiddly setup required.

Based on reporting by Hugging Face — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Quantization has always been one of those techniques everyone agrees is useful and almost nobody enjoys implementing. Squeeze a model's weights and activations down from 32-bit floats to 8-bit integers, or even smaller, and you cut memory use dramatically while unlocking faster math on the right hardware. The problem has never been the idea. It's been the tooling: a scattered pile of libraries, each tied to specific architectures or devices, most of them refusing to talk to each other.

Hugging Face's answer is Quanto, a quantization backend built for its Optimum library. Instead of chasing the latest LLM-specific trick, Quanto goes for something more boring and more useful: simple, general-purpose quantization primitives that work on basically anything you throw at them. Vision models, speech models, language models, it doesn't care. It runs in eager mode, so you don't need a traceable model, and it works identically on CUDA, MPS, and plain old CPU.

The workflow is refreshingly linear. You quantize a model with a single function call, optionally calibrate it by running representative data through to capture activation ranges, then optionally fine-tune it if accuracy drops too much — basically a lightweight quantization-aware training step. After that you freeze the weights into their quantized form and serialize the whole thing with Safetensors, saving a quantization map alongside so you can reload and requantize later on any device you like, GPU included.

On the hardware side, Quanto supports int2, int4, int8, and float8 weights, plus int8 and float8 activations, and it can accelerate matrix multiplications in combinations like fp16-int4 or bf16-int8 on CUDA. Hugging Face tested it on Llama 3.1 8B on an A10 GPU and published latency and accuracy numbers, though notably without applying post-training optimization methods like AWQ or HQQ yet — so there's clearly more performance left on the table.

What matters most for actual users is that Quanto is already wired into transformers through a QuantoConfig class, meaning a single argument to from_pretrained gets you a quantized OPT model or a quantized Whisper model, no separate pipeline required. It even tolerates torch.compile, provided you skip dynamic activation quantization. Hugging Face is openly asking for help with optimized kernels and PTQ optimizers next, which suggests this is version one of something meant to grow rather than a finished product.

My take — AI-written commentary, not fact-checked reporting

I like this precisely because it's unglamorous — no benchmark-chasing claims about matching GPT-4 on a phone, just a cleaner plumbing layer for a problem every open-model deployment eventually hits. The real win of the open ecosystem isn't the flashiest model of the week, it's boring infrastructure like this making inference actually affordable on hardware people already own, and that's a far bigger deal for open-weight adoption than another leaderboard entry.

Read more about this at: Hugging Face

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.