Compile AI Engine Graph for Independent Partitions - 2024.1 English

AI Engine Tools and Flows User Guide (UG1076)

Document ID
UG1076
Release Date
2024-06-27
Version
2024.1 English

The AI Engine supports column-based partitions. This is enabled by creating independent graphs that can be compiled and simulated separately. Each graph is mapped to a specific column or a contiguous set of columns on the AI Engine array. During the v++ linker stage, multiple graphs can be integrated together, provided there is no overlap in the resource usage by the graphs.

A partition in the AI Engine array can be defined as <START_COLUMN>:<NUM_OF_COLUMN>:<PARTITION_NAME>, and passed to the Vitis command line using v++ -c -mode aie --config <CONFIG_FILE.cfg>:

[aie]
enable-partition=6:2:pr0

This will restrict the compiled graph into column 6 and 7, and the partition is named as pr0.

Each graph is compiled independently. The graphs are differentiated by their locations and partition names. Absence of an explicit enable-partition option is interpreted as a single partition comprising the entire AI Engine array, which will overlap (that is, conflict) with any other partitions at v++ link time.

The v++ linker can link multiple independent compilation results together(for example, named as libadf0.a, libadf1.a, …).

The graph ports in the graphs are prefixed with the partition name, for example:
[connectivity]
stream_connect=ai_engine_0.pr0_Dataout0:s2mm_1.s
stream_connect=datagen.out:ai_engine_0.pr0_Datain0
Note: The port name Dataout0 is renamed as pr0_Dataout0. Thus, there will be no conflicts with port names from other partitions.

The v++ packager is called to merge multiple compilation results together, such as:

v++ -p -t hw -f ${PLATFORM} \
		--package.rootfs ${ROOTFS} \
		--package.kernel_image ${IMAGE} \
		--package.boot_mode=sd \
		--package.image_format=ext4 \
		--package.defer_aie_run \
		--package.sd_file ${HOST_EXE} \
		${XSA} \
		libadf0.a libadf1.a libadf2.a

When specifying multiple libadf.a files for v++ linker and v++ packager, make sure that they are specified with the same order, because the order will affect the metadata generation and might impact the application execution.

For more information about how v++ works, see the Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393).

The graph name used in the PS host code for XRT API is prefixed with the partition name, for example:

auto ghdl=xrt::graph(device,uuid,"pr0_gr");//partition name = "pr0", graph name = "gr"

For more information about how to use XRT API in the host code, see Programming the PS Host Application.

Note: The Analysis view of the Vitis Unified IDE, Vitis Unified IDE components, and event trace have limited support on independent partitions. The Bare-metal flow does not support independent partitions.