Public bug reported:

[ Impact ]

 * pytorch-rocm fails to build from source (FTBFS) in resolute once the ROCm
   stack is updated to 7.2.4. Without this fix pytorch-rocm becomes
   unbuildable in resolute after the ROCm 7.2.4 SRU lands, so it must be SRUed
   together with the rest of the stack.

 * Root cause: the ROCm 7.2.x stack builds against the LLVM 22 toolchain
   (7.1.x used LLVM 21). pytorch-rocm's d/rules still pointed hipcc/clang at
   the LLVM 21 device-library path, so the HIP device compile could not locate
   the ROCm device bitcode:

     clang++: error: cannot find ROCm device library; provide its path via
     '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build
     without ROCm device library

 * The fix is packaging-only. No change to pytorch itself — no source patch,
   no ABI or API change on the pytorch side. It only realigns the build
   toolchain (LLVM 21 -> 22) and the ROCm stack restriction (7.1 -> 7.2) so
   the existing sources build against ROCm 7.2.4.

 * Because there is no ABI/API change on the pytorch side, this update does not
   interfere with future security fixes to pytorch-rocm — a later security
   upload can be applied on top without conflicting with this packaging change.
   And without this SRU pytorch-rocm being FTBFS would cause friction to apply
   security fixes later.

[ Test Plan ]

 * Reproduce: with the ROCm 7.2.4 stack available (from the staging PPA or
   -proposed once the stack has landed), attempt to build the current resolute
   pytorch-rocm (2.9.1+dfsg-1~exp2ubuntu3). The HIP device compile fails with
   "cannot find ROCm device library" as above.

 * Verify the fix: build the updated pytorch-rocm (llvm-22 /
   HIP_DEVICE_LIB_PATH changes) against the ROCm 7.2.4 stack on amd64. The
   package must build to completion and produce its binaries (done in the
   staging PPA).

 * Post-build sanity: install the resulting python3-torch (ROCm) on an AMD GPU
   host and import torch:
     python3 -c "import torch; print(torch.__version__); 
print(torch.version.hip); print(torch.cuda.is_available())"
   torch.version.hip should reflect the 7.2 build and a supported GPU detected.

[ Where problems could occur ]

 * The change moves the whole pytorch-rocm build from LLVM 21 to LLVM 22. If
   any part of pytorch's HIP codegen relied on LLVM-21-specific behaviour, it
   could surface as a build failure or as miscompiled GPU kernels at runtime
   rather than at build time. Regression testing should therefore include
   actually running torch on GPU (a small tensor op / matmul), not just a
   successful build.

 * HIP_DEVICE_LIB_PATH is hard-coded to
   /usr/lib/llvm-22/lib/clang/22/amdgcn/bitcode. If a future LLVM point update
   changes that path layout, the device-lib lookup would break again the same
   way — the same class of hard-coded path the bug fixes, just retargeted.

 * This upload is inseparable from the ROCm 7.2.4 stack: building the new
   pytorch-rocm against a 7.1.x/LLVM-21 stack would itself fail. It must
   migrate together with the ROCm 7.2.4 SRU, not ahead of it.

 * Risk is otherwise contained: no pytorch source code changed, so runtime
   API behaviour of torch is unchanged relative to the current resolute
   version apart from being built against the newer ROCm libraries.

[ Other Info ]

 * Part of the ROCm 7.2.4 -> resolute stack SRU tracked in LP: #2150312
   (src:rocm). pytorch-rocm is a reverse dependency of the ROCm stack that
   FTBFS after the 7.2.4 bump; this bug is the packaging fix required to keep
   it building.

** Affects: pytorch-rocm (Ubuntu)
     Importance: Undecided
         Status: Fix Committed

** Affects: pytorch-rocm (Ubuntu Resolute)
     Importance: Undecided
     Assignee: Talha Can Havadar (tchavadar)
         Status: New

** Affects: pytorch-rocm (Ubuntu Stonking)
     Importance: Undecided
         Status: Fix Committed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2161163

Title:
  SRU: pytorch-rocm 2.9.1+dfsg-1~exp2ubuntu4 to resolute

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pytorch-rocm/+bug/2161163/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to