Skip to content

Conversation

tlrmchlsmth
Copy link
Member

@tlrmchlsmth tlrmchlsmth commented Feb 3, 2025

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:

E       RuntimeError: Unsupported scale group shapes for CUTLASS 3.x GEMM.
E        a_scale_group_shape must be [1, 128], got: [1, 2048]
E       b_scale_group_shape must be [128, 128], got: [1, 2560]

when running for example: vllm serve nm-testing/TinyLlama-1.1B-Chat-v1.0-FP8_DYNAMIC-e2e

Copy link

github-actions bot commented Feb 3, 2025

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

Copy link

mergify bot commented Feb 3, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @tlrmchlsmth.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 3, 2025
@mergify mergify bot removed the needs-rebase label Feb 3, 2025
Comment on lines -37 to +22
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))) {
Copy link
Member Author

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

@tlrmchlsmth tlrmchlsmth marked this pull request as ready for review February 3, 2025 15:59
Copy link
Collaborator

@LucasWilkinson LucasWilkinson left a 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!

@tlrmchlsmth tlrmchlsmth added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 3, 2025
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simon-mo simon-mo mentioned this pull request Feb 3, 2025
6 tasks
@simon-mo simon-mo merged commit c11de33 into vllm-project:main Feb 3, 2025
68 of 73 checks passed
yessenzhar pushed a commit to deepinfra/vllm that referenced this pull request Feb 3, 2025
pathorn pushed a commit to deepinfra/vllm that referenced this pull request Feb 14, 2025
pathorn pushed a commit to deepinfra/vllm that referenced this pull request Feb 19, 2025
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants