Compiling AI Engine Graph for Independent Partitions - 2025.2 English - UG1076

AI Engine Tools and Flows User Guide (UG1076)

Document ID
UG1076
Release Date
2025-11-20
Version
2025.2 English

The AI Engine supports column-based partitions. You can enable column-based partitions 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++ link stage, multiple partitions can be integrated, provided there is no overlap in the resource usage by the graphs in those partitions.

The following figure shows an example of an AI Engine with multiple partitions.

Figure 1. AI Engine Partitions

In the AI Engine array, a partition can be defined as follows:

<START_COLUMN>:<NUM_OF_COLUMN>:<PARTITION_NAME>

And passed to the Vitis command line using the following command:

v++ -c --mode aie --config <CONFIG_FILE.cfg>

Following is an example configuration (<CONFIG_FILE.cfg>):

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

This configuration restricts the compiled graph to columns 6 and 7, and names the partition pr0.

The compiler compiles each partition independently but with different locations inside the device. You can use the same AI Engine graph in different partitions. Multiple partition compilation outputs (for example, libadf0.a, libadf1.a…) are used at v++ link time.
Note: When multiple partitions overlap inside the device, v++ link reports an error on the conflict.
The host code differentiates the graphs by their partition names and graph names. Absence of an explicit enable-partition option is interpreted as a single partition comprising the entire AI Engine array. This partition overlaps (conflicts) with any other partitions at v++ link time.
The v++ link command can link multiple independent compilation results together. Following is an example of linking multiple independent compilation results:
v++ -l --platform ${PLATFORM} -t hw --config system.cfg -o ${XSA} libadf0.a libadf1.a libadf2.a libadf3.a
The partition names prefix the graph ports in the graphs. Following is an example of prefixing (in the configuration file for v++ linker):
[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 changes to pr0_Dataout0. Therefore there are no conflicts with port names from other partitions.

The v++ package command merges 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 libadf3.a

Specify multiple libadf.a files for v++ link and v++ package, in the same order. Specifying the files in the same order is important because the order affects metadata generation and can impact the application execution.

For information about packaging PL-only XCLBIN and AI Engine-only XCLBIN for runtime control, refer to Generate AI Engine-only and PL-only XCLBIN.

For information about how v++ works, see the Vitis Reference Guide (UG1702).

For information about using XRT API to control and reload partitions in the host code, see Runtime Control and Reload of AI Engine Partitions.

Note: The Analysis view of the Vitis Unified IDE can open only one partition compilation result at a time. You can analyze event trace results in Vitis Unified IDE with only one partition at a time. You can build the Bare-metal application with one partition result at a time.