Skip to content

Conversation

@yewentao256
Copy link
Member

@yewentao256 yewentao256 commented Jul 21, 2025

Purpose

Fixes #21304

Thanks for @robertgshaw2-redhat 's help!

Test

Origin:

ERROR 07-19 10:21:10 [registry.py:388]   File "/home/wentao/.wentao_env/lib/python3.12/site-packages/torch/cuda/__init__.py", line 576, in get_device_properties
ERROR 07-19 10:21:10 [registry.py:388]     _lazy_init()  # will define _get_device_properties
ERROR 07-19 10:21:10 [registry.py:388]     ^^^^^^^^^^^^
ERROR 07-19 10:21:10 [registry.py:388]   File "/home/wentao/.wentao_env/lib/python3.12/site-packages/torch/cuda/__init__.py", line 372, in _lazy_init
ERROR 07-19 10:21:10 [registry.py:388]     torch._C._cuda_init()
ERROR 07-19 10:21:10 [registry.py:388] RuntimeError: CUDA error: initialization error

Now:

vllm (pretrained=Qwen/Qwen3-30B-A3B-FP8,max_model_len=32768,enforce_eager=True,trust_remote_code=True), gen_kwargs: (None), limit: None, num_fewshot: 5, batch_size: auto
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match||0.8340|±  |0.0102|
|     |       |strict-match    |     5|exact_match||0.8939|±  |0.0085|

Signed-off-by: yewentao256 <[email protected]>
@github-actions
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
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the deep_gemm utility to use lazy initialization to fix a CUDA initialization error. A critical bug was identified in the new lazy initialization logic due to a missing global declaration and an incomplete "fast path" check, which would prevent some of the functionality from working as intended. Suggestions have been provided to fix these issues.

@yewentao256 yewentao256 changed the title [Bug] Fix Cuda Init Error [Bug] DeepGemm: Fix Cuda Init Error Jul 21, 2025
Signed-off-by: yewentao256 <[email protected]>
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, thanks!

@mgoin mgoin enabled auto-merge (squash) July 21, 2025 16:32
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 21, 2025
@vllm-bot vllm-bot merged commit e69a92a into vllm-project:main Jul 22, 2025
63 of 65 checks passed
@yewentao256 yewentao256 deleted the wye-fix-cuda-init-error branch July 22, 2025 14:49
zixi-qi pushed a commit to zixi-qi/vllm that referenced this pull request Jul 23, 2025
x22x22 pushed a commit to x22x22/vllm that referenced this pull request Aug 5, 2025
Pradyun92 pushed a commit to Pradyun92/vllm that referenced this pull request Aug 6, 2025
npanpaliya pushed a commit to odh-on-pz/vllm-upstream that referenced this pull request Aug 6, 2025
jinzhen-lin pushed a commit to jinzhen-lin/vllm that referenced this pull request Aug 9, 2025
paulpak58 pushed a commit to paulpak58/vllm that referenced this pull request Aug 13, 2025
diegocastanibm pushed a commit to diegocastanibm/vllm that referenced this pull request Aug 15, 2025
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 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.

[Bug]: RuntimeError: CUDA error: initialization error in _is_fa2_supported

3 participants