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

Question on wrapped forward quantized module #251

Open
Jonxjdong opened this issue Feb 6, 2025 · 0 comments
Open

Question on wrapped forward quantized module #251

Jonxjdong opened this issue Feb 6, 2025 · 0 comments

Comments

@Jonxjdong
Copy link

https://github.com/neuralmagic/compressed-tensors/blob/main/src/compressed_tensors/quantization/lifecycle/forward.py#L257
In the forward function above, the Linear operation with quantization is done in the way:
Y = (Sx*[X/Sx]) @ (Sw*[W/Sw])
which X and W is quantized and dequantized separately and then the two fp16-format matrices multiplied.

Why not in the way like
Y = ([X/Sx] @ [W/Sw]) * (Sx @ Sw)
which [X/Sx] and [W/Sw] are in int format that the integer multiplication would be faster in CUDA

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

1 participant