Skip to content

cuda12.1-whl-release #188

cuda12.1-whl-release

cuda12.1-whl-release #188

name: cuda12.1-whl-release
on:
workflow_dispatch:
schedule:
- cron: '30 1 * * *'
permissions:
contents: write
jobs:
linux-build:
strategy:
matrix:
pyver: [py38, py39, py310, py311, py312]
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.pyver }}
PLAT_NAME: manylinux2014_x86_64
DOCKER_TAG: cuda12.1
OUTPUT_FOLDER: cuda12.1_dist
CUDA_VER: 12.1
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: false
docker-images: false
# All of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false
- name: Checkout repository
run: git clone --depth=1 https://github.com/InternLM/lmdeploy
- name: Build
run: |
echo ${PYTHON_VERSION}
echo ${PLAT_NAME}
echo ${DOCKER_TAG}
echo ${OUTPUT_FOLDER}
pushd lmdeploy
# remove -it
sed -i 's/docker run --rm -it/docker run --rm/g' builder/manywheel/build_wheel.sh
bash builder/manywheel/build_wheel.sh ${PYTHON_VERSION} ${PLAT_NAME} ${DOCKER_TAG} ${OUTPUT_FOLDER}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
path: lmdeploy/builder/manywheel/${{ env.OUTPUT_FOLDER }}/*
retention-days: 1
windows-build:
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: windows-latest
steps:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyver }}
- name: Install python packages
run: |
pip install pybind11<=2.13.1 wheel
- uses: actions/checkout@v4
- name: Setup CUDA Toolkit
id: cuda-toolkit
shell: pwsh
run: ./setup_cuda.ps1
env:
INPUT_CUDA_VERSION: '12.1.0'
- name: Build wheel
run: |
git clone --depth=1 https://github.com/InternLM/lmdeploy
pushd lmdeploy
mkdir build
cd build
pip install -U setuptools
..\builder\windows\generate.ps1
cmake --build . --config Release -- /m /v:q
if (-Not $?) {
echo "build failed"
exit 1
}
cmake --install . --config Release
cd ..
rm build -Force -Recurse
python setup.py bdist_wheel -d build/wheel
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
path: lmdeploy/build/wheel/*
retention-days: 1
publish:
runs-on: ubuntu-latest
environment: 'prod'
needs:
- linux-build
- windows-build
steps:
- name: Checkout repository
run: git clone --depth=1 https://github.com/InternLM/lmdeploy
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Add cuda version to package name
id: commit
run: |
pushd lmdeploy
ver=$(cat lmdeploy/version.py | grep '__version__ =' | cut -d\' -f2)
id=$(git rev-parse --short HEAD)
echo "id=$id" >> $GITHUB_OUTPUT
cuver=$ver+cu121+$id
popd
cd artifact
for file in *; do
mv "$file" "`echo $file | sed "s/$ver/$cuver/g"`";
done
- name: Display artifacts
run: ls artifact/ -lh
- name: Publish
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
tag_name: ${{ steps.commit.outputs.id }}
files: artifact/*