conifer
conifer copied to clipboard
xgboost example VivadoHLS segfault
Hi,
I tried to run xgboost_to_hls.py
example, but Vivado HLS fails with segmentation fault
It's probably something with the array ranges?
INFO: [XFORM 203-11] Balancing expressions in function 'hls4ml_burr' (firmware/hls4ml_burr.cpp:4)...4 expression(s) balanced.
Stack dump:
0. Running pass 'Function Pass Manager' on module '~/ip_cores/hls4ml_burr/build/hls4ml_burr_prj/solution1/.autopilot/db/a.o.1.tmp.bc'.
1. Running pass 'Instruction simplification' on function '@"BDT::Tree<3, ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> [10], ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> >::decision_function"'
Abnormal program termination (11)
Please check '~/hls4ml_burr/build/hs_err_pid27358.log' for details
segfault in /tools/Xilinx/Vivado/2020.1/bin/unwrapped/lnx64.o/vivado_hls -exec vivado_hls -f build_prj.tcl reset=1 csim=0 synth=1 cosim=0 validation=0 export=1 vsynth=0, exiting...
Makefile:12: recipe for target 'build_hls' failed
make: *** [build_hls] Error 139
See the project archive for more details https://justbeamit.com/q9zra
The same segfault errors with sklearn_RandomForest.py
and sklearn_to_hls.py
examples
Hi, this issue is Vivado version related. I think it works on 2018 versions, but this error appears for 2019 and 2020 versions. I haven't figured out what actually causes the issue yet.
Some workarounds for the time being : use a 2018 version of Vivado; or use the VHDL backend.
The BDT project generated by 5dcd46823dfe4ee08507513a3a5aa3ab397b7900
compiles in Vitis 2020.2
/tools/Xilinx/Vitis_HLS/2020.2/bin/vitis_hls -f build_prj.tcl "reset=1 csim=0 synth=1 cosim=0 validation=0 export=1 vsynth=0"
@thesps Do you think it makes sense to add something like
set vivadoVer [lindex [split [version] "\n"] 0]
if {$vivadoVer=="Vivado v2020.1 (64-bit)"} {
error "$vivadoVer is not supported, please update to Vivado 2020.2"
}
To https://github.com/thesps/conifer/blob/31a67a9dbb00b9f3c2b596af3f982d002c3c5999/conifer/backends/vivadohls/hls-template/build_prj.tcl#L18
Would you be able to test this branch? It contains PR #12 , which should resolve that Abnormal program termination
error for older Vivado versions as well as support Vitis.
@thesps yes, sklearn_to_hls.py
example compiles with Vivado 2020.1