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

Non-quantized QKeras layers break conversion #928

Open
vloncar opened this issue Nov 22, 2023 · 0 comments
Open

Non-quantized QKeras layers break conversion #928

vloncar opened this issue Nov 22, 2023 · 0 comments

Comments

@vloncar
Copy link
Contributor

vloncar commented Nov 22, 2023

Quick summary

While a bit nonsensical, QKeras layers without quantizers are legal. For example QDense(n_units) (without kernel_quantizer=something) fails conversion since we expect the quantizers to be present in the converter. In fact, the IR instance of Dense doesn't need a quantizer, so it is just the converter that is problematic.

Details

Steps to Reproduce

Create any model with QKeras layers and don't specify quantizers.

Expected behavior

The model should convert to IR.

Actual behavior

The converter fails.

Optional

Possible fix

We need to go through hls4ml/converters/keras/qkeras.py and check if supported layers pass without the quantizers specified. The check already exists for bias, we should add it for weights.

Additional context

I wish this was caught on QKeras side and creation of quantized models without a quantizer is prohibited, but that's out of our control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant