-
Notifications
You must be signed in to change notification settings - Fork 426
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
Add support for parsing simple brevitas layers as part of pytorch models #1019
base: main
Are you sure you want to change the base?
Conversation
Avoid Y2K22 Xilinx bug
remove testing script
remove testing script
Removed testing scripts
pre-commit.ci autofix |
Do we need to add brevitas to our test environment docker image? Or can we just add brevitas as a testing dependency? I think that's why the test failed. |
pre-commit.ci autofix |
pre-commit.ci autofix |
pre-commit.ci autofix |
Turns out in the latest version of brevitas there are significant changes to the interface on how to access information about the quantized layers and tensors. I'm not sure right now when I will have time to rework this PR, so I'm converting it to draft for the moment. |
This PR adds support for the parsing of simple brevitas layers (QuantLinear, QuantActivation, QuantConv1D, QuantConv2D) to the pytorch parser. More complex models will still have to go through QONNX, but simple cases can be handled easily within the pytorch parser itself. To this end, this PR adds a new quantizer which only propagates the desired precision to the hsl4ml model, as brevitas already provides the quantized tensors which we pick up directly.
Type of change
For a new feature or function, please create an issue first to discuss it
with us before submitting a pull request.
Note: Please delete options that are not relevant.
Tests
Tested locally with simple model and added pytests.
Checklist
pre-commit
on the files I edited or added.