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

[Bugfix][CI][V1] Work around V1 + CUDA Graph + torch._scaled_mm fallback issue #13425

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

tlrmchlsmth
Copy link
Collaborator

@tlrmchlsmth tlrmchlsmth commented Feb 17, 2025

This PR works around an issue where vLLM V1, using Ada Lovelace GPUs, and when building vLLM with CUDA < 12.4, FP8 models with per-channel and/or per-tensor quantization will produce garbage output.

Closes #13212

AFAICT, there is some issue with the way we are setting up TORCH_DEVICE_IDENTITY

Alternatively, now that torch._scaled_mm supports rowwise scaling we could use that instead of the fallback. Unfortunately this only works if the model's dtype is bf16. Otherwise we get the error:

RuntimeError: Only bf16 high precsion output types are supported for row-wise scaling.

Definitely am not happy about the approach here as is puts the onus on the caller of apply_fp8_linear to also call maybe_create_device_identity before the forward pass.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

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 either: Add ready label to the PR or enable auto-merge.

🚀

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.

Certainly agree it is unfortunate, but this is critical to fix now. Nice work and LGTM

@mgoin mgoin added ready ONLY add when PR is ready to merge/full CI is needed bug Something isn't working v1 labels Feb 17, 2025
@tlrmchlsmth tlrmchlsmth enabled auto-merge (squash) February 18, 2025 00:16
@tlrmchlsmth tlrmchlsmth merged commit b3942e1 into vllm-project:main Feb 18, 2025
64 checks passed
panf2333 pushed a commit to yottalabsai/vllm that referenced this pull request Feb 18, 2025
xjpang pushed a commit to xjpang/vllm that referenced this pull request Feb 20, 2025
kerthcet pushed a commit to kerthcet/vllm that referenced this pull request Feb 21, 2025
Akshat-Tripathi pushed a commit to krai/vllm that referenced this pull request Mar 3, 2025
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed v1
Projects
None yet
2 participants