mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Make triton build ROCm library version-agnostic (#158408)
Fixes maintenance of triton packaging script when library versions change from one ROCm version to next. Pull Request resolved: https://github.com/pytorch/pytorch/pull/158408 Approved by: https://github.com/jeffdaily Co-authored-by: Ethan Wee <Ethan.Wee@amd.com>
This commit is contained in:
parent
70ccdec44b
commit
4cde0acc0e
31
.github/scripts/amd/package_triton_wheel.sh
vendored
31
.github/scripts/amd/package_triton_wheel.sh
vendored
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Set ROCM_HOME isn't available, use ROCM_PATH if set or /opt/rocm
|
||||
|
|
@ -50,29 +51,15 @@ do
|
|||
cp $lib $TRITON_ROCM_DIR/lib/
|
||||
done
|
||||
|
||||
# Required ROCm libraries
|
||||
if [[ "${MAJOR_VERSION}" == "6" ]]; then
|
||||
libamdhip="libamdhip64.so.6"
|
||||
else
|
||||
libamdhip="libamdhip64.so.5"
|
||||
fi
|
||||
|
||||
# Required ROCm libraries - ROCm 6.0
|
||||
ROCM_SO=(
|
||||
"${libamdhip}"
|
||||
"libhsa-runtime64.so.1"
|
||||
"libdrm.so.2"
|
||||
"libdrm_amdgpu.so.1"
|
||||
"libamdhip64.so"
|
||||
"libhsa-runtime64.so"
|
||||
"libdrm.so"
|
||||
"libdrm_amdgpu.so"
|
||||
"libamd_comgr.so"
|
||||
"librocprofiler-register.so"
|
||||
)
|
||||
if [[ $ROCM_INT -ge 60400 ]]; then
|
||||
ROCM_SO+=("libamd_comgr.so.3")
|
||||
else
|
||||
ROCM_SO+=("libamd_comgr.so.2")
|
||||
fi
|
||||
|
||||
if [[ $ROCM_INT -ge 60100 ]]; then
|
||||
ROCM_SO+=("librocprofiler-register.so.0")
|
||||
fi
|
||||
|
||||
for lib in "${ROCM_SO[@]}"
|
||||
do
|
||||
|
|
@ -94,10 +81,6 @@ do
|
|||
fi
|
||||
|
||||
cp $file_path $TRITON_ROCM_DIR/lib
|
||||
# When running locally, and not building a wheel, we need to satisfy shared objects requests that don't look for versions
|
||||
LINKNAME=$(echo $lib | sed -e 's/\.so.*/.so/g')
|
||||
ln -sf $lib $TRITON_ROCM_DIR/lib/$LINKNAME
|
||||
|
||||
done
|
||||
|
||||
# Copy Include Files
|
||||
|
|
|
|||
2
.github/scripts/amd/patch_triton_wheel.sh
vendored
2
.github/scripts/amd/patch_triton_wheel.sh
vendored
|
|
@ -19,7 +19,6 @@ replace_needed_sofiles() {
|
|||
find $1 -name '*.so*' -o -name 'ld.lld' | while read sofile; do
|
||||
origname=$2
|
||||
patchedname=$3
|
||||
if [[ "$origname" != "$patchedname" ]]; then
|
||||
set +e
|
||||
origname=$($PATCHELF_BIN --print-needed $sofile | grep "$origname.*")
|
||||
ERRCODE=$?
|
||||
|
|
@ -28,7 +27,6 @@ replace_needed_sofiles() {
|
|||
echo "patching $sofile entry $origname to $patchedname"
|
||||
$PATCHELF_BIN --replace-needed $origname $patchedname $sofile
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user