Home

Awesome

DPU on PYNQ

This repository holds the PYNQ DPU overlay. Specifically, the Vitis AI DPU is included in the accompanying bitstreams with example training and inference notebooks ready to run on PYNQ enabled platforms. Steps are also included to rebuild the designs in Vitis and can be ported onto PYNQ-enabled Zynq Ultrascale+ boards.

This release of DPU-PYNQ supports PYNQ 3.0 and Vitis AI 2.5.0.

Board Support

DPU-PYNQ is available for a wide range of boards and devices, some of which may not have official PYNQ images available, however the platforms and overlays can still be used in a variety of custom accelerator applications.

PlatformDPU ArchitectureNumber of coresVerified
KR260 SOMB40961Yes
KV260 SOMB40961Yes
Pynq-ZUB40961Yes
RFSoC2x2B40962Yes
RFSoC4x2B40962Yes
Ultra96v2B16001Yes
ZCU104B40962Yes
ZCU111B40962Yes
ZCU208B40962Yes
Genesys ZU-5EVB40961
T1 Telco RFSoCB40962
T1 Telco MPSocB40962
TySOM-3A-ZU19EGB40962
TySOM-3-ZU7EVB40962
Ultra96v1B16001
UltraZed-EGB40961
ZCU102B40962
ZCU106B40962
ZCU1285B40962
ZCU216B40962Yes
ZUBoard-1CGB8001

DPU overlays for most boards have been built using the B4096 architecture with 1 or 2 cores, compatible with the KV260/ZCU102/ZCU104 models in the Vitis AI Model Zoo. For a selection of smaller boards, like the Ultra96 and ZUBoard-1CG custom arch.json files are provided that will allow you to compile .xmodel files for those boards.

Quick Start

1. Install

To install pynq-dpu on your PYNQ-enabled board, in the Jupyter Lab terminal, simply run:

pip3 install pynq-dpu --no-build-isolation

Then go to your jupyter notebook home folder and fetch the notebooks:

cd $PYNQ_JUPYTER_NOTEBOOKS
pynq get-notebooks pynq-dpu -p .

This will make sure the desired notebooks show up in your jupyter notebook folder.

1.b [Optional] Install from ssh/serial

If you are installing the package from an ssh or serial terminal instead of Jupyter Lab (e.g. using the usb network connection on the Ultra96 -- ssh xilinx@192.168.3.1).

Make sure you login as root (e.g., sudo su) and source the pynq profile scripts before installing the pynq_dpu package.

. /etc/profile.d/xrt_setup.sh
. /etc/profile.d/pynq_venv.sh
pip3 install pynq-dpu --no-build-isolation

2. Run

You are ready to go! Now in jupyter, you can explore the notebooks in the pynq-dpu folder.

Selftest and Contributing

If you have a board that hasn't been marked as verified in the above table, you can use the new built-in tests to verify if DPU-PYNQ works on your device as intended. To verify that your installation was successful, without opening any notebooks you can run the tests that are part of the pynq_dpu package. Simply run:

python3 -m pytest --pyargs pynq_dpu

If the tests are successful please feel free to make a contribution to the above table by opening an pull request and updating the markdown entry for that board.

Rebuild DPU Block Design

The DPU IP comes from the Vitis Ai Github. If you want to rebuild the hardware project, you can refer to the instructions for the DPU Hardware Design.

In short, the following files will be generated in boards/<Board> folder:

  1. dpu.bit
  2. dpu.hwh
  3. dpu.xclbin

These are the overlay files that can be used by the pynq_dpu package.

Rebuild DPU Models

DPU models are available on the Vitis AI GitHub repository model zoo, where you can find a model-list containing quantized models, as well as pre-compiled .xmodel files that can be directly loaded into your DPU application.

If you want to recompile the DPU models or train your own network, you can refer to the instructions for DPU models.



Copyright (C) 2021 Xilinx, Inc

SPDX-License-Identifier: Apache-2.0