Installation

This page provides instructions for installing the latest version of AIMET across supported frameworks: ONNX, PyTorch.

Please select one installation method that best suits your environment:

PyPI

Install AIMET from PyPI

pip install aimet-onnx
# Optional: To accelerate quantization with CUDA
pip install onnxruntime-gpu
pip install aimet-torch

Alternative packages

Install the latest version of AIMET for supported framework and compute platforms including ONNX and PyTorch from the .whl files hosted at https://github.com/qualcomm/aimet/releases.

Supported platforms

Both packages support Python 3.10+ (tested through 3.13). The table below shows how each package is obtained per platform.

Platform

aimet-torch

aimet-onnx

Linux (x86-64, Ubuntu 22.04 and above)

Prebuilt wheel

Prebuilt wheel

Windows

Prebuilt wheel

Prebuilt wheel (x86-64, ARM64)

macOS (Apple Silicon)

Prebuilt wheel

Build from source

Note

aimet-torch is pure Python (py310-none-any), so one wheel installs on every platform, though it is CI-tested only on Linux. aimet-onnx ships a compiled extension, so it has per-platform wheels. All wheels use the CPython stable ABI (cp310-abi3) and run on Python 3.10+ (tested through 3.13).

CUDA (GPU) acceleration

CUDA 12.x is validated for aimet-torch and aimet-onnx on Linux (x86-64). Windows and macOS builds are CPU-only. A single wheel per platform serves both CPU and GPU users, so there is nothing CUDA-specific to pick at install time. GPU acceleration additionally requires:

  • Nvidia GPU card (Compute capability 5.2 or later)

  • Nvidia driver version 455 or later (using the latest driver is recommended; both CUDA and cuDNN are supported)

For aimet-onnx, the wheel depends on onnxruntime (CPU). To run on GPU, install onnxruntime-gpu yourself:

pip install onnxruntime-gpu

For aimet-torch, install the CUDA build of torch from https://pytorch.org/get-started/locally/ if pip did not already resolve one.

Choose and install a package

Use one of the following commands to install AIMET based on your choice of framework and platform. All wheels below use the CPython stable ABI (cp310-abi3) and install on any Python 3.10+ interpreter without needing a version-specific URL.

Linux (x86-64):

python3 -m pip install https://github.com/qualcomm/aimet/releases/download/2.41.0/aimet_onnx-2.41.0-cp310-abi3-manylinux_2_34_x86_64.whl
# Optional: To accelerate quantization with CUDA
python3 -m pip install onnxruntime-gpu

Windows (x86-64), CPU only:

python -m pip install https://github.com/qualcomm/aimet/releases/download/2.41.0/aimet_onnx-2.41.0-cp310-abi3-win_amd64.whl

Windows (ARM64), CPU only:

python -m pip install https://github.com/qualcomm/aimet/releases/download/2.41.0/aimet_onnx-2.41.0-cp310-abi3-win_arm64.whl
python3 -m pip install https://github.com/qualcomm/aimet/releases/download/2.41.0/aimet_torch-2.41.0-py310-none-any.whl

Verifying the installation

Verify your installation using the following instructions.

Step 1: Handle imports and other setup.

import numpy as np
from aimet_common import libpymo

x = np.random.randn(100)

quant_scheme = libpymo.QuantizationMode.QUANTIZATION_TF
analyzer = libpymo.EncodingAnalyzerForPython(quant_scheme)

Step 2: Compute scale and offset.

bitwidth = 8
is_symmetric, strict_symmetric, unsigned_symmetric = True, False, True
use_cuda = False
analyzer.updateStats(x, use_cuda)
encoding, _ = analyzer.computeEncoding(bitwidth, is_symmetric, strict_symmetric, unsigned_symmetric)

print(f'Min: {encoding.min}, Max: {encoding.max}, Scale(delta): {encoding.delta}, Offset: {encoding.offset}')

The encodings values should be similar to the one shown below.

Min: -3.3734087606114667, Max: 3.3470540046691895, Scale(delta): 0.026354755942277083, Offset: -128.0

Step 3: Perform quantize-dequantize.

quantizer = libpymo.TensorQuantizationSimForPython()
out = quantizer.quantizeDequantize(x,
                                   encoding,
                                   libpymo.RoundingMode.ROUND_NEAREST,
                                   bitwidth,
                                   use_cuda)
print(out)

The quantized-dequantized output should be similar to the one shown below.

[-1.291383    0.36896658  1.0541903  -1.2123188  -2.2137995   1.2650282
 -0.23719281  0.10541902  0.50074035 -0.05270951 -0.94877124  0.
  0.10541902  0.52709514 -0.7115784   2.2401543  -0.34261182  2.0293162
  0.34261182 -0.6061594  -0.36896658 -0.6588689  -1.5022211  -0.10541902
 -1.4758663  -0.8433522   0.7115784  -0.23719281  0.44803086 -0.94877124
  0.18448329 -1.0014807   0.55344987 -0.13177378  0.15812853 -0.7115784
 -0.4216761   1.1068997  -0.07906426  1.6603496   0.55344987 -0.47438562
 -0.6325141   0.4216761  -1.4495116   1.5549306  -0.6325141  -1.2123188
  0.50074035  1.291383    0.07906426 -1.2123188  -2.0820258   1.0014807
 -0.18448329 -0.4216761   1.0278355  -0.21083805  0.52709514  1.6867044
 -0.68522364  1.0278355  -0.55344987 -0.26354757  0.10541902 -0.02635476
  0.6588689  -0.34261182 -0.05270951  3.347054    0.07906426 -1.080545
 -0.57980466  1.4231569  -0.6588689   1.291383   -0.13177378  0.31625706
 -0.36896658  0.05270951 -0.81699747 -1.4231569  -1.1068997  -0.68522364
  0.7115784  -1.2650282  -0.7115784   0.50074035  0.28990233 -0.73793316
  0.21083805  2.4246376  -0.15812853  0.52709514 -0.02635476 -0.13177378
 -1.8711877   0.4216761  -0.55344987 -0.76428795]

Old versions

You can also view the release notes for older AIMET versions at https://github.com/qualcomm/aimet/releases. Follow the documentation corresponding to that release to select and install the appropriate AIMET package.

Building from source

For most users, the recommended way to install AIMET is by using the pre-built package available through the pip package manager, as it provides the most straightforward and reliable experience.

However, if you prefer to work with the latest source code or plan to contribute to AIMET development, you’ll need to build it from source. To do so, follow the steps outlined for building the latest AIMET codebase manually, see Build AIMET from source.