-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[BUG] [ROCm] Fix import bug on ROCm #22083
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
[BUG] [ROCm] Fix import bug on ROCm #22083
Conversation
Signed-off-by: tjtanaa <[email protected]>
👋 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 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 🚀 |
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.
Code Review
This pull request aims to fix an import bug on ROCm by restricting some CUDA-specific imports. While the change correctly identifies and restricts these imports, it introduces a critical runtime error. The code that uses the imported modules is not conditionally guarded, which will lead to a NameError
on ROCm platforms. I've provided a critical comment with details on how to resolve this.
from vllm.platforms import current_platform | ||
|
||
if current_platform.is_cuda_alike(): | ||
if current_platform.is_cuda(): |
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 change correctly restricts CUDA-specific imports to the CUDA platform, which should fix the import error on ROCm. However, this introduces a new problem. The passes imported here (FusionPass
, AllReduceFusionPass
, etc.) are used later in this file within PostGradPassManager.configure
based on config.compilation_config.pass_config
flags.
On a ROCm platform, this if
condition will be false, the imports will be skipped, but the code that uses these passes will still execute if the corresponding config flags are enabled. This will lead to a NameError
at runtime.
To fix this, the usage of these passes within PostGradPassManager.configure
must also be guarded by if current_platform.is_cuda():
.
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.
@tjtanaa this was a correct suggestion by Gemini, please pay attention next time!
As @gshtras pointed out in Slack this breaks custom passes on ROCm. We should only disable the pass that uses the |
@ProExpertProg Thank you for pointing out. So, I was following the wrong fix. |
This reverts commit 26b5f7b. Signed-off-by: Gregory Shtrasberg <[email protected]>
Signed-off-by: tjtanaa <[email protected]>
Signed-off-by: tjtanaa <[email protected]> Signed-off-by: Jinzhen Lin <[email protected]>
Signed-off-by: tjtanaa <[email protected]> Signed-off-by: Noam Gat <[email protected]>
Signed-off-by: tjtanaa <[email protected]> Signed-off-by: Paul Pak <[email protected]>
Signed-off-by: tjtanaa <[email protected]> Signed-off-by: Diego-Castan <[email protected]>
Signed-off-by: tjtanaa <[email protected]>
Signed-off-by: tjtanaa <[email protected]>
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Fix the bug introduce by PR #21069
following the bugfix PR #21036
Bug Log
Test Plan
Test Result
(Optional) Documentation Update