Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocm6.3 lightweight wheel capability #59

Merged
merged 4 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ fi
if [[ -z "$build_number" ]]; then
build_number=1
fi
if [[ "$BUILD_LIGHTWEIGHT" == "1" ]]; then
build_version="${build_version}.lw"
fi

echo "Final build_version: $build_version"

export PYTORCH_BUILD_VERSION=$build_version
export PYTORCH_BUILD_NUMBER=$build_number

Expand Down
78 changes: 45 additions & 33 deletions manywheel/build_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ OTHER_FILES=$(ls $HIPBLASLT_LIB_SRC | grep -v gfx)
HIPBLASLT_LIB_FILES=($ARCH_SPECIFIC_FILES $OTHER_FILES)

# ROCm library files
# Overwrite ROCM_SO_FILES to contain only libmagma.so if BUILD_LIGHTWEIGHT is enabled
if [[ "$BUILD_LIGHTWEIGHT" == "1" ]]; then
#TODO: add libaotriton_v2.so when using preinstalled aotriton
ROCM_SO_FILES=(
"libmagma.so"
)
fi
ROCM_SO_PATHS=()
for lib in "${ROCM_SO_FILES[@]}"
do
Expand All @@ -253,49 +260,54 @@ done

DEPS_LIST=(
${ROCM_SO_PATHS[*]}
${OS_SO_PATHS[*]}
)

if [[ "$BUILD_LIGHTWEIGHT" != "1" ]]; then
DEPS_LIST+=(${OS_SO_PATHS[*]})
fi
DEPS_SONAME=(
${ROCM_SO_FILES[*]}
${OS_SO_FILES[*]}
)

DEPS_AUX_SRCLIST=(
"${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_SRC/}"
"${HIPBLASLT_LIB_FILES[@]/#/$HIPBLASLT_LIB_SRC/}"
"/opt/amdgpu/share/libdrm/amdgpu.ids"
)

DEPS_AUX_DSTLIST=(
"${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_DST/}"
"${HIPBLASLT_LIB_FILES[@]/#/$HIPBLASLT_LIB_DST/}"
"share/libdrm/amdgpu.ids"
)
if [[ "$BUILD_LIGHTWEIGHT" != "1" ]]; then
DEPS_SONAME+=(${OS_SO_FILES[*]})
fi

if [[ $ROCM_INT -ge 50500 ]]; then
# MIOpen library files
MIOPEN_SHARE_SRC=$ROCM_HOME/share/miopen/db
MIOPEN_SHARE_DST=share/miopen/db
MIOPEN_SHARE_FILES=($(ls $MIOPEN_SHARE_SRC | grep -E $ARCH))
DEPS_AUX_SRCLIST=()
if [[ "$BUILD_LIGHTWEIGHT" != "1" ]]; then
DEPS_AUX_SRCLIST+=("${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_SRC/}")
DEPS_AUX_SRCLIST+=("${HIPBLASLT_LIB_FILES[@]/#/$HIPBLASLT_LIB_SRC/}")
DEPS_AUX_SRCLIST+=("/opt/amdgpu/share/libdrm/amdgpu.ids")
fi

DEPS_AUX_SRCLIST+=(${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_SRC/})
DEPS_AUX_DSTLIST+=(${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_DST/})
DEPS_AUX_DSTLIST=()
if [[ "$BUILD_LIGHTWEIGHT" != "1" ]]; then
DEPS_AUX_DSTLIST+=("${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_DST/}")
DEPS_AUX_DSTLIST+=("${HIPBLASLT_LIB_FILES[@]/#/$HIPBLASLT_LIB_DST/}")
DEPS_AUX_DSTLIST+=("share/libdrm/amdgpu.ids")
fi
if [[ "$BUILD_LIGHTWEIGHT" != "1" ]]; then
if [[ $ROCM_INT -ge 50500 ]]; then
# MIOpen library files
MIOPEN_SHARE_SRC=$ROCM_HOME/share/miopen/db
MIOPEN_SHARE_DST=share/miopen/db
MIOPEN_SHARE_FILES=($(ls $MIOPEN_SHARE_SRC | grep -E $ARCH))

if [[ $ROCM_INT -ge 50600 ]]; then
# RCCL library files
if [[ $ROCM_INT -ge 50700 ]]; then
RCCL_SHARE_SRC=$ROCM_HOME/share/rccl/msccl-algorithms
RCCL_SHARE_DST=share/rccl/msccl-algorithms
else
RCCL_SHARE_SRC=$ROCM_HOME/lib/msccl-algorithms
RCCL_SHARE_DST=lib/msccl-algorithms
DEPS_AUX_SRCLIST+=(${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_SRC/})
DEPS_AUX_DSTLIST+=(${MIOPEN_SHARE_FILES[@]/#/$MIOPEN_SHARE_DST/})
fi
RCCL_SHARE_FILES=($(ls $RCCL_SHARE_SRC))

DEPS_AUX_SRCLIST+=(${RCCL_SHARE_FILES[@]/#/$RCCL_SHARE_SRC/})
DEPS_AUX_DSTLIST+=(${RCCL_SHARE_FILES[@]/#/$RCCL_SHARE_DST/})
if [[ $ROCM_INT -ge 50600 ]]; then
# RCCL library files
if [[ $ROCM_INT -ge 50700 ]]; then
RCCL_SHARE_SRC=$ROCM_HOME/share/rccl/msccl-algorithms
RCCL_SHARE_DST=share/rccl/msccl-algorithms
else
RCCL_SHARE_SRC=$ROCM_HOME/lib/msccl-algorithms
RCCL_SHARE_DST=lib/msccl-algorithms
fi
RCCL_SHARE_FILES=($(ls $RCCL_SHARE_SRC))

DEPS_AUX_SRCLIST+=(${RCCL_SHARE_FILES[@]/#/$RCCL_SHARE_SRC/})
DEPS_AUX_DSTLIST+=(${RCCL_SHARE_FILES[@]/#/$RCCL_SHARE_DST/})
fi

# Add triton install dependency
Expand Down
Loading