Xilinx / Vitis-AI-Tutorials

MIT License
358 stars 144 forks source link

RFModulation_Recognition fingerprint #117

Open Terokii opened 6 months ago

Terokii commented 6 months ago

I am trying to run the desing on ZCU104 The image for the SD card is taken for here: https://www.xilinx.com/member/forms/download/design-license-xef.html?filename=xilinx-zcu104-dpu-v2022.2-v3.0.0.img.gz

which is mentioned here https://xilinx.github.io/Vitis-AI/3.0/html/docs/quickstart/mpsoc.html

i am runnign the the whole python from RFModulation_Recognition and using the /opt/vitis_ai/ arch.json files.

However i am getting the warning like this: Where could the problem be ? CHECK fingerprint fail! model_fingerprint 0x101000016010407 is un-matc hed with actual dpu_fingerprint 0x101000056010407. Please re-compile xmodel with dpu_fingerprint 0x101000056010407 and try agai n.

quentonh commented 6 months ago

@Terokii The DPU "Fingerprint" is simply a hexadecimal number that is uniquely associated with the configuration of the IP. Each time the IP configuration is modified in such a way that those modifications change the instruction set of the DPU, or the supported features of the IP, the Fingerprint is also revised. This enables the Vitis AI Compiler to compile the DPU instructions for the correct target.

In this case, the tutorial was created with Vitis AI 2.5, while the pre-built board image that you are targeting is built based on IP from Vitis AI 3.0.

One point that I will share with you is that it is possible to review the tables found here to determine if the IP was changed between Vitis AI releases.

Furthermore, the Feature Code found in the Target Factory source code is a component of the DPU Fingerprint. You can compare the Feature Code between the 2.5 release and 3.0 release and observe that the Fingerprint has changed.

Ultimately, the Fingerprint is comprised of a combination of the ISA code and the Feature Code of the DPU, as seen here

All that said, you have three choices:

[1] Use the Vitis AI 2.5 pre-built image for your testing, to coincide with the tutorial. It may be downloaded here [2] Recompile the model using Vitis AI 3.0 using the updated Fingerprint in your arch.json file [3] At the risk that it may not work, you can also bypass the Fingerprint check as noted in this INFO POST

Thanks for trying this tutorial!

--Quenton

Terokii commented 6 months ago

@quentonh Thanks for the great answer. I have tried it with option 1. And it seems to work. However with 3.0 image I can 't get it working even I compile with Vitis-AI 3.0. And it works with 2.5 image even compiled with 3.0. So I am little bit confused here.

One question about the fingerprints. The arch.json is like this: more /opt/vitis_ai/compiler/arch/DPUCZDX8G/ZCU104/arch.json { "target": "DPUCZDX8G_ISA1_B4096" } How do I change the fingerprint here ?

And thanks for the great Tutorial ! Br, Tero

quentonh commented 5 months ago

@Terokii I agree that it does seem strange that the model compiled with 3.0 would test OK with the 2.5 image and not the 3.0 image. What is the observed behaviour when running the 3.0 model on the 3.0 image?

Regarding your additional question, in the past it has been possible to change the "target" to "fingerprint" in arch.json and assign the specific hexadecimal fingerprint for the DPU that is your target architecture / version. For instance, if you were using the 3.0 compiler to compile for the 2.5 image, you might modify the arch.json as follows:

{ "fingerprint": "0x101000056010407" }

To the best of my knowledge, this should still work.

--Quenton

Terokii commented 5 months ago

@quentonh It gives the same fingerprint error.

If I run this example with Vitis-AI 3.0 https://xilinx.github.io/Vitis-AI/3.0/html/docs/quickstart/mpsoc.html and the 3.0 image it runs OK. => It seems strange, and it feels like the RFModulation example would be hard-coded to 2.5 which is weird but that how it feels.

Fingerprint with json, understood. thanks for the explanation.

-Tero