Skip to content

Commit 684f6f2

Browse files
[release/2.6] Make triton build ROCm version agnostic (#2130)
Fixes http://rocm-ci.amd.com/job/mainline-pytorch2.6-manylinux-wheels-lw/ These are failing Passed log: http://rocm-ci.amd.com/job/mainline-pytorch2.6-manylinux-wheels-lw/104/ Failed log: http://rocm-ci.amd.com/job/mainline-pytorch2.6-manylinux-wheels-lw/106/ Error Observed: 14:44:13 +++ find /opt/ -name libamdhip64.so.5 14:44:13 ++ [[ -z '' ]] 14:44:13 ++ echo 'Error: Library file libamdhip64.so.5 is not found.' 14:44:13 Error: Library file libamdhip64.so.5 is not found. Was failing because rocm mainline became 7.0 and not 6.X. Removing the version calls. Validation: http://rocm-ci.amd.com/job/rocm-pytorch-manylinux-wheel-builder-lw/146/ Co-authored-by: Jithun Nair <[email protected]>
1 parent 751e48d commit 684f6f2

File tree

2 files changed

+14
-34
lines changed

2 files changed

+14
-34
lines changed

.github/scripts/amd/package_triton_wheel.sh

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -ex
23

34
# Set ROCM_HOME isn't available, use ROCM_PATH if set or /opt/rocm
@@ -50,31 +51,16 @@ do
5051
cp $lib $TRITON_ROCM_DIR/lib/
5152
done
5253

53-
# Required ROCm libraries
54-
if [[ "$MAJOR_VERSION" -ge 6 ]]; then
55-
libamdhip="libamdhip64.so.6"
56-
else
57-
libamdhip="libamdhip64.so.5"
58-
fi
59-
6054
# Required ROCm libraries - ROCm 6.0
6155
ROCM_SO=(
62-
"${libamdhip}"
63-
"libhsa-runtime64.so.1"
64-
"libdrm.so.2"
65-
"libdrm_amdgpu.so.1"
56+
"libamdhip64.so"
57+
"libhsa-runtime64.so"
58+
"libdrm.so"
59+
"libdrm_amdgpu.so"
60+
"libamd_comgr.so"
61+
"librocprofiler-register.so"
6662
)
6763

68-
if [[ $ROCM_INT -ge 60400 ]]; then
69-
ROCM_SO+=("libamd_comgr.so.3")
70-
else
71-
ROCM_SO+=("libamd_comgr.so.2")
72-
fi
73-
74-
if [[ $ROCM_INT -ge 60100 ]]; then
75-
ROCM_SO+=("librocprofiler-register.so.0")
76-
fi
77-
7864
for lib in "${ROCM_SO[@]}"
7965
do
8066
file_path=($(find $ROCM_HOME/lib/ -name "$lib")) # First search in lib
@@ -95,10 +81,6 @@ do
9581
fi
9682

9783
cp $file_path $TRITON_ROCM_DIR/lib
98-
# When running locally, and not building a wheel, we need to satisfy shared objects requests that don't look for versions
99-
LINKNAME=$(echo $lib | sed -e 's/\.so.*/.so/g')
100-
ln -sf $lib $TRITON_ROCM_DIR/lib/$LINKNAME
101-
10284
done
10385

10486
# Copy Include Files

.github/scripts/amd/patch_triton_wheel.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ replace_needed_sofiles() {
1919
find $1 -name '*.so*' -o -name 'ld.lld' | while read sofile; do
2020
origname=$2
2121
patchedname=$3
22-
if [[ "$origname" != "$patchedname" ]]; then
23-
set +e
24-
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*")
25-
ERRCODE=$?
26-
set -e
27-
if [ "$ERRCODE" -eq "0" ]; then
28-
echo "patching $sofile entry $origname to $patchedname"
29-
$PATCHELF_BIN --replace-needed $origname $patchedname $sofile
30-
fi
22+
set +e
23+
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*")
24+
ERRCODE=$?
25+
set -e
26+
if [ "$ERRCODE" -eq "0" ]; then
27+
echo "patching $sofile entry $origname to $patchedname"
28+
$PATCHELF_BIN --replace-needed $origname $patchedname $sofile
3129
fi
3230
done
3331
}

0 commit comments

Comments
 (0)