-
Notifications
You must be signed in to change notification settings - Fork 243
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
Error in parent_model = model.transform(CreateDataflowPartition() #936
Comments
You probably have layers in the middle of your model which are not converted to HLS layers. Could you please share your ONNX graph right before running the Briefly looking into your model graph (that is probably directly after export, right?), I suspect it might be due to exporting to QCDQ format instead of QONNX format. The QuantizeLinear and DequantizeLinear layers will not be turned into FINN MultiThresholds. If that is the case, you have two options: Either directly export to QONNX format via Brevitas, or you could try running the Furthermore, as your model is a convolutional model, you should probably follow the |
Hello Dear Christoph, Thank you for your reply. I will share the ONNX file you mentioned when I access to my computer today. I could not find how to export directly to QONNX via Brevitas. I only found Additionally, thank you for your guidance about example notebooks. Have a good day! |
The QONNX export is |
I thought that I had a problem with my model and changed it with Brevitas FC then exported it with I set width of weight, activation and initial to 1 bit as you recommend in #938, then it is solved.
AssertionError: IPGen failed: /tmp/finn_dev_ba/code_gen_ipgen_StreamingDataflowPartition_1_Thresholding_Batch_0_hifo_j1w/project_StreamingDataflowPartition_1_Thresholding_Batch_0/sol1/impl/ip not found. Check log under /tmp/finn_dev_ba/code_gen_ipgen_StreamingDataflowPartition_1_Thresholding_Batch_0_hifo_j1w in model = model.transform(ZynqBuild(platform = pynq_board, period_ns = target_clk_ns)) QONNX file: QONNX_FC.zip Additionally, while I am exporting the QONNX file just after I trained it, I get this warning: Warning: The shape inference of onnx.brevitas::BipolarQuant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. Thank you, |
Regarding the failing IPGen, you should check the log under the specified path to see what is actually going on. There should be some lines with Regarding the seemingly missing shape inference for BipolarQuant: I think it is safe to ignore this. It is probably just an issue during export (when PyTorch is still involved), but as soon as you are relying solely on QONNX, the BipolarQuant should be fully supported by shape inference, if I recall correctly. So, as long as you do not see proper shape inference errors later, just ignore it. |
Hello @iksnagreb Could you give me about adapting the notebook for other than binarized model? I haven't done it yet. |
As mentioned in the referenced discussion #938, you need to replace (or add if you have a mixture of binarized and non-binarized operations) the If you have any concrete issues with this, please share your model graph and the error messages. |
Thank you for your quick reply. I do not understand how to determine which transformation should I use. I read convert_to_hw_layers and look at my ONNX graph in Netron visualization. However, I could not understand how to select transformations. Could you give me a hint or a tutorial? Does it matter using an unnecessary transformation in a flow? Does it affect the transformations in bad way? Should I follow a specific order of transformations or just using a random order? I can compile W2A2 with builder commands but in FPGA its accuracy drops from 72% (Brevitas/Pytorch validation accuracy, GPU) to %5. Building dataflow does not give any error. Does it have a general transformations in step_convert_to_hw? Should I also change order or steps Additionally, I use the original CNV network from Brevitas and I want to use a layer reduced by myself version that keeps the types of layers. For orginal CNV with W2A2, I can not compile correctly. Bests, |
Prerequisites
Please make sure to check off these prerequisites before submitting a bug report.
Quick summary
I trained the example model which is in Brevitas website with MNIST dataset. Then I imported it to FINN example "tfc-end2end-example" (in attachment). parent_model = model.transform(CreateDataflowPartition()) this line has an error in Creating a Dataflow Partion part. You can see the whole error in following screenshots.
I'm using current dev-branch.
Additional context
4b_custom_model.zip
Could you help me to solve it?
Best Regards,
The text was updated successfully, but these errors were encountered: