Skip to content

Improve precision for non-power-of-2 scales in brevitas -> QONNX workflow and add pytests #1208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JanFSchulte
Copy link
Contributor

Adds simple pytests for the brevitas -> QONNX -> hls4ml workflow.

Tested are models using both power-of-2 and non-power-of-2 scales. For the latter, the accuracy is generally poor, driven by insufficient precision for the scale variable in the rescaling operation. So far I have only come up with a stupid fix that chooses an arbitrary higher precision to improve things, and I would like to discuss better options to infer the required precision.

Type of change

  • Other (Specify)

Mostly adds tests

Tests

This PR adds the relevant pytests to test the brevitas -> QONNX -> hsl4ml workflow for a simple model with a linear layer and activation. More tests can be added, if desired.

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.

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.

2 participants