You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using two consecutive reshape operations in a QAT model, such as two torch.unsqueeze operations, the compilation throws the ValueError "Could not determine a unique scale for the quantization! Please check the ONNX graph of this model.", even though the two torch.unsqueeze are between two QuantIdentity layers.
It seems that this especially happens when passing a parameter n_bits to compile_brevitas_qat_model that is smaller than the bit width used for the QAT model.
For instance, using a bit width of 8 for the QuantIdentity layers in the QAT model, but choosing n_bits=6.
You are correct the error message isn't really clear here. Some assertion seem to sometimes fail when setting less bits in the compilation than in brevitas layers.
Brevitas already has all the necessary n_bits information so the n_bits parameter at compilation time should be hidden from the user. We will improve this. Thanks for the issue!
Summary
When using two consecutive reshape operations in a QAT model, such as two
torch.unsqueeze
operations, the compilation throws the ValueError "Could not determine a unique scale for the quantization! Please check the ONNX graph of this model.", even though the twotorch.unsqueeze
are between twoQuantIdentity
layers.It seems that this especially happens when passing a parameter
n_bits
tocompile_brevitas_qat_model
that is smaller than the bit width used for the QAT model.For instance, using a bit width of 8 for the
QuantIdentity
layers in the QAT model, but choosingn_bits=6
.Description
Minimal code to reproduce the bug:
The text was updated successfully, but these errors were encountered: