Skip to content
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 proper support for Binarized and binary neural nets in the QKeras converter #141

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

jurevreca12
Copy link

This PR cleans up some of the QKeras2QONNX converter code and inserts BinaryQuant nodes instead of Quant nodes for qkeras.binary instances. This PR should follow PR: #139.

As this changes the nodes created by the converter it could affect downstream users.

Questions:

  • In onnx.py in qact_handler function there was a channel_order_rewriters._to_channel_first_handler(ctx, quant_act_node). I removed this and the tests still passed, however I am not sure what that was doing there. Does anyone know?
  • In qonnx/custom_op/general/quant.py in function quant there is a "hack" for bitwidth==1 and signed==True, with the following comment.
    # BUG: 1-bit Quant ops currently not exported correctly, manually convert to bipolar values
    So, should this PR request delete this workaround? or does anyone still depend on this?

jvreca added 29 commits March 22, 2024 15:23
Fixed rounding_mode specifier in convert_quantized_bits
Commented out assertion on non-representability
…ay_and_auto_po2_scale

Merging changes from rounding_mode_new.
…nto HEAD

Merge changes from the new converter
…ed up by the normal converter flow.

Added an extra InferShape transform
Added a pure binarized networka s a test for qkeras converter
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