Xilinx / finn

Dataflow compiler for QNN inference on FPGAs
https://xilinx.github.io/finn
BSD 3-Clause "New" or "Revised" License
722 stars 230 forks source link

U-Net on PYNQ #1094

Closed phixerino closed 1 month ago

phixerino commented 4 months ago

Hi, I'm trying to run U-Net like segmentation model on PYNQ. I have successfully run the model when I removed skip connections (this is the model after conversion to HW layers: QuantSimpleUnet_512x512x1_1classes_1batch_4W4A_noSkip_upsample_qonnx-hw_layers.zip). But I can't run the model with skip connections. I can synthesize it, but when I try to run it with Python driver, it's stuck on this line. I reduced it only to one skip connection, so that it resembles ResNet block, but the result is the same. For reference, this is the model with one skip connection, after conversion to HW layers: QuantSimpleUnet_512x512x1_1classes_1batch_4W4A_oneSkip_upsample_qonnx-hw_layers.zip

fpjentzsch commented 3 months ago

Hi, did you insert FIFOs of sufficient depth between the graph nodes ? Maybe there is a deadlock at the skip connection.

phixerino commented 3 months ago

The only FIFO insertion I have is when I call ZynqBuild on this line. Is that not enough? Should I also call InsertAndSetFIFODepths like in the default build dataflow steps here?

fpjentzsch commented 3 months ago

Yes, InsertFIFO() will just insert minimally sized FIFOs or no FIFOs (depending on create_shallow_fifos) otherwise. You'll need to set the FIFO depths in one of the ways shown in the "step_set_fifo_depths" step:

In general, I would recommend sticking as closely as possible to the default build dataflow steps.

auphelia commented 1 month ago

Closing this issue because of inactivity, please feel free to re-open if your problem isn't solved.