AIMET ONNX Cross Layer Equalization APIs

Introduction

AIMET functionality for Cross Layer Equalization has 3 features-
  • BatchNorm Folding

  • Cross Layer Scaling

  • High Bias Fold

Cross Layer Equalization API

The following API performs BatchNorm fold followed by Cross Layer Scaling followed by High Bias Fold.

Note: High Bias fold will not happen when the below API is used, if the model does not have BatchNorm layers

API for Cross Layer Equalization


Code Example

Required imports


Cross Layer Equalization in auto mode

def cross_layer_equalization():
    onnx_model = Model()
    equalize_model(onnx_model)