Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressing zynqnet #50

Open
ghost opened this issue Jun 2, 2018 · 2 comments
Open

Compressing zynqnet #50

ghost opened this issue Jun 2, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 2, 2018

Hi David,
I am trying to compress your model by removing some of the connections between the neurons so it would fit on my Zynq XC7Z020 FPGA.

I synthesized your model in Vivado HLS and chose my FPGA when selecting the part/board. The screen shot below is a summary of utilization estimates.
resource utilization

I would like to get your advice on this, do you think compressing the model would take care of it? I'm afraid the accuracy would suffer greatly if I reduce the size to that extend.
Any thoughts?

@dgschwend
Copy link
Owner

ZynqNet is already quite optimized, and the hardware and the network have been co-adapted. Therefore you can’t just shrink the hardware or the net independently. Your utilization is above 300%, so the FPGA logic is more than 3x too large. I don‘t think that you can cut the CNN that much by removing connections and still achieve reasonable accuracy.
Also, processing is very regular, so any „irregular“ pruning algorithms won‘t help.
You could probably benefit a lot from fixed-point arithmetic (e.g. int8), that would reduce the size of operands but also computation logic.
You could also reconfigure the hardware to use less processing engines (reduce loop-unrolling in HLS), and reduce the Weights Cache to save BRAM. This will probably result in some layers being too big (too many channels) to be processed at once, but then you can split them into „parallel branches“ like I had to do with conv10, thereby manually channel-tiling the network...
But: Do you really need to solve the entire ImageNet classification challenge for your application? Maybe you could restrict the problem to some subset, some less complex task? ImageNet is a real beast for your FPGA... ;-)

@ghost
Copy link
Author

ghost commented Jun 4, 2018

I am biting off more than I can chew with my FPGA lol
Thank you for the suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant