Skip to content

[release/2.15] [ROCm] Keep TheRock's _rocm_sdk_core visible in TestAmdSmiImport (#200967) - #3846

Merged
jeffdaily merged 1 commit into
release/2.15from
jeffdaily/release-2.15-amdsmi-real-rocm-sdk-core
Oct 19, 2026
Merged

jeffdaily merged 1 commit into
release/2.15from
jeffdaily/release-2.15-amdsmi-real-rocm-sdk-core

Conversation

@jeffdaily

Copy link
Copy Markdown
Collaborator

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

…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
jeffdaily merged commit 00947b5 into release/2.15 Oct 19, 2026
@jeffdaily
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant