[ROCm] cmake: support PYTORCH_FOUND_HIP for torch 2.13 native HIP language support#43881
Merged
ywang96 merged 11 commits intoMay 30, 2026
Merged
Conversation
Contributor
|
Hi @nemanjaudovic, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
…upport torch 2.13 switched from FindHIP.cmake (legacy) to CMake native enable_language(HIP) in commit pytorch/pytorch@d921fd0. The new approach sets PYTORCH_FOUND_HIP but never sets HIP_FOUND, which caused vllm's CMakeLists.txt to fall through to the fatal error path. Fix the HIP detection condition in vllm's CMakeLists.txt to also accept PYTORCH_FOUND_HIP. Signed-off-by: nemanjaudovic <nudovic@amd.com>
afb2ff1 to
7542584
Compare
Member
|
CC @tjtanaa do you want to take a look? |
tjtanaa
approved these changes
May 29, 2026
Member
tjtanaa
left a comment
There was a problem hiding this comment.
Looks fine to me that we can compile the code for AMD CI
Contributor
Author
|
Seems that CI is getting stuck on some unrelated tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
torch 2.13 switched from FindHIP.cmake (legacy) to CMake native enable_language(HIP) in commit pytorch/pytorch@d921fd0. The new approach sets PYTORCH_FOUND_HIP but never sets HIP_FOUND, which caused vllm's CMakeLists.txt to fall through to the fatal error path.
Fix the HIP detection condition in vllm's CMakeLists.txt to also accept PYTORCH_FOUND_HIP.
More details about the problem
Building vllm with PyTorch 2.13 on ROCm fails with:
CMake Error at CMakeLists.txt:169 (message): Can't find CUDA or HIP installation.This happens even when HIP/ROCm is correctly installed and torch itself was built with ROCm support.
Root Cause
PyTorch 2.13 migrated from the legacy FindHIP.cmake module to CMake's native HIP language support (enable_language(HIP)) in pytorch/pytorch@d921fd0. The motivation was Windows support, where FindHIP.cmake's bash-based linker helper doesn't work.
The old LoadHIP.cmake (torch ≤2.12) called find_package(HIP MODULE), which ran FindHIP.cmake and set HIP_FOUND=TRUE as a CMake convention side effect. The new LoadHIP.cmake (torch 2.13) bypasses FindHIP.cmake entirely and sets only
PYTORCH_FOUND_HIP=TRUE.
vllm's CMakeLists.txt checked only HIP_FOUND to detect HIP, which is never set by torch 2.13, causing it to fall through to
the fatal error on line 169.
Fix
Extend the HIP detection condition to also accept PYTORCH_FOUND_HIP, which is set by both torch 2.12 and 2.13:
After this fix vllm builds correctly.