Repository navigation
Take the ROCm SDK version for _rocm_init.py from the build environment - #5
Merged
Merged
Conversation
tools/metadata/dependencies.py pins rocm[libraries] to PYTORCH_ROCM_SDK_VERSION, or to the rocm package installed in the build environment when the variable is unset, but torch/CMakeLists.txt only generated _rocm_init.py from the variable. A build that installs the SDK's rocm package instead of exporting the version got the dependency but no preload. Fall back to the installed rocm package in CMake too, so both read the same version. Test Plan: ``` cmake -P t.cmake # check_version='<installed rocm>' PYTORCH_ROCM_SDK_VERSION=9.9.9 cmake -P t.cmake # check_version='9.9.9' ``` Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]>
rocm[libraries] leaves out rocm-sdk-device-gfx1201, which carries the GPU code objects for rocBLAS, MIOpen and the other kpack-split libraries; without it their kernels fail with hipErrorInvalidKernelFile. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]>
cyyever
marked this pull request as ready for review
October 23, 2026 05:20
cyyever
added a commit
that referenced
this pull request
Oct 27, 2026
#5) * Take the ROCm SDK version for _rocm_init.py from the build environment tools/metadata/dependencies.py pins rocm[libraries] to PYTORCH_ROCM_SDK_VERSION, or to the rocm package installed in the build environment when the variable is unset, but torch/CMakeLists.txt only generated _rocm_init.py from the variable. A build that installs the SDK's rocm package instead of exporting the version got the dependency but no preload. Fall back to the installed rocm package in CMake too, so both read the same version. Test Plan: ``` cmake -P t.cmake # check_version='<installed rocm>' PYTORCH_ROCM_SDK_VERSION=9.9.9 cmake -P t.cmake # check_version='9.9.9' ``` Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Depend on the ROCm SDK device wheel too rocm[libraries] leaves out rocm-sdk-device-gfx1201, which carries the GPU code objects for rocBLAS, MIOpen and the other kpack-split libraries; without it their kernels fail with hipErrorInvalidKernelFile. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
#5) * Take the ROCm SDK version for _rocm_init.py from the build environment tools/metadata/dependencies.py pins rocm[libraries] to PYTORCH_ROCM_SDK_VERSION, or to the rocm package installed in the build environment when the variable is unset, but torch/CMakeLists.txt only generated _rocm_init.py from the variable. A build that installs the SDK's rocm package instead of exporting the version got the dependency but no preload. Fall back to the installed rocm package in CMake too, so both read the same version. Test Plan: ``` cmake -P t.cmake # check_version='<installed rocm>' PYTORCH_ROCM_SDK_VERSION=9.9.9 cmake -P t.cmake # check_version='9.9.9' ``` Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Depend on the ROCm SDK device wheel too rocm[libraries] leaves out rocm-sdk-device-gfx1201, which carries the GPU code objects for rocBLAS, MIOpen and the other kpack-split libraries; without it their kernels fail with hipErrorInvalidKernelFile. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Load ROCm from the SDK wheels the torch wheel was built against (#4) ROCm wheels built against an unpacked TheRock SDK (PYTORCH_ROCM_EXTERNAL_SDK) declared no ROCm dependency and shipped no torch/_rocm_init.py, so `import torch` resolved librocm-openblas and the HIP libraries only through LD_LIBRARY_PATH or whatever ROCm the host's ld.so.conf exposed. On a Breadboard guest that is the accelerator pack's ROCm 10.0, not the 10.1 SDK the wheel was built and patched against; without LD_LIBRARY_PATH the import fails on librocm-openblas.so.0. The build now takes the SDK wheels' version from PYTORCH_ROCM_SDK_VERSION. tools/metadata/dependencies.py pins rocm[libraries] to it, and torch/CMakeLists.txt writes the _rocm_init.py that the existing install rule and torch/__init__.py already expect, so `import torch` preloads the SDK libraries from those wheels through rocm_sdk.initialize_process and checks the version. The preload list is TheRock's build_prod_wheels.py list minus hipdnn, which this SDK does not build. PYTORCH_ROCM_EXTERNAL_SDK is gone; the alternative of keeping it and fixing the guest's ld.so.conf would leave torch tied to whatever ROCm the host provides. Test Plan: ``` cmake -P test.cmake # the new block, with and without PYTORCH_ROCM_SDK_VERSION python -c 'import dependencies; ...' # rocm[libraries]==<version> env -u LD_LIBRARY_PATH python -c 'import torch; ...' ``` With the generated _rocm_init.py added to the published gdb71170c wheel on a gfx1201 sandbox, `import torch` succeeds without LD_LIBRARY_PATH and /proc/self/maps shows libamdhip64, libhsa-runtime64, librocblas, libMIOpen and librocm-openblas loaded from the rocm_sdk wheels. A full wheel build with the change was not run. Authored with an AI assistant (Claude Code). Co-authored-by: Claude Opus 5.5 <[email protected]> Take the ROCm SDK version for _rocm_init.py from the build environment (#5) * Take the ROCm SDK version for _rocm_init.py from the build environment tools/metadata/dependencies.py pins rocm[libraries] to PYTORCH_ROCM_SDK_VERSION, or to the rocm package installed in the build environment when the variable is unset, but torch/CMakeLists.txt only generated _rocm_init.py from the variable. A build that installs the SDK's rocm package instead of exporting the version got the dependency but no preload. Fall back to the installed rocm package in CMake too, so both read the same version. Test Plan: ``` cmake -P t.cmake # check_version='<installed rocm>' PYTORCH_ROCM_SDK_VERSION=9.9.9 cmake -P t.cmake # check_version='9.9.9' ``` Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Depend on the ROCm SDK device wheel too rocm[libraries] leaves out rocm-sdk-device-gfx1201, which carries the GPU code objects for rocBLAS, MIOpen and the other kpack-split libraries; without it their kernels fail with hipErrorInvalidKernelFile. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Use external ROCm SDK libraries without pip runtime dependencies Use rocBLAS, hipBLASLt and MIOpen from the ROCm SDK The ROCm build downloaded a separate rocm-libraries revision (271344a4), built rocBLAS, hipBLASLt and MIOpen through ExternalProject and shipped them in torch/lib (~250 MB), and installed Caffe2 configs re-entered that logic so downstream builds such as vLLM fetched the 10 GB source again. That existed to get gfx1201-only kernels; the TheRock SDK now builds these libraries for gfx1201 itself, with our patches applied, so the bundled copies were a second, divergent build of the same libraries, and which one a process loaded depended on LD_LIBRARY_PATH. Find them from ROCM_PATH like the other ROCm components and drop cmake/External/rocm_bundled.cmake with its install rule, Caffe2Config plumbing and summary line. The mslk symbol hiding that landed with the bundling stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Avoid pip ROCm dependency for external SDK wheels Load the ROCm SDK version selected at wheel build time Load ROCm from the SDK wheels the torch wheel was built against (#4) ROCm wheels built against an unpacked TheRock SDK (PYTORCH_ROCM_EXTERNAL_SDK) declared no ROCm dependency and shipped no torch/_rocm_init.py, so `import torch` resolved librocm-openblas and the HIP libraries only through LD_LIBRARY_PATH or whatever ROCm the host's ld.so.conf exposed. On a Breadboard guest that is the accelerator pack's ROCm 10.0, not the 10.1 SDK the wheel was built and patched against; without LD_LIBRARY_PATH the import fails on librocm-openblas.so.0. The build now takes the SDK wheels' version from PYTORCH_ROCM_SDK_VERSION. tools/metadata/dependencies.py pins rocm[libraries] to it, and torch/CMakeLists.txt writes the _rocm_init.py that the existing install rule and torch/__init__.py already expect, so `import torch` preloads the SDK libraries from those wheels through rocm_sdk.initialize_process and checks the version. The preload list is TheRock's build_prod_wheels.py list minus hipdnn, which this SDK does not build. PYTORCH_ROCM_EXTERNAL_SDK is gone; the alternative of keeping it and fixing the guest's ld.so.conf would leave torch tied to whatever ROCm the host provides. Test Plan: ``` cmake -P test.cmake # the new block, with and without PYTORCH_ROCM_SDK_VERSION python -c 'import dependencies; ...' # rocm[libraries]==<version> env -u LD_LIBRARY_PATH python -c 'import torch; ...' ``` With the generated _rocm_init.py added to the published gdb71170c wheel on a gfx1201 sandbox, `import torch` succeeds without LD_LIBRARY_PATH and /proc/self/maps shows libamdhip64, libhsa-runtime64, librocblas, libMIOpen and librocm-openblas loaded from the rocm_sdk wheels. A full wheel build with the change was not run. Authored with an AI assistant (Claude Code). Co-authored-by: Claude Opus 5.5 <[email protected]> Take the ROCm SDK version for _rocm_init.py from the build environment (#5) * Take the ROCm SDK version for _rocm_init.py from the build environment tools/metadata/dependencies.py pins rocm[libraries] to PYTORCH_ROCM_SDK_VERSION, or to the rocm package installed in the build environment when the variable is unset, but torch/CMakeLists.txt only generated _rocm_init.py from the variable. A build that installs the SDK's rocm package instead of exporting the version got the dependency but no preload. Fall back to the installed rocm package in CMake too, so both read the same version. Test Plan: ``` cmake -P t.cmake # check_version='<installed rocm>' PYTORCH_ROCM_SDK_VERSION=9.9.9 cmake -P t.cmake # check_version='9.9.9' ``` Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Depend on the ROCm SDK device wheel too rocm[libraries] leaves out rocm-sdk-device-gfx1201, which carries the GPU code objects for rocBLAS, MIOpen and the other kpack-split libraries; without it their kernels fail with hipErrorInvalidKernelFile. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
cyyever
added a commit
that referenced
this pull request
Oct 31, 2026
Build and package trimmed ROCm SDK dependencies Fix ROCm wheel build blockers Fix ROCm 10.1 PyTorch HIP build blockers Build and package trimmed ROCm SDK dependencies Use external ROCm SDK libraries without pip runtime dependencies Use rocBLAS, hipBLASLt and MIOpen from the ROCm SDK The ROCm build downloaded a separate rocm-libraries revision (271344a4), built rocBLAS, hipBLASLt and MIOpen through ExternalProject and shipped them in torch/lib (~250 MB), and installed Caffe2 configs re-entered that logic so downstream builds such as vLLM fetched the 10 GB source again. That existed to get gfx1201-only kernels; the TheRock SDK now builds these libraries for gfx1201 itself, with our patches applied, so the bundled copies were a second, divergent build of the same libraries, and which one a process loaded depended on LD_LIBRARY_PATH. Find them from ROCM_PATH like the other ROCm components and drop cmake/External/rocm_bundled.cmake with its install rule, Caffe2Config plumbing and summary line. The mslk symbol hiding that landed with the bundling stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Avoid pip ROCm dependency for external SDK wheels Load the ROCm SDK version selected at wheel build time Load ROCm from the SDK wheels the torch wheel was built against (#4) ROCm wheels built against an unpacked TheRock SDK (PYTORCH_ROCM_EXTERNAL_SDK) declared no ROCm dependency and shipped no torch/_rocm_init.py, so `import torch` resolved librocm-openblas and the HIP libraries only through LD_LIBRARY_PATH or whatever ROCm the host's ld.so.conf exposed. On a Breadboard guest that is the accelerator pack's ROCm 10.0, not the 10.1 SDK the wheel was built and patched against; without LD_LIBRARY_PATH the import fails on librocm-openblas.so.0. The build now takes the SDK wheels' version from PYTORCH_ROCM_SDK_VERSION. tools/metadata/dependencies.py pins rocm[libraries] to it, and torch/CMakeLists.txt writes the _rocm_init.py that the existing install rule and torch/__init__.py already expect, so `import torch` preloads the SDK libraries from those wheels through rocm_sdk.initialize_process and checks the version. The preload list is TheRock's build_prod_wheels.py list minus hipdnn, which this SDK does not build. PYTORCH_ROCM_EXTERNAL_SDK is gone; the alternative of keeping it and fixing the guest's ld.so.conf would leave torch tied to whatever ROCm the host provides. Test Plan: ``` cmake -P test.cmake # the new block, with and without PYTORCH_ROCM_SDK_VERSION python -c 'import dependencies; ...' # rocm[libraries]==<version> env -u LD_LIBRARY_PATH python -c 'import torch; ...' ``` With the generated _rocm_init.py added to the published gdb71170c wheel on a gfx1201 sandbox, `import torch` succeeds without LD_LIBRARY_PATH and /proc/self/maps shows libamdhip64, libhsa-runtime64, librocblas, libMIOpen and librocm-openblas loaded from the rocm_sdk wheels. A full wheel build with the change was not run. Authored with an AI assistant (Claude Code). Co-authored-by: Claude Opus 5.5 <[email protected]> Take the ROCm SDK version for _rocm_init.py from the build environment (#5) * Take the ROCm SDK version for _rocm_init.py from the build environment tools/metadata/dependencies.py pins rocm[libraries] to PYTORCH_ROCM_SDK_VERSION, or to the rocm package installed in the build environment when the variable is unset, but torch/CMakeLists.txt only generated _rocm_init.py from the variable. A build that installs the SDK's rocm package instead of exporting the version got the dependency but no preload. Fall back to the installed rocm package in CMake too, so both read the same version. Test Plan: ``` cmake -P t.cmake # check_version='<installed rocm>' PYTORCH_ROCM_SDK_VERSION=9.9.9 cmake -P t.cmake # check_version='9.9.9' ``` Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Depend on the ROCm SDK device wheel too rocm[libraries] leaves out rocm-sdk-device-gfx1201, which carries the GPU code objects for rocBLAS, MIOpen and the other kpack-split libraries; without it their kernels fail with hipErrorInvalidKernelFile. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Test Plan History-only consolidation; all original patches replayed and the final tree compared exactly. ``` python3 agent_space/fold-v3/fold.py git diff --exit-code 320a29e HEAD ``` Prepared with an AI assistant.
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.
Draft until reviewed.
Agent details (AI-generated)
🤖 Generated with Claude Code