Skip to content

Commit d2aa57c

Browse files
okakarpaethanwee1jithunnair-amd
committed
[AUTOGENERATED] [release/2.7] Make triton build ROCm version agnostic (#2165)
Cherry-pick of #2130 Validation: http://rocm-ci.amd.com/job/rocm-pytorch-manylinux-wheel-builder-lw/155/ --------- Co-authored-by: Ethan Wee <[email protected]> Co-authored-by: Jithun Nair <[email protected]>
1 parent 8228167 commit d2aa57c

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

.github/scripts/amd/package_triton_wheel.sh

Lines changed: 7 additions & 20 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,26 +51,16 @@ do
5051
cp $lib $TRITON_ROCM_DIR/lib/
5152
done
5253

53-
# Required ROCm libraries
54-
if [[ "${MAJOR_VERSION}" == "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-
"libamd_comgr.so.2"
65-
"libdrm.so.2"
66-
"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"
6762
)
6863

69-
if [[ $ROCM_INT -ge 60100 ]]; then
70-
ROCM_SO+=("librocprofiler-register.so.0")
71-
fi
72-
7364
for lib in "${ROCM_SO[@]}"
7465
do
7566
file_path=($(find $ROCM_HOME/lib/ -name "$lib")) # First search in lib
@@ -90,10 +81,6 @@ do
9081
fi
9182

9283
cp $file_path $TRITON_ROCM_DIR/lib
93-
# When running locally, and not building a wheel, we need to satisfy shared objects requests that don't look for versions
94-
LINKNAME=$(echo $lib | sed -e 's/\.so.*/.so/g')
95-
ln -sf $lib $TRITON_ROCM_DIR/lib/$LINKNAME
96-
9784
done
9885

9986
# 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)