TorchAO: PyTorch-Native Training-to-Serving Model Optimization

Andrew Or, Apurva Jain, Daniel Vega-Myhre, Jesse Cai, Charles David Hernandez +8 more
7/21/2025
cs.LG

Official code: pytorch/ao (2,940 stars, PyTorch, last commit 2026-05-01).

Abstract

We present TorchAO, a PyTorch-native model optimization framework leveraging quantization and sparsity to provide an end-to-end, training-to-serving workflow for AI models. TorchAO supports a variety of popular model optimization techniques, including FP8 quantized training, quantization-aware training (QAT), post-training quantization (PTQ), and 2:4 sparsity, and leverages a novel tensor subclass abstraction to represent a variety of widely-used, backend agnostic low precision data types, including INT4, INT8, FP8, MXFP4, MXFP6, and MXFP8. TorchAO integrates closely with the broader ecosystem at each step of the model optimization pipeline, from pre-training (TorchTitan) to fine-tuning (TorchTune, Axolotl) to serving (HuggingFace, vLLM, SGLang, ExecuTorch), connecting an otherwise fragmented space in a single, unified workflow. TorchAO has enabled recent launches of the quantized Llama 3.2 1B/3B and LlamaGuard3-8B models and is open-source at https://github.com/pytorch/ao/.

View on arXivView PDF

Code Implementations(1)

pytorch/aoOfficial100%
PyTorch

PyTorch native quantization and sparsity for training and inference

2,940589C, C++Nov 3, 20235 months agoNOASSERTION
brrrcudadtypesfloat8inference+7 more

Cite this paper

@article{or2025torchao,
  title  = {TorchAO: PyTorch-Native Training-to-Serving Model Optimization},
  author = {Andrew Or and Apurva Jain and Daniel Vega-Myhre and Jesse Cai and Charles David Hernandez and Zhenrui Zheng and Driss Guessous and Vasiliy Kuznetsov and Christian Puhrsch and Mark Saroufim and Supriya Rao and Thien Tran and Aleksandar Samardžić},
  year   = {2025},
  eprint = {2507.16099},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.16099v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.16099.svg)](https://codeofpaper.com/paper/2507.16099)

Discussion