(Partial) support for SR backend with Vitis HLS#1478
Conversation
| compiler (str, optional): Compiler to use, ``vivado_hls`` or ``vitis_hls``. Defaults to ``vivado_hls``. | ||
| hls_include_path (str, optional): Path to HLS inlcude files. If `None` the location will be inferred from the | ||
| location of the `compiler` used. If an empty string is passed the HLS math libraries won't be used during | ||
| hls_compiler (str, optional): HLS compiler to use. Must be ``'vivado_hls'`` or ``'vitis_hls'`. Defaults to ``'vivado_hls'``. |
There was a problem hiding this comment.
Can we add support for vitisrun that is used in newer versions? And we could do a performance eval and if it works as well with Vitis as originally with Vivado, we can drop Vivado support altogether.
There was a problem hiding this comment.
In my mind vitisrun is/was the name of the executable. The compiler is still Vitis HLS. But yes, we can make it more consistent and just have vitisrun (since we don't support any versions of Vitis HLS for which vitisrun doesn't exist).
How would we know if it works as well? Do we have some baseline results? I personally wouldn't have access to a machine with Vivado HLS.
There was a problem hiding this comment.
indeed it may make sense to just call them vivado and vitis instead of the actual executable.
regarding vivado hls, i see two options: if you have a licence at eth (check vlm with local license server if you still have a valid one) i can give you a containerized version that you can run without installation. other option is to use cvmfs if you have a cern account and can log in to lxplus.
Description
The build function of the SR backend always calls vivado_hls, which doesn't exist for Vitis HLS. The current fix calls the appropriate tool (vitis-run or vivado_hls), depending on the compiler passed during convert_from_symbolic_expression.
Some math libraries changed versions (from _v0 to _v1) in Vitis 2022.2. Given that hls4ml only supports Vitis HLS > 2022.2, the new code checks which compiler was specified (vivado_hls or vitis_hls) and appropriately sets the library to link against in build_lib.sh.
When running hls_model.compile(...), the process looks for Vitis HLS math include header and libraries. These are closed-source/proprietary, and so, compile(...) will faill if no valid Vitis HLS is available (which doesn't happen on other backends; other backends can run every step except build without an HLS compiler).
I don't see a solution for the 3rd issue, but this PR should at least allow using the SR backend for users for users that have Vitis HLS installed on their system (which could be quite a few users, since Vivado HLS has been deprecated for ~6 years now). This PR also allows us to run the new SR notebook in the proposed tutorial revamp end-to-end without any issues.
Type of change
Tests
Checklist
pre-commiton the files I edited or added.