What is AIMET?¶
AIMET (AI Model Efficiency Toolkit) is an open-source Python library that quantizes trained PyTorch and ONNX models so they run faster and use less memory and power on edge devices such as phones, laptops, and cars, while keeping accuracy as close as possible to the original model.
You give AIMET a trained floating-point model and a small amount of representative data. AIMET gives you back a quantized model, ready to compile and run on target hardware.
Why quantize?¶
Trained models usually store weights and compute activations in 32-bit floating point. Quantization represents them with fewer bits, for example 8-bit or 16-bit integers. Compared to 32-bit floating point, 8-bit weights take a quarter of the memory, and integer math runs faster and uses less power on hardware accelerators.
The cost is accuracy. Each value is rounded to a coarser grid, and that rounding error accumulates through the network. AIMET lets you measure that loss before you deploy and provides techniques to recover it, so you can choose the lowest precision your accuracy target allows.
How AIMET works¶
Simulate. AIMET wraps your model in a quantization simulation (
QuantizationSimModel) that inserts quantizers on weights and activations. A short calibration pass over representative data, typically 500 to 1,000 samples, computes the quantization parameters (encodings).Evaluate. The simulated model runs on your CPU or GPU and behaves like the quantized model will on device. Run your existing evaluation pipeline on it to see the accuracy at the chosen precision.
Improve. If accuracy falls short, apply AIMET’s techniques, then evaluate again:
Post-training quantization (PTQ) techniques adjust weights and encodings using calibration data only, with no training. Examples include AdaRound, SeqMSE, and AdaScale.
Mixed precision keeps the few layers that are sensitive to quantization at higher precision and quantizes the rest more aggressively.
Quantization-aware training (QAT) fine-tunes the model with quantization in the loop. Use it when PTQ and mixed precision are not enough.
Export. AIMET exports the result as an ONNX model plus an encodings file, or as a single ONNX QDQ model with
QuantizeLinearandDequantizeLinearnodes in the graph.
You then deploy the exported model with Qualcomm® AI Hub, the Qualcomm® AI Runtime (QAIRT) SDK, or ONNX Runtime.
For a step-by-step guide to picking precisions and techniques, see the quantization workflow.
What you can do with AIMET¶
Capability |
What it gives you |
|---|---|
Accuracy of the quantized model at any weight/activation precision (for example W8A8, W8A16, W4A16), measured on your own hardware before deployment. |
|
Calibration plus accuracy-recovery techniques such as AdaRound, SeqMSE, AdaScale, and SpinQuant, using unlabeled data and no training. |
|
Per-layer precision chosen automatically (Lite-MP, AMP) or by hand, to balance accuracy and latency. |
|
Low-Power Blockwise Quantization (LPBQ) for 4-bit weights, used by large language models. |
|
Per-layer sensitivity reports that show which layers lose the most accuracy. |
|
Training with quantization in the loop, for models that need it ( |
|
Tested end-to-end recipes for popular large language models, with accuracy results. |
Choose a package¶
AIMET ships as two Python packages. Each one takes a model in its own framework’s format.
|
|
|
|---|---|---|
Input model |
ONNX model ( |
PyTorch model ( |
Best for |
Post-training quantization and fast experiments |
Quantization-aware training, or staying in PyTorch |
Unique features |
Lite mixed precision, ONNX QDQ conversion of existing encodings |
QAT, OmniQuant, batch norm re-estimation, model compression |
Install |
|
|
Tip
Start with aimet-onnx. It has the fastest turnaround for calibration, mixed precision,
and PTQ techniques. For a PyTorch model, export it to ONNX with torch.onnx.export first.
Move to aimet-torch for QAT only if PTQ and mixed precision don’t meet your accuracy
target.
Supported platforms¶
AIMET runs on Linux, Windows, and macOS with Python 3.10 or later (tested through 3.13). NVIDIA GPUs are optional and speed up calibration and optimization. Support varies by package and architecture; see Installation for the full matrix.
Next steps¶
Quick start: install AIMET and quantize your first model.
Quantization workflow: a recommended path from first simulation to a deployable model.
Example notebooks: end-to-end examples you can run.