9.3. Transforming Input Data Layout
The FPGA AI Suite provides two hardware input layout transforms: a full/standard transform that supports input folding for any feature, stride, and padding values. and a lightweight transform that exchanges folding operating support for FPGA area savings.
The lightweight layout transform also has additional restrictions on the input bus width (must be a multiple of the pixel width) to reduce resource usages.
In both the standard and lightweight input layout transforms, only input tensors with HWC ordering are supported.The data elements can be in either FP16, U8, or U16 format.
- Standard input layout transform
- The standard layout transform hardware folds the input tensor and converts it to the CHWCvec format as described in Input Feature Tensor In-Memory Format. If configured for U8 or U16 inputs, the data elements are also converted to FP16 format before tensors are sent downstream for inference. Bias and scale values are applied to the input within the layout transform hardware module if required by the graph.
- Lightweight input layout transform
- The lightweight layout transform converts tensors to CHWCvec order without applying the folding operation. The data is converted to FP16. Bias and scale values are applied to the input within the lightweight layout transform hardware module if required by the graph.
To avoid input slicing when either hardware layout transform is enabled, size the stream buffer to accommodate the entire input feature.
Use the hardware layout transform with the --ffolding_option 1 compiler option described in Compilation Options (dla_compiler Command Options). The layout transform hardware does not currently support 5-dimensional input tensors.