(Partial) support for SR backend with Vitis HLS#1478
Open
bo3z wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.