Repository navigation
[ROCm] Enable hipFile - #191069
[ROCm] Enable hipFile#191069zjliu-amd wants to merge 4 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/191069
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 5457d15 with merge base 2033053 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Rebase failed due to Command |
3fc2806 to
fc689cd
Compare
|
|
|
@pytorchbot rebase |
|
@pytorchbot fix-lint |
|
You don't have permissions to trigger lint fixes on this PR since it requires write access to the repository. If you think this is a mistake, please contact PyTorch Dev Infra. |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
fc689cd to
b057eeb
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
f1096d5 to
84dcd8d
Compare
|
Overall, the changes are fine. But, I think instead of making hipFile optional. We should make it required for ROCm > 7.14. |
fff578d to
b738e8b
Compare
|
Warning: Unknown label
Please add the new label to .github/pytorch-probot.yml |
|
#188429 |
|
@pytorchbot rebase -b main |
|
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
|
Successfully rebased |
b738e8b to
5457d15
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: rocm-preview / linux-noble-rocm-preview-py3.12-mi350 / test (distributed, 3, 3, linux.rocm.gpu.gfx950.2, module:rocm, oncall:distributed) Details for Dev Infra teamRaised by workflow job |
|
PR is blocked by a known failing test that was just DISABLED via issue. Merging and ignoring the unrelated failures here. @pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: .github/workflows/trunk.yml / linux-jammy-rocm-py3.10-mi350 / test (distributed, 3, 3, linux.rocm.gpu.gfx950.2), rocm-preview / linux-noble-rocm-preview-py3.12-mi350 / test (distributed, 3, 3, linux.rocm.gpu.gfx950.2, module:rocm, oncall:distributed) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
This PR enables hipFile in PyTorch by adding mappings to hipify and updating cmake files, adds more tests for GDS, and also adds a helper variable and a function to facilitate tests' skip condition. hipFile only ships with ROCm on ROCm 7.14 and later, therefore hipFile is only required after that version. Authored with Claude. Pull Request resolved: pytorch#191069 Approved by: https://github.com/jeffdaily
Issue link: #7329 ## Motivation Nightly PyTorch smoke tests fail and are blocked on Linux ROCm arches (observed on gfx1153) at `import torch` with: `[ERROR] Failed to retrieve GPU info: ERROR:libhipfile.so.0: cannot open shared object file: No such file or directory ` This started with the `10.1.0a20260811` nightly and is deterministic (not flaky) —`import torch` never succeeds, so it also masks any real underlying test failures. Failing CI jobs (rockrel run 31452759725, torch nightly, gfx1153): - py 3.12: https://github.com/ROCm/rockrel/actions/runs/31452759725/job/93678340937 - py 3.10: https://github.com/ROCm/rockrel/actions/runs/31452759725/job/93677958469 - py 3.13: https://github.com/ROCm/rockrel/actions/runs/31452759725/job/93678622649 <!-- GitHub issue: add tracking issue link here if one exists --> ## Technical Details Upstream PyTorch PR pytorch/pytorch#191069 ("[ROCm] Enable hipFile", commit `4c5b5ab032f2a4f3c7807925ea92fffa457423c2`, in nightly source since ~Aug 8) added `hip::hipfile` to `TORCH_PYTHON_LINK_LIBRARIES`. As a result `libtorch_python.so` now carries `NEEDED libhipfile.so.0`. In wheel installs, torch resolves its ROCm deps via the preload list we generate into `torch/_rocm_init.py` (loaded RTLD_GLOBAL on `import torch`), because torch's RUNPATH points at build-only paths. `libhipfile.so.0` does ship in the `rocm-sdk-core` wheel, but `hipfile` was never added to `LINUX_LIBRARY_PRELOADS`, so it is never preloaded and `import torch` fails to load it. This PR adds `"hipfile"` to `LINUX_LIBRARY_PRELOADS` in `external-builds/pytorch/build_prod_wheels.py`. `hipfile` is already declared as a core `LibraryEntry` in the rocm_sdk `_dist_info.py`, so the shortname resolves. Windows is unaffected (hipFile is Linux-only), so `WINDOWS_LIBRARY_PRELOADS` is left unchanged. ## Test Plan - Confirm `torch/_rocm_init.py` includes `'hipfile'` in `preload_shortnames`. - Recommended before merge: nightly gfx1153 PyTorch smoke test against this branch. ## Test Result Validated locally in a ROCm container with the TheRock `rocm-sdk` wheels: - Without fix: `ctypes.CDLL('libhipfile.so.0')` fails with `cannot open shared object file` (the CI error). - With the fix's preload (`initialize_process(preload_shortnames=[...,'hipfile'])`): `libhipfile.so.0` loads from rocm-sdk-core and resolves. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
Issue link: #7329 ## Motivation Nightly PyTorch smoke tests fail and are blocked on Linux ROCm arches (observed on gfx1153) at `import torch` with: `[ERROR] Failed to retrieve GPU info: ERROR:libhipfile.so.0: cannot open shared object file: No such file or directory ` This started with the `10.1.0a20260811` nightly and is deterministic (not flaky) —`import torch` never succeeds, so it also masks any real underlying test failures. Failing CI jobs (rockrel run 31452759725, torch nightly, gfx1153): - py 3.12: https://github.com/ROCm/rockrel/actions/runs/31452759725/job/93678340937 - py 3.10: https://github.com/ROCm/rockrel/actions/runs/31452759725/job/93677958469 - py 3.13: https://github.com/ROCm/rockrel/actions/runs/31452759725/job/93678622649 <!-- GitHub issue: add tracking issue link here if one exists --> ## Technical Details Upstream PyTorch PR pytorch/pytorch#191069 ("[ROCm] Enable hipFile", commit `4c5b5ab032f2a4f3c7807925ea92fffa457423c2`, in nightly source since ~Aug 8) added `hip::hipfile` to `TORCH_PYTHON_LINK_LIBRARIES`. As a result `libtorch_python.so` now carries `NEEDED libhipfile.so.0`. In wheel installs, torch resolves its ROCm deps via the preload list we generate into `torch/_rocm_init.py` (loaded RTLD_GLOBAL on `import torch`), because torch's RUNPATH points at build-only paths. `libhipfile.so.0` does ship in the `rocm-sdk-core` wheel, but `hipfile` was never added to `LINUX_LIBRARY_PRELOADS`, so it is never preloaded and `import torch` fails to load it. This PR adds `"hipfile"` to `LINUX_LIBRARY_PRELOADS` in `external-builds/pytorch/build_prod_wheels.py`. `hipfile` is already declared as a core `LibraryEntry` in the rocm_sdk `_dist_info.py`, so the shortname resolves. Windows is unaffected (hipFile is Linux-only), so `WINDOWS_LIBRARY_PRELOADS` is left unchanged. ## Test Plan - Confirm `torch/_rocm_init.py` includes `'hipfile'` in `preload_shortnames`. - Recommended before merge: nightly gfx1153 PyTorch smoke test against this branch. ## Test Result Validated locally in a ROCm container with the TheRock `rocm-sdk` wheels: - Without fix: `ctypes.CDLL('libhipfile.so.0')` fails with `cannot open shared object file` (the CI error). - With the fix's preload (`initialize_process(preload_shortnames=[...,'hipfile'])`): `libhipfile.so.0` loads from rocm-sdk-core and resolves. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
This PR enables hipFile in PyTorch by adding mappings to hipify and updating cmake files, adds more tests for GDS, and also adds a helper variable and a function to facilitate tests' skip condition.
hipFile only ships with ROCm on ROCm 7.14 and later, therefore hipFile is only required after that version.
Authored with Claude.
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang