A question about instancing brevitas quantizer to act layer #875
Answered
by
Giuseppe5
RyougiKukoc
asked this question in
Q&A
-
I want to quantized an unimplemented active layer in brevitas (such as nn.GELU), after taking a glance at QuantReLU and QuantTanh, I wonder if it is right to write as follow? from brevitas.nn.quant_layer import QuantNonLinearActLayer
from brevitas.quant import Int8ActPerTensorFloat
from torch import nn
quant_gelu = QuantNonLinearActLayer(
act_impl=nn.GELU,
passthrough_act=True,
input_quant=None,
act_quant=Int8ActPerTensorFloat,
return_quant_tensor=True
) |
Beta Was this translation helpful? Give feedback.
Answered by
Giuseppe5
Feb 26, 2024
Replies: 1 comment 5 replies
-
This works, and it would be basically equivalent to having The thing I would point out is that |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
RyougiKukoc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works, and it would be basically equivalent to having
nn.GeLU
followed by aQuantIdentity(act_quant=Int8ActPerTensorFloat)
.The thing I would point out is that
passthrough_act
in this case should be False.