TorchAO

TorchAO

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

TorchAO (the pytorch/ao repository) is PyTorch’s native architecture optimization library, providing quantization and sparsity techniques for both training and inference. Maintained by the PyTorch team, it lets you compress large models โ€” especially LLMs such as Llama โ€” with int8, int4 and float8 formats so they run faster and use far less memory, without leaving the PyTorch ecosystem. The project has around 3,000 stars on GitHub and is under very active development, with updates continuing through 2026.

Overview

Quantization libraries often sit awkwardly outside the framework, forcing custom kernels and fragile export steps. TorchAO takes the opposite approach: its techniques are built on native PyTorch primitives and compose with torch.compile, so a quantized model still behaves like a normal PyTorch model. It covers post-training quantization for inference, quantization-aware training for accuracy-critical fine-tuning, and cutting-edge float8 training recipes used to speed up large-scale LLM training. The same APIs also support sparsity and newer low-precision data types such as MX formats, making TorchAO the reference toolkit for efficient PyTorch deployment on server, desktop and edge hardware. It is developed in the open alongside PyTorch itself, so new hardware and model architectures are typically supported quickly.

Key Features

  • Post-training quantization to int8 and int4 for faster, smaller LLM inference
  • Float8 training and inference support for modern GPUs
  • Quantization-aware training (QAT) to recover accuracy when fine-tuning
  • Built on native PyTorch APIs and fully compatible with torch.compile
  • Sparsity and emerging low-precision formats, including MX dtypes
  • Reference workflows for popular open models such as the Llama family

๐Ÿ’ณ Pricing

TorchAO is free and open source as part of the PyTorch project. There are no licenses to buy and no hosted version โ€” the library runs entirely within your own PyTorch environment.

Who Is It For

TorchAO is aimed at ML engineers and researchers who train or serve PyTorch models and need production-grade quantization to cut inference cost, memory footprint or training time.

๐Ÿš€ Visit TorchAO Official Site

๐Ÿšฉ Report an issue