Skip to content

(Partial) support for SR backend with Vitis HLS#1478

Open
bo3z wants to merge 1 commit into
mainfrom
bugfix/sr-vitis-support
Open

(Partial) support for SR backend with Vitis HLS#1478
bo3z wants to merge 1 commit into
mainfrom
bugfix/sr-vitis-support

Conversation

@bo3z
Copy link
Copy Markdown
Contributor

@bo3z bo3z commented May 21, 2026

Description

📝 The SR backend doesn't really work with Vitis HLS. There are three reasons for this, two of which are addressed by this PR. The third on is fundamentally un-adressable.

  1. 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.

  2. 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.

  3. 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

  • Bug fix (non-breaking change that fixes an issue)

Tests

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@bo3z bo3z requested a review from vloncar May 21, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant