AIMET PyTorch Quantization APIs

aimet_torch

Important

aimet_torch package is planned to be upgraded to aimet_torch.v2 with more flexibile, extensible, and PyTorch-friendly user interface! In a future release, the core APIs of aimet_torch will be fully replaced with the equivalents in aimet_torch.v2. For more information, please refer to aimet_torch.v2 API reference.

In order to make full use of AIMET Quantization features, there are several guidelines users are encouraged to follow when defining PyTorch models. AIMET provides APIs which can automate some of the model definition changes and checks whether AIMET Quantization features can be applied on PyTorch model.

Users should first invoke Model Preparer API before using any of the AIMET Quantization features.
AIMET Quantization for PyTorch Models provides the following functionality.
If a user wants to use Multi-GPU with CLE or QAT, they can refer to:

API Reference


aimet_torch.v2

Introducing aimet_torch v2, a future version of aimet_torch with more powerful quantization features and PyTorch-friendly user interface!

What’s New

These are some of the powerful new features and interfaces supported in aimet_torch.v2

Backwards Compatibility

Good news! aimet_torch v2 is carefully designed to be fully backwards-compatibile with all previous public APIs of aimet_torch. All you need is drop-in replacement of import statements from aimet_torch to aimet_torch.v2 as below!

-from aimet_torch.v1.quantsim import QuantizationSimModel
+from aimet_torch.v2.quantsim import QuantizationSimModel

-from aimet_torch.v1.adaround.adaround_weight import Adaround, AdaroundParameters
+from aimet_torch.v2.adaround import Adaround, AdaroundParameters

-from aimet_torch.v1.seq_mse import apply_seq_mse
+from aimet_torch.v2.seq_mse import apply_seq_mse

-from aimet_torch.v1.quant_analyzer import QuantAnalyzer
+from aimet_torch.v2.quant_analyzer import QuantAnalyzer

All the other APIs that didn’t changed in or are orthogonal with aimet_torch.v2 will be still accessible via aimet_torch namespace as before.

For more detailed information about how to migrate to aimet_torch.v2, see aimet_torch.v2 migration guide

API Reference