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

Changes for lightweight wheels #56

Merged
merged 52 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d23e977
Update build_rocm.sh
ethanwee1 Sep 6, 2024
471814f
Update build_rocm.sh
ethanwee1 Sep 6, 2024
cb1aadd
Update build_rocm.sh
ethanwee1 Sep 6, 2024
55e035a
Update build_rocm.sh
ethanwee1 Sep 6, 2024
b3a2b7a
Update build_rocm.sh
ethanwee1 Sep 6, 2024
5744207
Update build_rocm.sh
ethanwee1 Sep 6, 2024
c3bbc02
Update build_rocm.sh
ethanwee1 Sep 6, 2024
bb047a6
Update build_rocm.sh
ethanwee1 Sep 6, 2024
3e05bd6
Update build_rocm.sh
ethanwee1 Sep 9, 2024
a87155a
Update build_rocm.sh
ethanwee1 Sep 9, 2024
82b05ce
Update build_wheel.sh
ethanwee1 Sep 9, 2024
a78d362
Update build_rocm.sh
ethanwee1 Sep 9, 2024
a26210c
Update build_rocm.sh
ethanwee1 Sep 9, 2024
cd2a2ce
Update build_wheel.sh
ethanwee1 Sep 9, 2024
dbbec25
Update build_rocm.sh
ethanwee1 Sep 9, 2024
72e1d41
Update build_wheel.sh
ethanwee1 Sep 9, 2024
41cb6f0
Update build_wheel.sh
ethanwee1 Sep 9, 2024
75379a1
Update build_wheel.sh to work on OVERRIDE_PACKAGE_VERSION
ethanwee1 Sep 9, 2024
541e5fb
Update build_wheel.sh
ethanwee1 Sep 10, 2024
6e4bbbd
Update the whl name with lw
pruthvistony Sep 10, 2024
eadfdb0
Update build_common.sh to use BUILD_LIGHTWEIGHT flag
ethanwee1 Sep 10, 2024
7a47219
Update build_rocm.sh to ensure that only libmagma.so is included with…
ethanwee1 Sep 10, 2024
fd75cd1
Update build_common.sh to correct how basename command was applied to…
ethanwee1 Sep 10, 2024
99ed1d3
Update build_common.sh
ethanwee1 Sep 10, 2024
723dcdf
Update build_common.sh
ethanwee1 Sep 10, 2024
f51e322
Don't be quiet
jithunnair-amd Sep 10, 2024
434dd9e
Update build_common.sh
ethanwee1 Sep 10, 2024
1a0d146
Update build_common.sh
ethanwee1 Sep 10, 2024
111f09c
Update build_common.sh
ethanwee1 Sep 10, 2024
d26057b
Update build_common.sh
ethanwee1 Sep 10, 2024
fcc0f09
Update build_rocm.sh
ethanwee1 Sep 10, 2024
0cd92e3
Update build_rocm.sh
ethanwee1 Sep 10, 2024
146e2be
Update build_rocm.sh
ethanwee1 Sep 10, 2024
641d81b
Update build_common.sh
ethanwee1 Sep 11, 2024
b678299
Update build_common.sh
ethanwee1 Sep 11, 2024
98a389b
Update build_common.sh
ethanwee1 Sep 11, 2024
4ed2ed9
Update build_wheel.sh
ethanwee1 Sep 11, 2024
582cb43
Update build_common.sh
ethanwee1 Sep 12, 2024
37c7ae0
remove unwanted changes
ethanwee1 Sep 12, 2024
5249b44
Update build_rocm.sh
ethanwee1 Sep 12, 2024
eae12c8
Update build_wheel.sh
ethanwee1 Sep 12, 2024
8cf3655
Update build_rocm.sh
ethanwee1 Sep 12, 2024
c042664
Update build_common.sh
ethanwee1 Sep 12, 2024
546d447
Update build_wheel.sh
ethanwee1 Sep 13, 2024
86a3ebe
Update build_wheel.sh
ethanwee1 Sep 13, 2024
3c02b4e
Update build_wheel.sh
ethanwee1 Sep 13, 2024
fcbc977
Update build_common.sh
ethanwee1 Sep 13, 2024
311fac2
Update build_common.sh
ethanwee1 Sep 13, 2024
d367881
Update build_rocm.sh
ethanwee1 Sep 13, 2024
36ace57
Update quoting
jithunnair-amd Sep 13, 2024
a482672
Add back "/" into src list
ethanwee1 Sep 13, 2024
b5095a3
Add TODO comment for libaotriton_v2.so
jithunnair-amd Sep 17, 2024
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
20 changes: 14 additions & 6 deletions manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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 Expand Up @@ -117,7 +123,7 @@ if [[ -z "$PYTORCH_ROOT" ]]; then
fi
pushd "$PYTORCH_ROOT"
python setup.py clean
retry pip install -qr requirements.txt
retry pip install -r requirements.txt
case ${DESIRED_PYTHON} in
cp36-cp36m)
retry pip install -q numpy==1.11
Expand Down Expand Up @@ -330,11 +336,13 @@ for pkg in /$WHEELHOUSE_DIR/torch*linux*.whl /$LIBTORCH_HOUSE_DIR/libtorch*.zip;
# copy over needed dependent .so files over and tag them with their hash
patched=()
for filepath in "${DEPS_LIST[@]}"; do
filename=$(basename $filepath)
destpath=$PREFIX/lib/$filename
if [[ "$filepath" != "$destpath" ]]; then
cp $filepath $destpath
fi
filename=$(basename "$filepath") # Extract the file name
destpath=$PREFIX/lib/$filename # Set the destination path

if [[ -f "$filepath" ]]; then # Check if the file exists
cp "$filepath" "$destpath" # Copy the file to the destination
echo "Copied $filepath to $destpath"
fi

# ROCm workaround for roctracer dlopens
if [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
Expand Down
42 changes: 27 additions & 15 deletions manywheel/build_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,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
ROCM_SO_FILES=(
"libmagma.so"
)
fi

ROCM_SO_PATHS=()
for lib in "${ROCM_SO_FILES[@]}"
do
Expand All @@ -230,26 +237,31 @@ do
done

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

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

DEPS_AUX_SRCLIST=(
"${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_SRC/}"
"${HIPBLASLT_LIB_FILES[@]/#/$HIPBLASLT_LIB_SRC/}"
"/opt/amdgpu/share/libdrm/amdgpu.ids"
)
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_DSTLIST=(
"${ROCBLAS_LIB_FILES[@]/#/$ROCBLAS_LIB_DST/}"
"${HIPBLASLT_LIB_FILES[@]/#/$HIPBLASLT_LIB_DST/}"
"share/libdrm/amdgpu.ids"
)
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 [[ $ROCM_INT -ge 50500 ]]; then
jithunnair-amd marked this conversation as resolved.
Show resolved Hide resolved
# MIOpen library files
Expand Down
7 changes: 7 additions & 0 deletions wheel/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ else
build_number_prefix=".post$build_number"
fi
fi
# Append .lw if BUILD_LIGHTWEIGHT is enabled
ethanwee1 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading