Xilinx / finn

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

RadioML: Verification step folded_hls_cppsim throws an error #1109

Open hannahxy13 opened 2 weeks ago

hannahxy13 commented 2 weeks ago

Quick summary

When building the RadioML model from FINN-examples, the verification step "folded_hls_cppsim", which happens at "step_apply_folding_config", will throw an error.

Details

The verification step "folded_hls_cppsim" was added to the build configuration for the RadioML model from the FINN-examples repository. After running a build and reaching the build step "step_apply_folding_config", the following error is thrown:

result = np.matmul(in_act, mvau_w)
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 256 is different from 32)

Using the Python debugger, additional information about the nodes which the error occurs in was found:

(Pdb) self.onnx_node.name
'MVAU_rtl_7'
(Pdb) print(in_act.shape)
(1, 8, 1, 32)
(Pdb) print(mvau_w.shape)
(256, 128)
(Pdb) self.get_normal_input_shape()
(1, 256)
(Pdb) self.get_nodeattr("PE")
4
(Pdb) self.get_nodeattr("SIMD")
4

It seems the error occurs in the node "MVAU_rtl_7".

Steps to Reproduce

  1. Clone the FINN repository
  2. Checkout the dev branch, with commit hash: [25c1c99f]
  3. Set the environment variable FINN_ROOT as the FINN repository that was cloned
  4. Clone the FINN-examples repository
  5. Add the verification step "folded_hls_cppsim" to the build.py file for the RadioML model build configuration
  6. Download the RadioML ONNX model using the script in the models folder
  7. Update the RadioML ONNX model to use version 11 ops
  8. Navigate to the build folder for RadioML and start the docker container with the command: [$FINN_ROOT/run-docker.sh build_custom . build]
  9. Allow the build to run, and once it reaches "step_apply_folding_config" it will throw an error

The ONNX file from the step before the failing step: step_target_fps_parallelization.zip

Expected behavior

The verification step was expected to complete and generate a verification output file, without throwing an error.

Actual behavior

The verification step throws an error, which causes the build to fail and thus generate no output verification file.