-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conv_weights method? Vivado/Vitis version #9
Comments
Thanks for your interests in our project! We take the following process to encode the convolutional weights:
We use Vivado 2019.2 to synthesize the design. We notice that Vitis HLS has made lots of changes to its API and compilation flow, and we didn’t tested our design on the latest version. To reproduce our results, we suggest using Vivado HLS instead of the Vitis one. |
Thank you very much for the response. I have managed to pack convolutional weights and reproduced your CIFAR-10 Acceleration model. Can you please also share the method of your packing of validation images and labels into .bin file? What was the structure of the packaging process? Thanks a bunch. |
The validation images also use thermometer encoding, and the process is exactly the same as the one of training images. We don't need to pack labels. Since labels are just 0-9, it is fairly easy to compare the predicted results with the golden results in Python. Hope this answer your question :) |
Thanks a lot for your answers. With your help I have been able to generate IP on Vivado HLS and built a bitstream file on Vivado using the CIFAR-10 acceleration approach. However I have encountered problems when pushing the bitstream to the Ultra96v2 board and it doesn't work properly. Upon inspection, the bitstream generated is around 5MBs which is 100x bigger than the results in the paper of 0.03mb. I have tried rebuilding your CIFAR-10 on Vivado HLS without any modification of the source code and noticed that the IP's LUTs and BRAM exceeded the available resource on the board by a large margin. I have followed closely your instructions and this is the result. I have attached a picture showing the exported IP summary. As I am still learning, would you know how this is the case? Have I done some mistakes? Note: One difference that I had done is the usage of Faketime library to bypass a bug in Vivado 2019.2 when attempting to export IP via Vivado HLS. Maybe this could have caused the issue? |
The result is expected. You can see the following report I generated using Vivado 2019.2. It is the same as what you obtained. Since the resource usage in the HLS report is estimated, which may have large difference with the actual resource usage.
Actually you can check the
Notice the size of the bitstream does NOT mean anything. Even you synthesize a simple adder, the size of the bitstream for Ultra96V2 is around 5MB, since it not only contains your synthesized design but also other hardware logics. The reported result "0.03MB" in our paper is the model size. Basically the size of the parameters. Also, we did not use third-party libraries. The bitstream should be properly generated using pure Vivado and executed on the target device. |
Hello, sorry to bother again. Thank you for your previous replies, as it has helped me tremendously. I have another question. Just for confirmation, the thermo-encoded "conv_input_uint64.npy" used for evaluation on Ultra96v2 was encoded using resolution=4? The input images are of size (N, 3, 32, 32) with each elements of 64-bits. However, in your paper you stated that for all experiments, resolution=8 is used, which will produce the elements the encoded images of 32-bits. Or did you use another method with resolution=8? If so, would you be kindly to check my code as I having been stuck for a few days and haven't been able to reproduce your result on the CIFAR-10 dataset. Below is the code for thermometer encoding which has taken a lot of ideas from your already implemented code. The purpose of this is that I want a sequential encoding of images e.g. for a video feed.
Thank you so much in advance, you have been a life saver! |
Due to my limited knowledge as I am still learning, I have encountered problems when implementing the FracBNN model onto the FPGA Ultra96v2 with a custom dataset.
Specifically, what technique did you use for encoding the convolutional weights in conv_weights.h? Is it Thermometer encoding the same as the input? Can you please go into details/sample code of your encoding process in 2-bit with hex representation? as the shape is [45][16][3][3], I am quite confused into which layers' weights did you use for the conv_weights.h?
Second question, which Vivado version did you use for implementation? Was it 2019.1 or 2019.2? I tried using 2022.2 version but I have run into a lot of problems with tcl.
Thanks in advance!
Winston
The text was updated successfully, but these errors were encountered: