Repository navigation
[release/2.15] [ROCm] Keep TheRock's _rocm_sdk_core visible in TestAmdSmiImport (#200967) - #3846
Merged
jeffdaily merged 1 commit intoOct 19, 2026
Conversation
…orch#200967) ## Linked issue or supporting maintainer Supported by @jeffdaily Related: ROCm/TheRock#8888 (the CI lane where the test fails), pytorch#200650 (the first fix for this test) and pytorch#197482, which added the test. ## BC-breaking? No. ## Summary (human written only) Still getting failures after pytorch#200650 landed, this should fix the next failure that was hidden by the first. ## Agent details (if applicable) `test_amdsmi_bare_unversioned_path_uses_loader_first` still fails in the TheRock nightly wheel tests after pytorch#200650, now with exit code 1 during `import torch` in the child: `FileNotFoundError: Could not find rocm library 'amd_comgr' at path '/tmp/.../_rocm_sdk_core/lib'`. `_run_amdsmi_import` writes a stub `_rocm_sdk_core` package into its temp dir, which is the child's cwd and first on `PYTHONPATH`. TheRock wheels preload ROCm libraries from the real `_rocm_sdk_core` during `import torch`, so the stub shadows it and the preload fails. This creates the stub only when no real `_rocm_sdk_core` is importable. When one is installed, its versioned `libamd_smi.so` is the SDK fallback, and the test's assertion (a bare `libamd_smi.so` request uses the loader path first) is unchanged. Upstream CI has no `_rocm_sdk_core`, so nothing changes there. Validation on gfx942, done with Claude, using the TheRock nightly `torch 2.16.0a0+rocm10.2.0a20261014` (git ca883d5) with the test file at that commit. Before: `test_amdsmi_bare_unversioned_path_uses_loader_first` fails with the `amd_comgr` error above and the other four TestAmdSmiImport tests pass. After: all five pass in three runs; the child imports the real `_rocm_sdk_core` (which ships `libamd_smi.so.27`) and the bare request resolves through the loader path. The no-SDK path was not rerun, since the guard is a no-op there. lintrunner clean on main. Pull Request resolved: pytorch#200967 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <jeff.daily@amd.com> (cherry picked from commit 5f1fcd2)
jeffdaily
deleted the
jeffdaily/release-2.15-amdsmi-real-rocm-sdk-core
branch
October 19, 2026 15:56
jithunnair-amd
pushed a commit
that referenced
this pull request
Nov 4, 2026
…dSmiImport (pytorch#200967) (#3846) ## Linked issue or supporting maintainer Supported by @jeffdaily Related: ROCm/TheRock#8888 (the CI lane where the test fails), pytorch#200650 (the first fix for this test) and pytorch#197482, which added the test. ## BC-breaking? No. ## Summary (human written only) Still getting failures after pytorch#200650 landed, this should fix the next failure that was hidden by the first. ## Agent details (if applicable) `test_amdsmi_bare_unversioned_path_uses_loader_first` still fails in the TheRock nightly wheel tests after pytorch#200650, now with exit code 1 during `import torch` in the child: `FileNotFoundError: Could not find rocm library 'amd_comgr' at path '/tmp/.../_rocm_sdk_core/lib'`. `_run_amdsmi_import` writes a stub `_rocm_sdk_core` package into its temp dir, which is the child's cwd and first on `PYTHONPATH`. TheRock wheels preload ROCm libraries from the real `_rocm_sdk_core` during `import torch`, so the stub shadows it and the preload fails. This creates the stub only when no real `_rocm_sdk_core` is importable. When one is installed, its versioned `libamd_smi.so` is the SDK fallback, and the test's assertion (a bare `libamd_smi.so` request uses the loader path first) is unchanged. Upstream CI has no `_rocm_sdk_core`, so nothing changes there. Validation on gfx942, done with Claude, using the TheRock nightly `torch 2.16.0a0+rocm10.2.0a20261014` (git ca883d5) with the test file at that commit. Before: `test_amdsmi_bare_unversioned_path_uses_loader_first` fails with the `amd_comgr` error above and the other four TestAmdSmiImport tests pass. After: all five pass in three runs; the child imports the real `_rocm_sdk_core` (which ships `libamd_smi.so.27`) and the bare request resolves through the loader path. The no-SDK path was not rerun, since the guard is a no-op there. lintrunner clean on main. Pull Request resolved: pytorch#200967 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <jeff.daily@amd.com>
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.
Linked issue or supporting maintainer
Supported by @jeffdaily
Related: ROCm/TheRock#8888 (the CI lane where the test fails), pytorch#200650 (the first fix for this test) and pytorch#197482, which added the test.
BC-breaking?
No.
Summary (human written only)
Still getting failures after pytorch#200650 landed, this should fix the next failure that was hidden by the first.
Agent details (if applicable)
test_amdsmi_bare_unversioned_path_uses_loader_firststill fails in the TheRock nightly wheel tests after pytorch#200650, now with exit code 1 duringimport torchin the child:FileNotFoundError: Could not find rocm library 'amd_comgr' at path '/tmp/.../_rocm_sdk_core/lib'._run_amdsmi_importwrites a stub_rocm_sdk_corepackage into its temp dir, which is the child's cwd and first onPYTHONPATH. TheRock wheels preload ROCm libraries from the real_rocm_sdk_coreduringimport torch, so the stub shadows it and the preload fails. This creates the stub only when no real_rocm_sdk_coreis importable. When one is installed, its versionedlibamd_smi.sois the SDK fallback, and the test's assertion (a barelibamd_smi.sorequest uses the loader path first) is unchanged. Upstream CI has no_rocm_sdk_core, so nothing changes there.Validation on gfx942, done with Claude, using the TheRock nightly
torch 2.16.0a0+rocm10.2.0a20261014(git ca883d5) with the test file at that commit. Before:test_amdsmi_bare_unversioned_path_uses_loader_firstfails with theamd_comgrerror above and the other four TestAmdSmiImport tests pass. After: all five pass in three runs; the child imports the real_rocm_sdk_core(which shipslibamd_smi.so.27) and the bare request resolves through the loader path. The no-SDK path was not rerun, since the guard is a no-op there. lintrunner clean on main.Pull Request resolved: pytorch#200967
Approved by: https://github.com/jeffdaily
Co-authored-by: Jeff Daily jeff.daily@amd.com