9.3.2.2. Enabling the Lightweight Layout Transform
Parameter |
Type |
Range |
Default |
|---|---|---|---|
channels |
int |
[1..CVEC] |
3 |
input_bus_width |
int |
> 8 |
48 |
pixel_fifo_depth |
int |
> 1 |
16 |
enable_bias_scale |
bool |
{true, false} |
TRUE |
input_type |
enum |
{F16, U8, U16} |
F16 |
Setting the Lightweight Layout Transform Parameters
- channels
The number of channels in the input feature. This value can be found by examining the input source.
- input_bus_width
The width of the input bus depends on the upstream data source. Consider it as a system-level consideration when building the application. Decide on the number of parallel pixels to the FPGA AI Suite IP. The resource utilization of the layout transform scales primarily with the number of parallel pixels, N. This is because the data conversion to FP16 and the application of bias and scale is done in parallel for each pixel, and thus the hardware is duplicated for each pixel. Each pixel has its own configurable-size exit FIFO for added elasticity.
- pixel_fifo_depth
The maximum number of transformed input feature queued in the FIFO downstream. The FIFO depth affects the resources usage since the number of exit FIFO scales with the number of parallel pixels.
Considering the scenario of single consumer and multiple producer case, each cycle the consumer (downstream) consumes from one exit FIFO, whereas the producers (lightweight layout transform pipelines) queue data to every exit FIFOs concurrently. If the exit FIFO depth is too shallow, then the producers saturate the FIFOs too quickly before the consumer can consume. Therefore, the FIFOs backpressure the upstream, which is undesirable. To avoid this constant backpressure, set a value at least larger than the number of parallel pixels, N.
- enable_bias_scale
Enables the IP to compute normalization for input features by adding bias and scaling.
- input_type
The data type for each element in the raw input pixel. For example, the input_type for 8-bit RGB pixel is U8.
Example Architecture File
enable_lightweight_layout_transform : true
# 5 pixels in parallel
lightweight_layout_transform_params {
channels : 3
input_bus_width : 240
input_type : F16
enable_bias_scale : true
}
Compile and Run IP That Uses the Lightweight Layout Transform
- dla_compiler
- To turn off folding, specify the --ffolding-option 0 option.
- dla_benchmark
- To turn off folding, specify the --folding_option 0 option.
When bias-and-scale is enabled in the layout transform, the bias and scale values are automatically extracted from the graph and set to the transform at runtime. The lightweight layout transform is enabled and tested in both streaming and external memory-based designs.