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.

AM69A: Convolution layer support with rectangular kernels

Part Number: AM69A


Tool/software:

Hi,

I noticed a difference between the documentation provided by edgeai_tidl_tools (edgeai-tidl-tools/docs/supported_ops_rts_versions.md at master · TexasInstruments/edgeai-tidl-tools · GitHub)

and the one I find in the file mmalib_cnn_convolve_row_ixx_ixx_oxx : 

In mmalib_cnn_convolve_row_ixx_ixx_oxx, I noticed rectangular kernels are not supported while in edgeai_tidl_tools, nothing is written about it : 

So, then, my question is what is the reason that rectangular kernels (e.g., 5*7) are not supported when configuring the use of kernels?

Thanks and regards,

Azer

  • Hi Azer,

    mmalib_cnn_convolve_row_ixx_ixx_oxx is the function that implements CNN style 2D convolution on the MMA, (TI's matrix accelerator).  It only natively supports the convolution shapes described in the documentation.  

    You are correct the same limitation could have been called out on edgeai-tidl-tools, but there are couple of options if you really need the rectangular filter size.  If using an open source runtime (i.e. ONNX),  you can keep the computation on the ARM (slower).  For more efficient computation, convert to a supported size.  For instance your 5x7 filter could be manipulated to be a 7x7 filter where the extra coefficient are set to zero (no retraining required!) and run on the MMA then. 

    Best,

    Will

  • Hi,

    Thanks your interesting answer.

    I attempted the following : For instance your 5x7 filter could be manipulated to be a 7x7 filter where the extra coefficient are set to zero (no retraining required!) and run on the MMA then. 

    However, the model's accuracy is significantly low (0.32). Could you tell me how you would have manipulated it to be a 7x7 filter?

    Do you have any tips or advice to improve this?

    Thanks and regards,

    Azer

  • Hi Azer,

    I would take your original model, before any processing by TI tools, and directly edit the model to change the 5x7 weights to 7x7 weights with zeros in the extra positions.  Then I would run the modified model through your existing framework and compare accuracy to verify that the accuracy is the same (there is no TI tools/processing being used in this).  Once that all works, I would pass the model through the TI tools.

    Let me know how it goes.

    Best,

    Will