-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Bugfix][Kernel] Fix per-token/per-channel quantization for Hopper scaled mm #12696
[Bugfix][Kernel] Fix per-token/per-channel quantization for Hopper scaled mm #12696
Conversation
Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
if ((a_scale_group_shape == GroupShape{M, K} || | ||
a_scale_group_shape == GroupShape{1, K}) && | ||
(b_scale_group_shape == GroupShape{K, N} || | ||
b_scale_group_shape == GroupShape{K, 1})) { | ||
// "standard per-tensor/per-token/per-channel" scaling | ||
if ((a_scales.numel() == 1 || a_scales.numel() == a.size(0)) && | ||
(b_scales.numel() == 1 || b_scales.numel() == b.size(1))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com> Signed-off-by: Felix Marty <felmarty@amd.com>
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
…aled mm (vllm-project#12696) Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
This fixes the selection between grouped vs per-tensor or per-token quantization. In some cases, the linear layers will pass in transposed scales (e.g. 1 x num_tokens instead of num_tokens x 1). This simplifies and makes the dispatching to the per-token/per-channel/per-tensor case more flexible.
Fixes the error:
when running for example:
vllm serve nm-testing/TinyLlama-1.1B-Chat-v1.0-FP8_DYNAMIC-e2e