MMALIB User Guide
MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX

Introduction

Kernel for computing CNN-style 2D convolution using column major data ordering on the input and output feature maps. This approach computes more quickly if filter grouping is chosen such that Ni=No=1, or if filter grouping is chosen such that NiFrFc < MMA_SIZE, otherwise use regular convolution method MMALIB_CNN_convolve_row_ixX_ixX_oxX. This kernel is also referred to as depth-wise convolution.

The kernel is designed to process a pair of MMA-wide columns at a time, although processing a single column is supported. These two columns are typically adjacent columns in the same input feature map, although provisions are made in the interface for the two columns to come from separate input feature maps.

On C7100 devices, this kernel requires that the input feature maps are padded before they are passed to the kernel whereas other devices support padding inside this kernel.

This kernel differs from MMALIB_CNN_convolve_col_smallNo_highPrecision in that it requires all scale, shift and bias values to be the constant across all groups called at the same time. This restriction enables the same amount of input data to be processed in fewer cycles.

The input data for this kernel consists of the filter coefficients and the input feature maps, while the output is the output feature maps. The kernel requires the filter coefficients to be preprocessed and stored in a custom arrangement prior to calling the kernel execute function. This reordering can be done offline (more efficient) or at runtime. MMALIB provides the utilities in MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX_reorderWeights to generate this reordering (src0) and the associated MMALIB_bufParams2D_t struct (src0_addr).

The input feature map memory arrangement is flexible and is described by the parameters illustrated in the the figure below. Note that the input feature maps for each groups must be vertically stacked on top of each other as there is no parameter to control the offset between groups.

The output feature map is described by the parameters illustrated in the the figure below.

Sub Modules

 MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX_reorderWeights
 MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX requires that the weights be preprocessed into a specific arrangement. The functions in this module perform that preprocessing and other associated tasks.