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

Why do the weights need to be dequantized after one quantization? #23

Open
lotusdaddy opened this issue Jul 12, 2022 · 1 comment
Open

Comments

@lotusdaddy
Copy link

   new_quant_x = linear_quantize(x, scale, zero_point, inplace=False)
    n = 2**(k - 1)
    new_quant_x = torch.clamp(new_quant_x, -n, n - 1)
    quant_x = linear_dequantize(new_quant_x,
                                scale,
                                zero_point,
                                inplace=False)

Doesn't this get the weight of the floating point number?

@Minato-Zackie
Copy link

From my point of view, most of the quantization papers, the code is using fake quantization operation to simulate quantization. So it's still using floating-point numbers for quantization.

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

No branches or pull requests

2 participants