aimet_onnx.lite_mp

Top-level API

aimet_onnx.lite_mp.flip_layers_to_higher_precision(sim, layer_sensitivity_dict, percent_to_flip=10, override_precision=float16)[source]

Given a sim object and a layer-sensitivity dictionary, flip a given percentage of the layers to higher precision.

Parameters:
  • sim (QuantizationSimModel) – QuantizationSimModel instance initialized with the base precision

  • layer_sensitivity_dict (Dict[str, float]) – Dict of (layer_name: sqnr_metric) that is output from analyze_per_layer_sensitivity

  • percent_to_flip (int) – Percentage of layers to flip

  • override_precision (qtype) – Precision to sets layers to. At present, either int16 (w16a16) or float16 are supported.