Build wheel #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build wheel | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to build and push' | |
required: true | |
type: string | |
env: | |
# Tells where to store caches. | |
CI_CACHE_DIR: ${{ github.workspace }}/../../ci_cache | |
jobs: | |
build_wheel: | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.9", "3.10", "3.11"] | |
cuda: ["11.8", "12.1"] | |
torch: ["2.1", "2.2", "2.3"] | |
runs-on: [self-hosted, linux, release] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build wheel | |
run: | | |
docker pull vectorchai/scalellm_manylinux:cuda${{ matrix.cuda }} | |
docker run --rm -t \ | |
-v "$CI_CACHE_DIR":/ci_cache \ | |
-v "$GITHUB_WORKSPACE":/ScaleLLM \ | |
-e PYTHON_VERSION=${{ matrix.python }} \ | |
-e CUDA_VERSION=${{ matrix.cuda }} \ | |
-e TORCH_VERSION=${{ matrix.torch }} \ | |
-e RENAME_WHL=true \ | |
-e VCPKG_DEFAULT_BINARY_CACHE=/ci_cache/.vcpkg/bincache \ | |
-e CCACHE_DIR=/ci_cache/.ccache \ | |
--user $(id -u):$(id -g) \ | |
vectorchai/scalellm_manylinux:cuda${{ matrix.cuda }} \ | |
bash /ScaleLLM/scripts/build_wheel.sh | |
timeout-minutes: 60 | |
- name: show wheel size | |
run: du -h python/dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }} | |
path: python/dist/* | |
release: | |
needs: build_wheel | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
path: python/dist | |
merge-multiple: true | |
pattern: wheel-* | |
- name: Show wheels | |
run: ls -lha python/dist | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: python/dist/scalellm-*.whl | |
tag_name: ${{ inputs.tag }} | |
draft: true | |
prerelease: true | |