Skip to content

Commit 0a7c98c

Browse files
Add libhipsparselt for PyTorch2.8+ (#87)
Validation: http://rocm-ci.amd.com/job/rocm-pytorch-manylinux-wheel-builder/4667/ `[2025-07-23T00:54:41.169Z] inflating: /tmp/tmp.qAjoCDGz2i/torch/lib/libhipsparselt.so`
1 parent fe72574 commit 0a7c98c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

manywheel/build_rocm.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ fi
7474
ROCM_VERSION_WITH_PATCH=rocm${ROCM_VERSION_MAJOR}.${ROCM_VERSION_MINOR}.${ROCM_VERSION_PATCH}
7575
ROCM_INT=$(($ROCM_VERSION_MAJOR * 10000 + $ROCM_VERSION_MINOR * 100 + $ROCM_VERSION_PATCH))
7676

77+
PYTORCH_VERSION=$(cat $PYTORCH_ROOT/version.txt | grep -oP "[0-9]+\.[0-9]+\.[0-9]+")
78+
7779
do_lightweight_build() {
7880
echo "=== Building LIGHTWEIGHT variant ==="
7981

@@ -159,7 +161,10 @@ do_heavyweight_build() {
159161
if [[ $ROCM_INT -ge 60200 ]]; then
160162
HEAVYWEIGHT_ROCM_SO_FILES+=("librocm-core.so")
161163
fi
162-
164+
165+
if [[ $(ver $PYTORCH_VERSION) -ge $(ver 2.8) ]]; then
166+
HEAVYWEIGHT_ROCM_SO_FILES+=("libhipsparselt.so")
167+
fi
163168

164169

165170
OS_NAME=`awk -F= '/^NAME/{print $2}' /etc/os-release`
@@ -339,7 +344,6 @@ ver() {
339344
# Add triton install dependency
340345
# No triton dependency till pytorch 2.3 on 3.12
341346
# since torch.compile doesn't work.
342-
PYTORCH_VERSION=$(cat $PYTORCH_ROOT/version.txt | grep -oP "[0-9]+\.[0-9]+\.[0-9]+")
343347
# Assuming PYTORCH_VERSION=x.y.z, if x >= 2
344348
if [ ${PYTORCH_VERSION%%\.*} -ge 2 ]; then
345349
if [[ $(uname) == "Linux" ]] && [[ "$DESIRED_PYTHON" != "3.12" || $(ver $PYTORCH_VERSION) -ge $(ver 2.4) ]]; then

0 commit comments

Comments
 (0)