TorchAO is a PyTorch library for applying advanced optimization (AO) techniques, primarily quantization and sparsity, to deep learning models running on GPUs. It focuses on performance acceleration through low-precision kernels, mixture-of-experts (MoE) optimizations, and quantization-aware training (QAT). The current version is 0.17.0, with new versions and significant features released frequently, often monthly.
pip install torchaoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a simple PyTorch model and apply a predefined post-training quantization recipe using `torchao.quantization.quantize_`.
Consult the `torchao` documentation for versions 0.9.0+ for the new `quantize_` API, which now typically requires a `Quantizer` object (e.g., from a predefined recipe or a custom `QuantConfig`).
Refer to the latest `torchao` documentation (v0.16.0+) for current recommended configurations and quantization options. Update your code to use the officially supported APIs.
Avoid using `torchao.prototype` modules in production-critical code. If used, be prepared for frequent updates and potential breaking changes with new `torchao` releases.
Before deployment, verify your CUDA version and GPU architecture against `torchao`'s requirements for the specific features you intend to use. Ensure your environment matches the recommendations for optimal results.