../_images/logo-quic-on%40h68.png

AIMET examples

AIMET examples are Jupyter Notebooks that are intended to:

  • Familiarize you with the AIMET APIs

  • Demonstrate how to apply AIMET to a model

  • Teach you how to use AIMET quantization and compression techniques

For a discussion of quantization techniques, see AIMET model quantization.

For a discussion of compression techniques, see AIMET model compression.

For the API reference, see:

Browse the notebooks

The following tables provide links to viewable versions of the notebooks for AIMET quantization and compression features. Instructions after the tables describe how to run the notebooks.

Model Quantization Examples

Feature

PyTorch

TensorFlow

ONNX

QuantSim / Quantization-Aware Training (QAT)

Link

Link

Link (no training)

QAT with Range Learning

Link

Link

Cross-Layer Equalization (CLE)

Link

Link

Link

Adaptive Rounding (AdaRound)

Link

Link

Link

AutoQuant

Link

Link


Model Compression Examples

Feature

PyTorch

Channel Pruning

Link

Spatial SVD

Link

Spatial SVD + Channel Pruning

Link


Running the notebooks

To run the notebooks, follow the instructions below.

1. Run the notebook server

  1. Install the Jupyter metapackage using the following command. (Prepend the command with sudo -H if necessary to grant admin privilege.)

    python3 -m pip install jupyter
    
  2. Start the notebook server as follows:

    jupyter notebook --ip=* --no-browser &
    

    The command generates and displays a URL in the terminal.

  3. Copy and paste the URL into your browser.

  4. Install AIMET and its dependencies using the instructions in AIMET installation.

3. Run the notebooks

  1. Navigate to one of the following paths in the local repository directory and launch your chosen Jupyter Notebook (.ipynb extension):

    • Examples/torch/quantization/

    • Examples/torch/compression/

    • Examples/tensorflow/quantization/keras/

  2. Follow the instructions in the notebook to execute the code.