Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/189900
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 4eb9fe3 with merge base 5a7eae4 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The ldconfig loader-path wiring, TORCH_SERIALIZATION_DEBUG, and ROCPROFILER_LOG_LEVEL workarounds in run_pytorch_tests_full.py belong in pytorch upstream (pytorch/pytorch#189900 / _preload_rocm_deps), not in the TheRock test harness. Reverts b7ec75f. Restores the 10 skips that were removed in 72630b5 on the basis of those harness fixes: multiprocessing/test_fs x5, utils/test_load_standalone, inductor/tmp_not_defined + vec_isa, serialization/test_debug_set_in_ci, dynamo/test_logs_out. Co-Authored-By: Claude <[email protected]>
|
@pytorchbot rebase |
The ROCm manywheel repair step renames bundled ROCm libs to bare .so filenames and rewrites NEEDED references to match. #182696 ported this from build_common.sh to repair_wheel.py and collapsed the shell script's two phases (copy every DEPS_LIST lib into torch/lib, then run replace_needed_sofiles for every soname) into a single per-lib loop that copies a lib and immediately rewrites references to it. replace_needed only visits files present in the wheel at call time, so references from a bundled lib to any lib listed earlier in ROCM_SO_FILES are never rewritten: the dependent has not been copied in yet when its dependency's rewrite pass runs. The 2.13.0+rocm7.2 wheel ships 27 such dangling NEEDED entries (libhiprtc.so -> libamd_comgr.so.3, librocblas.so -> libamdhip64.so.7, libmagma.so -> libhipblas.so.3, ...). Most resolve at runtime by luck (the bundled file keeps its versioned SONAME, so a copy already loaded under that SONAME satisfies the ref) or from a system ROCm install via ldconfig, which is why this went unnoticed until the cold dlopen introduced by #183515 hit the libamd_comgr.so.3 ref on a machine with no ROCm (#189194). The fix restores the two-phase structure: copy all bundled libs (and their bare-name dlopen symlinks from #189110) first, then run the rewrite passes. A new check_no_dangling_bundled_needed pass then fails the build if any lib in torch/lib still references a versioned soname whose stem is bundled but whose exact name is not shipped, so a future ordering or list regression breaks the build instead of shipping a wheel that silently depends on a system ROCm install. This complements #189900, which makes the inductor VecISA probe recover from such wheels at runtime; this change makes newly built wheels self-contained again. Test Plan: Ran the real repair_wheel() from before and after the change on a minimal fake torch wheel bundling this host's actual ROCm libs in the regression order (libhsa-runtime64 listed before libroctracer64, which NEEDs libhsa-runtime64.so.1): the old code ships the stale versioned ref with no error, the new code rewrites it to libhsa-runtime64.so and the new check passes. Aimed check_no_dangling_bundled_needed at the torch/lib of the actual torch==2.13.0+rocm7.2 wheel (installed from download.pytorch.org/whl/test/rocm7.2): it fails the build listing all 27 dangling references, including the libamd_comgr.so.3 ones from #189194. ``` python validate_repair_wheel.py # A/B harness driving repair_wheel() from both revisions ``` Authored with Claude (AI assistant).
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
The ROCm manywheel build bundles the ROCm runtime into torch/lib under unversioned filenames (libamd_comgr.so, libamdhip64.so, ...) and rewrites consumers' DT_NEEDED entries to match, but some entries are missed: in the 2.13.0+rocm7.2 wheel, libhiprtc.so, librocprofiler-sdk.so, and librocroller.so still reference libamd_comgr.so.3, a filename that does not exist in the wheel. After `import torch` this is harmless: the bundled libamd_comgr.so is already loaded and registered under its unchanged SONAME libamd_comgr.so.3, so those references resolve against the in-process copy. A cold dlopen has no such copy, so on a machine without a system ROCm install the load fails (a ROCm docker image masks the bug because /opt/rocm provides libamd_comgr.so.3 via ldconfig). #183515 changed the VecISA dlopen probe child from `import torch` + dlopen to a cold dlopen with `LD_LIBRARY_PATH=<torch>/lib`, so on such a machine every `check_build` fails and inductor reports "Can't detect vectorized ISA for CPU". The fix keeps the fast no-import path but retries after `import torch` if the cold dlopen raises OSError, so whatever loading semantics the wheel relies on are in effect before the second attempt. This also covers the same class of failure for TheRock-based ROCm wheels (ROCm libs preloaded from separate rocm-sdk packages with no rpath) and the latent CUDA case where torch and the nvidia wheels are installed into different site-packages roots and the `$ORIGIN`-relative rpaths dangle (the case `_preload_cuda_deps` exists for). The 60s probe timeout from #183515 still bounds the child either way, so the CI hang that change addressed stays fixed. The missed DT_NEEDED rewrites are arguably a wheel packaging bug worth fixing at the source, but the probe fallback repairs wheels already shipped and does not hardcode any packaging layout into inductor. Fixes #189194 Test Plan: Reproduced the failure with the actual 2.13.0+rocm7.2 test wheel in a venv on a ROCm host, using the glibc loader's --inhibit-cache to get the loader semantics of a machine with no system ROCm: ``` pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/test/rocm7.2 # build the real VecISA probe .so via CppBuilder, then: env -u LD_LIBRARY_PATH /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 --inhibit-cache --library-path <venv>/torch/lib python -c "<probe script>" ``` The pre-fix probe script fails with "OSError: libamd_comgr.so.3: cannot open shared object file" (the exact #189194 failure); the fixed script succeeds via the import torch fallback. New regression test simulates the layout without needing a ROCm wheel: a probe .so that DT_NEEDEDs libc10.so with no rpath fails to cold-load when LD_LIBRARY_PATH is stripped, and the probe script must recover by importing torch: ``` python test/inductor/test_codecache.py TestVecISACheckBuild ``` All four tests in the class pass on a Linux x86_64 ROCm build, and the fast path still detects VecAVX2 end to end through `valid_vec_isa_list()` without importing torch in the child. Authored with Claude (AI assistant).
|
Successfully rebased |
04bfaea to
4eb9fe3
Compare
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
@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 |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@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 |
#189906) The ROCm manywheel repair step renames bundled ROCm libs to bare `.so` filenames and rewrites NEEDED references to match. #182696 ported this from build_common.sh to repair_wheel.py and collapsed the shell script's two phases (copy every DEPS_LIST lib into torch/lib, then run replace_needed_sofiles for every soname) into a single per-lib loop that copies a lib and immediately rewrites references to it. `replace_needed` only visits files present in the wheel at call time, so references from a bundled lib to any lib listed earlier in ROCM_SO_FILES are never rewritten: the dependent has not been copied in yet when its dependency's rewrite pass runs. The 2.13.0+rocm7.2 wheel ships 27 such dangling NEEDED entries (`libhiprtc.so -> libamd_comgr.so.3`, `librocblas.so -> libamdhip64.so.7`, `libmagma.so -> libhipblas.so.3`, ...). Most resolve at runtime by luck (the bundled file keeps its versioned SONAME, so a copy already loaded under that SONAME satisfies the ref) or from a system ROCm install via ldconfig, which is why this went unnoticed until the cold dlopen introduced by #183515 hit the `libamd_comgr.so.3` ref on a machine with no ROCm (#189194). The fix restores the two-phase structure: copy all bundled libs (and their bare-name dlopen symlinks from #189110) first, then run the rewrite passes. A new `check_no_dangling_bundled_needed` pass then fails the build if any lib in torch/lib still references a versioned soname whose stem is bundled but whose exact name is not shipped, so a future ordering or list regression breaks the build instead of shipping a wheel that silently depends on a system ROCm install. This complements #189900, which makes the inductor VecISA probe recover from such wheels at runtime; this change makes newly built wheels self-contained again. Validated by running the real `repair_wheel()` from before and after the change on a minimal fake torch wheel bundling actual ROCm libs in the regression order (libhsa-runtime64 listed before libroctracer64, which NEEDs libhsa-runtime64.so.1): the old code ships the stale versioned ref with no error, the new code rewrites it to libhsa-runtime64.so and the new check passes. Aiming `check_no_dangling_bundled_needed` at the torch/lib of the actual torch==2.13.0+rocm7.2 wheel fails the build listing all 27 dangling references, including the `libamd_comgr.so.3` ones from #189194. This PR was authored with Claude (AI assistant). Pull Request resolved: #189906 Approved by: https://github.com/atalman, https://github.com/jithunnair-amd
|
@pytorchbot cherry-pick --onto release/2.14 -c critical |
Cherry picking #189900The cherry pick PR is at #193601 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated: Details for Dev Infra teamRaised by workflow job |
#193600) [ROCm] Rewrite bundled-lib NEEDED entries after all libs are copied in (#189906) The ROCm manywheel repair step renames bundled ROCm libs to bare `.so` filenames and rewrites NEEDED references to match. #182696 ported this from build_common.sh to repair_wheel.py and collapsed the shell script's two phases (copy every DEPS_LIST lib into torch/lib, then run replace_needed_sofiles for every soname) into a single per-lib loop that copies a lib and immediately rewrites references to it. `replace_needed` only visits files present in the wheel at call time, so references from a bundled lib to any lib listed earlier in ROCM_SO_FILES are never rewritten: the dependent has not been copied in yet when its dependency's rewrite pass runs. The 2.13.0+rocm7.2 wheel ships 27 such dangling NEEDED entries (`libhiprtc.so -> libamd_comgr.so.3`, `librocblas.so -> libamdhip64.so.7`, `libmagma.so -> libhipblas.so.3`, ...). Most resolve at runtime by luck (the bundled file keeps its versioned SONAME, so a copy already loaded under that SONAME satisfies the ref) or from a system ROCm install via ldconfig, which is why this went unnoticed until the cold dlopen introduced by #183515 hit the `libamd_comgr.so.3` ref on a machine with no ROCm (#189194). The fix restores the two-phase structure: copy all bundled libs (and their bare-name dlopen symlinks from #189110) first, then run the rewrite passes. A new `check_no_dangling_bundled_needed` pass then fails the build if any lib in torch/lib still references a versioned soname whose stem is bundled but whose exact name is not shipped, so a future ordering or list regression breaks the build instead of shipping a wheel that silently depends on a system ROCm install. This complements #189900, which makes the inductor VecISA probe recover from such wheels at runtime; this change makes newly built wheels self-contained again. Validated by running the real `repair_wheel()` from before and after the change on a minimal fake torch wheel bundling actual ROCm libs in the regression order (libhsa-runtime64 listed before libroctracer64, which NEEDs libhsa-runtime64.so.1): the old code ships the stale versioned ref with no error, the new code rewrites it to libhsa-runtime64.so and the new check passes. Aiming `check_no_dangling_bundled_needed` at the torch/lib of the actual torch==2.13.0+rocm7.2 wheel fails the build listing all 27 dangling references, including the `libamd_comgr.so.3` ones from #189194. This PR was authored with Claude (AI assistant). Pull Request resolved: #189906 Approved by: https://github.com/atalman, https://github.com/jithunnair-amd (cherry picked from commit 4973620) Co-authored-by: Jeff Daily <[email protected]>
…re (#193601) [ROCm] Retry VecISA dlopen probe with import torch on cold load failure (#189900) Fixes #189194 The ROCm manywheel build bundles the ROCm runtime into torch/lib under unversioned filenames (libamd_comgr.so, libamdhip64.so, ...) and rewrites consumers' DT_NEEDED entries to match, but some entries are missed: in the 2.13.0+rocm7.2 wheel, libhiprtc.so, librocprofiler-sdk.so, and librocroller.so still reference libamd_comgr.so.3, a filename that does not exist in the wheel. After `import torch` this is harmless: the bundled libamd_comgr.so is already loaded and registered under its unchanged SONAME libamd_comgr.so.3, so those references resolve against the in-process copy. A cold dlopen has no such copy, so on a machine without a system ROCm install the load fails (a ROCm docker image masks the bug because /opt/rocm provides libamd_comgr.so.3 via ldconfig). #183515 changed the VecISA dlopen probe child from `import torch` + dlopen to a cold dlopen with `LD_LIBRARY_PATH=<torch>/lib`, so on such a machine every `check_build` fails and inductor reports "Can't detect vectorized ISA for CPU". Thanks to @karthickai and @atalman for bisecting to #183515 on the issue. The fix keeps the fast no-import path but retries after `import torch` if the cold dlopen raises OSError, so whatever loading semantics the wheel relies on are in effect before the second attempt. This also covers the same class of failure for TheRock-based ROCm wheels (ROCm libs preloaded from separate rocm-sdk packages with no rpath) and the latent CUDA case where torch and the nvidia wheels land in different site-packages roots and the `$ORIGIN`-relative rpaths dangle. The 60s probe timeout from #183515 still bounds the child either way, so the CI hang that change addressed stays fixed. The missed DT_NEEDED rewrites are arguably a wheel packaging bug worth fixing at the source, but the probe fallback repairs wheels already shipped and does not hardcode packaging layout into inductor. Reproduced and validated with the actual 2.13.0+rocm7.2 test wheel in a venv, using the glibc loader's `--inhibit-cache` to emulate a machine with no system ROCm: the pre-fix probe script fails with `OSError: libamd_comgr.so.3: cannot open shared object file` and the fixed script succeeds. The new regression test simulates the layout without needing a ROCm wheel: ``` python test/inductor/test_codecache.py TestVecISACheckBuild ``` This PR was authored with Claude (AI assistant). Pull Request resolved: #189900 Approved by: https://github.com/atalman (cherry picked from commit 74e49c1) Co-authored-by: Jeff Daily <[email protected]>
…re (pytorch#189900) Fixes pytorch#189194 The ROCm manywheel build bundles the ROCm runtime into torch/lib under unversioned filenames (libamd_comgr.so, libamdhip64.so, ...) and rewrites consumers' DT_NEEDED entries to match, but some entries are missed: in the 2.13.0+rocm7.2 wheel, libhiprtc.so, librocprofiler-sdk.so, and librocroller.so still reference libamd_comgr.so.3, a filename that does not exist in the wheel. After `import torch` this is harmless: the bundled libamd_comgr.so is already loaded and registered under its unchanged SONAME libamd_comgr.so.3, so those references resolve against the in-process copy. A cold dlopen has no such copy, so on a machine without a system ROCm install the load fails (a ROCm docker image masks the bug because /opt/rocm provides libamd_comgr.so.3 via ldconfig). pytorch#183515 changed the VecISA dlopen probe child from `import torch` + dlopen to a cold dlopen with `LD_LIBRARY_PATH=<torch>/lib`, so on such a machine every `check_build` fails and inductor reports "Can't detect vectorized ISA for CPU". Thanks to @karthickai and @atalman for bisecting to pytorch#183515 on the issue. The fix keeps the fast no-import path but retries after `import torch` if the cold dlopen raises OSError, so whatever loading semantics the wheel relies on are in effect before the second attempt. This also covers the same class of failure for TheRock-based ROCm wheels (ROCm libs preloaded from separate rocm-sdk packages with no rpath) and the latent CUDA case where torch and the nvidia wheels land in different site-packages roots and the `$ORIGIN`-relative rpaths dangle. The 60s probe timeout from pytorch#183515 still bounds the child either way, so the CI hang that change addressed stays fixed. The missed DT_NEEDED rewrites are arguably a wheel packaging bug worth fixing at the source, but the probe fallback repairs wheels already shipped and does not hardcode packaging layout into inductor. Reproduced and validated with the actual 2.13.0+rocm7.2 test wheel in a venv, using the glibc loader's `--inhibit-cache` to emulate a machine with no system ROCm: the pre-fix probe script fails with `OSError: libamd_comgr.so.3: cannot open shared object file` and the fixed script succeeds. The new regression test simulates the layout without needing a ROCm wheel: ``` python test/inductor/test_codecache.py TestVecISACheckBuild ``` This PR was authored with Claude (AI assistant). Pull Request resolved: pytorch#189900 Approved by: https://github.com/atalman
pytorch#189906) The ROCm manywheel repair step renames bundled ROCm libs to bare `.so` filenames and rewrites NEEDED references to match. pytorch#182696 ported this from build_common.sh to repair_wheel.py and collapsed the shell script's two phases (copy every DEPS_LIST lib into torch/lib, then run replace_needed_sofiles for every soname) into a single per-lib loop that copies a lib and immediately rewrites references to it. `replace_needed` only visits files present in the wheel at call time, so references from a bundled lib to any lib listed earlier in ROCM_SO_FILES are never rewritten: the dependent has not been copied in yet when its dependency's rewrite pass runs. The 2.13.0+rocm7.2 wheel ships 27 such dangling NEEDED entries (`libhiprtc.so -> libamd_comgr.so.3`, `librocblas.so -> libamdhip64.so.7`, `libmagma.so -> libhipblas.so.3`, ...). Most resolve at runtime by luck (the bundled file keeps its versioned SONAME, so a copy already loaded under that SONAME satisfies the ref) or from a system ROCm install via ldconfig, which is why this went unnoticed until the cold dlopen introduced by pytorch#183515 hit the `libamd_comgr.so.3` ref on a machine with no ROCm (pytorch#189194). The fix restores the two-phase structure: copy all bundled libs (and their bare-name dlopen symlinks from pytorch#189110) first, then run the rewrite passes. A new `check_no_dangling_bundled_needed` pass then fails the build if any lib in torch/lib still references a versioned soname whose stem is bundled but whose exact name is not shipped, so a future ordering or list regression breaks the build instead of shipping a wheel that silently depends on a system ROCm install. This complements pytorch#189900, which makes the inductor VecISA probe recover from such wheels at runtime; this change makes newly built wheels self-contained again. Validated by running the real `repair_wheel()` from before and after the change on a minimal fake torch wheel bundling actual ROCm libs in the regression order (libhsa-runtime64 listed before libroctracer64, which NEEDs libhsa-runtime64.so.1): the old code ships the stale versioned ref with no error, the new code rewrites it to libhsa-runtime64.so and the new check passes. Aiming `check_no_dangling_bundled_needed` at the torch/lib of the actual torch==2.13.0+rocm7.2 wheel fails the build listing all 27 dangling references, including the `libamd_comgr.so.3` ones from pytorch#189194. This PR was authored with Claude (AI assistant). Pull Request resolved: pytorch#189906 Approved by: https://github.com/atalman, https://github.com/jithunnair-amd
Fixes #189194
The ROCm manywheel build bundles the ROCm runtime into torch/lib under unversioned filenames (libamd_comgr.so, libamdhip64.so, ...) and rewrites consumers' DT_NEEDED entries to match, but some entries are missed: in the 2.13.0+rocm7.2 wheel, libhiprtc.so, librocprofiler-sdk.so, and librocroller.so still reference libamd_comgr.so.3, a filename that does not exist in the wheel. After
import torchthis is harmless: the bundled libamd_comgr.so is already loaded and registered under its unchanged SONAME libamd_comgr.so.3, so those references resolve against the in-process copy. A cold dlopen has no such copy, so on a machine without a system ROCm install the load fails (a ROCm docker image masks the bug because /opt/rocm provides libamd_comgr.so.3 via ldconfig). #183515 changed the VecISA dlopen probe child fromimport torch+ dlopen to a cold dlopen withLD_LIBRARY_PATH=<torch>/lib, so on such a machine everycheck_buildfails and inductor reports "Can't detect vectorized ISA for CPU". Thanks to @karthickai and @atalman for bisecting to #183515 on the issue.The fix keeps the fast no-import path but retries after
import torchif the cold dlopen raises OSError, so whatever loading semantics the wheel relies on are in effect before the second attempt. This also covers the same class of failure for TheRock-based ROCm wheels (ROCm libs preloaded from separate rocm-sdk packages with no rpath) and the latent CUDA case where torch and the nvidia wheels land in different site-packages roots and the$ORIGIN-relative rpaths dangle. The 60s probe timeout from #183515 still bounds the child either way, so the CI hang that change addressed stays fixed. The missed DT_NEEDED rewrites are arguably a wheel packaging bug worth fixing at the source, but the probe fallback repairs wheels already shipped and does not hardcode packaging layout into inductor.Reproduced and validated with the actual 2.13.0+rocm7.2 test wheel in a venv, using the glibc loader's
--inhibit-cacheto emulate a machine with no system ROCm: the pre-fix probe script fails withOSError: libamd_comgr.so.3: cannot open shared object fileand the fixed script succeeds. The new regression test simulates the layout without needing a ROCm wheel:This PR was authored with Claude (AI assistant).
cc @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben