Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fallback preserves existing discovery priority and has focused automated coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds HIP discovery fallback for minimal rocm-sdk-core Python installations.
Changes:
- Creates compatible
hip::hostandhip::amdhip64CMake targets from core-wheel assets. - Adds a focused configuration test for fallback discovery.
| File | Description |
|---|---|
lib/Runtime/ROCm/CMakeLists.txt |
Implements core-wheel HIP fallback. |
tests/unit/test_backend_cmake_defaults.py |
Verifies fallback target paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
apinge
marked this pull request as draft
October 1, 2026 11:40
apinge
marked this pull request as ready for review
October 5, 2026 13:59
This branch has not been deployed
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.
Motivation
Since ROCm 7.14, ROCm can be installed via python packages and is no longer necessarily located under
/opt/rocm. Whilerocm-sdk-corealready provides the hip headers, runtime libraries,lld, and device bitcode, it does not shiphip-config.cmake, and its resource layout differs from the traditional/opt/rocmstructure.This creates two issues:
CMake cannot locate hip via
find_package(hip). Although [Build] Find ROCm through rocm-sdk before falling back to /opt/rocm* #1142 added support for discovering a pip-installed ROCm sdk viarocm-sdk path --root, that mechanism depends onrocm[devel], which is not present in some images such asrocm/pytorch:rocm7.14.1_ubuntu24.04_py3.13_pytorch_release_2.12.0.GPU JIT still searches for
lldand device bitcode under/opt/rocm, which can lead tolld invocation failedin environments that only provide the core wheel.This PR only covers source builds and GPU JIT in core-only ROCm environments. The default external linking flow for AOT artifacts remains affected by the missing development linker name for
libamdhip64.so(see ROCm/TheRock#1205) and is left for future work.Technical Details
hip_DIR,ROCM_PATH,rocm-sdk path --root, and/opt/rocm. Only ifhip-config.cmakecannot be found in any of those locations will it fall back to reading the hip headers and runtime library from the_rocm_sdk_corepackage in the Python environment used for the build, while also providing thehip::hostandhip::amdhip64targets required by the FlyDSL runtime.FlyRocmModuleToBinaryPassas a replacement for upstream llvm'sGpuModuleToBinaryPass, andFlyRocmSerializeras a derived replacement for upstream llvm'sAMDGPUSerializer. By overridingcompileToBinaryin the derived serializer, it avoids the hardcoded linker path used upstream. It solves the same problem as Auto-discover MLIR ROCm toolkit from rocm-sdk Python wheels #568 , but without requiring extra symbolic links, which makes the user environment easier to maintain. This makes it possible to resolve both the traditional installation pathand the new rocm-sdk-core path
Test Plan
scripts/build.sh -j64.scripts/run_benchmark.sh.scripts/run_tests.shexcepttests/unit/test_aot_export.py.Test Result
Submission Checklist