This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-TDA4VM: Which calibration methods does tidl importer use?

  • Hi MingZhen; Thanks for the question, our development team will answer your questions. 

    Best regards

    Wen Li

  • Hi Mingzhen,

    Please refer to latest doc for quantization: https://github.com/TexasInstruments/edgeai-tidl-tools/blob/master/docs/tidl_fsg_quantization.md

    There are many classification method for quantization and the term varies in different framework. 

    Regards,

    Adam

  • If infer to NVIDIA https://arxiv.org/pdf/2004.09602, section 3.4 Calibration, TI's min and max calibration method doesn't match any of those three, do I miss something?

  • Hi 

    Please refer to the doc I mentioned before. TI provides these several calibration methods, among which the simple calibration may correspond to the "max" method defined by Nvidia. It needs careful cross compare to determine whether TI's methos can be rated with Nvidia. You can check the doc and source code if you are interested.

    B.1. Simple Calibration

    • This calibration can be enabled by setting accuracy_level = 0 during model compilation
      • Supports Power of 2 and Non Power of 2 scales for parameters, this can be controlled using advanced_options:quantization_scale_type parameter
      • Supports only power of 2 scales for feature maps
      • Scale selected based on min and max values in the given layer
      • Range for each feature maps are calibrated offline with few sample inputs
      • Calibrated range (Min and Mix) Values are used for Quantizing feature maps in target during inference (real time)
      • Observed accuracy drop less than 1% w.r.t floating point for many networks with 8-bits
        • For example models such as Resnets, SqueezeNet, VGG, etc ( especially models which don't use Depthwise convolution layers)

    B.2. Advanced Calibration

    • TIDL product provides some advance options for calibration as listed below:

    B.2.1. Advanced Bias calibration

    • This feature can be enabled by user by setting accuracy_level = 1 which is one of the optional parameter for model compilation. Typically no other parameter is required to be set because default parameters works for most of the cases. It is observed that using 50 or more number of images gives considerable accuracy boost.
    • This feature applies a clipping to the weights and update the bias to compensate the DC errors introduced because of quantization.
    • User can also experiment with following parameters related to this option if required:
      • advanced_options:calibration_iterations: Number of iteration to be used for bias calibration.
      • advanced_options:calibration_frames: Number of input frames to be used for bias calibration.

    B.2.2. Histogram based activation range collection

    • To enable this feature user needs to set accuracy_level = 9 and advanced_options:activation_clipping = 1/0 to enable/disable this feature.
    • This feature uses the histogram of feature map activation ranges to remove outliers which can affect the overall range. This may help in reducing the accuracy loss due to quantization in some of the networks.

    Regards,

    Adam