-
Notifications
You must be signed in to change notification settings - Fork 199
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
Custom bit-width and QuantTensor Operation #982
Comments
>>> import brevitas.nn as qnn
>>> from brevitas.quant.scaled_int import Uint8ActPerTensorFloat
>>> class NewUint4ActPerTensorFloatMaxInit(Uint8ActPerTensorFloat):
... bit_width = 4
...
>>> a = qnn.QuantReLU(NewUint4ActPerTensorFloat)
>>> a.act_quant.quant_injector.bit_width
4
|
for example, what I am trying to do is something like this:
4 should ovrewrite 8, otherwise I have to prepare a strategy for each possible bit-width. Is there a way to do so?
It's working fine, let me know if you think I may face some problems with that. |
|
Still unsure if 2. is solved, it depends on what you're doing with tracing. If you still have issue, feel free to re-open this and share a minimal script to reproduce. I am going to close this for now :) |
Hi,
I have two question for this issue:
bit_width
field of a quantization strategy without creating a new class which inherits the field of the selected strategy. I tried to specify it in the arguments of the layer, but the layer is still using the bit-width of the strategy.Here an example:
scale
field of the QuantTensor.It may be tricky to handle situations where the scale is forced to be something different from a FP, but I think it is a useful feature.
I tried to use
set
to update manually thescale
but the operation is not tracked in the Pytorch graph. Can you help me with that?Kind regards,
Tommaso
The text was updated successfully, but these errors were encountered: