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-AM62A-LP: [edgeai-tidl-tool] AM62A Convolution with K3S1P0 has low accuracy

Part Number: SK-AM62A-LP

Hi, friends,

My target is AM62A. By obtaining the trace and comparing the results of each layer between the ONNX model and the TIDL model, I noticed that the convolution with a kernel size of 3, stride of 1, and padding of 0 (K3S1P0) has relatively low accuracy.

My ONNX model is 

  My TIDL SVG is

The results of cosine similarity are shown in the above figure.

Even after changing the features of these layers to 16-bit, I still couldn't achieve good results. Can you give me some suggestions to improve the accuracy?

Best Regards

Henry

  • Hi Henry,

    It sounds like you were able to compile successfully and run on the target. I assume you were setting the debug_level parameter in the options to 3 or higher to obtain these traces make the comparisons. Good idea to use cosine similarity here - thank you for providing this data.

    Some questions:

    1. Is this entire model being compiled into a singular subgraph? The runtimes_visuzliation.svg in the artifacts/tempDir should show large boxes around a set of nodes when there are more than 1 subgraph. Multiple subgraphs means some layers will have to run on Arm, which we always want to avoid to obtain best inference speed.

    2, What compilation settings were you using for this network? How many calibration frames and iterations?

    3. I see the cosine similarity is substantially higher after the convolution vs. the flatten and innerproduct layers. Are previous cosine similarities closer to that convolution (0.999 of higher?)

    One good way to check the model is to use a specific image as one of the calibration frames, and use that as the input to the compiled model. This should give the best possible similarity between the FP and INT8 compiled model

    Best,

    Reese

  • Hi, Reese

    1. Yes, The model can be compiled into a singular subgraph on TIDL

    2. The compilation settings are

    accuracy_level = 1
    tensor_bits = 8
    calibration_frames50
    calibration_iterations = 50
    output_feature_16bit_names_list = "" # I set  layer 167/168/169/170
    quantization_scale_type = 0
    high_resolution_optimization = 0
    mixed_precision_factor = -1
    quantization_scale_type = 0
    pre_batchnorm_fold = 1
    3. The lowest similarity of some depth-wise convolutions in previous layers is 0.947. Normal convolutions are higher than depth-wise convolutions.
         In the above .svg diagram, layer 166 is a normal convolution, and layer 167 is a depth-wise convolution.
    I used one image from the calibration set as the input for the model ,obtained the results for both the floating-point ONNX model and the INT8 model using TIDL. Afterwards, I calculated the cosine similarity.

    Best Regards

    Henry