Skip to content

Commit

Permalink
release script: reduce python wheel size (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
laiwenzh committed Dec 17, 2024
1 parent d292f5c commit 1b2a6ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ jobs:
path: release/

- name: Release all packages
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v1
with:
files: release/*
9 changes: 2 additions & 7 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,11 @@ endif()

if (BUILD_PYTHON)
if (PYTHON_LIB_DIRS)
if(NOT ENABLE_NV_STATIC_LIB)
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} DESTINATION ${PYTHON_LIB_DIRS} FILES_MATCHING PATTERN "*.so" PATTERN "libnccl.*" EXCLUDE)
else()
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} DESTINATION ${PYTHON_LIB_DIRS} FILES_MATCHING PATTERN "*.so")
endif()
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} DESTINATION ${PYTHON_LIB_DIRS} FILES_MATCHING PATTERN "libflash-attn.so")

if (ENABLE_MULTINUMA)
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR} DESTINATION ${PYTHON_LIB_DIRS} USE_SOURCE_PERMISSIONS FILES_MATCHING PATTERN "*")
install(TARGETS _allspark_client DESTINATION ${PYTHON_LIB_DIRS})
endif()
install(TARGETS _allspark DESTINATION ${PYTHON_LIB_DIRS})
install(TARGETS _allspark DESTINATION ${PYTHON_LIB_DIRS})
endif()
endif()
6 changes: 4 additions & 2 deletions scripts/release/python_manylinux_build_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -e -x

ALL_VERSION="3.8 3.9 3.10 3.11"
BUILD_VERSION=${@:-$ALL_VERSION}
CUDA_VERSION=$(nvcc --version | grep -oP 'release \K[\d.]+')

echo " going to build python wheels with version: ${BUILD_VERSION}"

Expand All @@ -19,6 +18,8 @@ architecture=$(arch)
export PLAT=manylinux2014_x86_64
export AS_PLATFORM=cuda

CUDA_VERSION=$(nvcc --version | grep -oP 'release \K[\d.]+')

mkdir -p local_cuda_libs
ln -sf /usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib/stubs/libnvidia-ml.so local_cuda_libs/libnvidia-ml.so.1
ln -sf /usr/local/cuda-${CUDA_VERSION}/compat/libcuda.so.1 local_cuda_libs/libcuda.so.1
Expand All @@ -36,7 +37,8 @@ function repair_wheel {
echo "Skipping non-platform wheel $wheel"
else
# TODO: add lib path to build lib path
auditwheel repair "$wheel" --plat "$PLAT" -w ${REPO_ROOT}/python/wheelhouse/
auditwheel repair "$wheel" --plat "$PLAT" -w ${REPO_ROOT}/python/wheelhouse/ --exclude libcublas.so.12 --exclude libcublasLt.so.12 --exclude libcudart.so.12 --exclude libcusparse.so.12 --exclude libnvJitLink.so.12 --exclude libcuda.so.1 --exclude libnccl.so.2 --exclude libnvidia-ml.so.1 --exclude libcudart.so.12

fi
}

Expand Down

0 comments on commit 1b2a6ad

Please sign in to comment.