Aiter Release Package #53
This file contains hidden or 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: Aiter Release Package | |
| description: This workflow builds the Aiter Python package as .whl files for Python 3.10 and 3.12, and uploads them as artifacts. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| commit: | |
| description: 'Commit hash to build (leave empty to use current commit)' | |
| required: false | |
| build_py310: | |
| description: 'Build with Python 3.10' | |
| type: boolean | |
| default: true | |
| build_py312: | |
| description: 'Build with Python 3.12' | |
| type: boolean | |
| default: true | |
| docker_image_py310: | |
| description: 'Docker image for Python 3.10 build' | |
| required: true | |
| default: 'rocm/7.0-preview:rocm7.0_preview_ubuntu_22.04_vllm_0.10.1_instinct_beta' | |
| docker_image_py312: | |
| description: 'Docker image for Python 3.12 build' | |
| required: true | |
| default: 'rocm/vllm-dev:nightly' | |
| gpu_archs: | |
| description: 'GPU architectures (e.g. gfx942;gfx950)' | |
| required: false | |
| default: 'gfx942;gfx950' | |
| runner: | |
| description: 'Select build host' | |
| required: true | |
| default: 'aiter-k8s-build' | |
| type: choice | |
| options: | |
| - aiter-k8s-build | |
| - aiter-1gpu-runner | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_whl_package: | |
| runs-on: ${{ github.event.inputs.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python_version: "3.10" | |
| docker_image: ${{ github.event.inputs.docker_image_py310 }} | |
| build_enabled: ${{ github.event.inputs.build_py310 == 'true' || github.event.inputs.build_py310 == true }} | |
| - python_version: "3.12" | |
| docker_image: ${{ github.event.inputs.docker_image_py312 }} | |
| build_enabled: ${{ github.event.inputs.build_py312 == 'true' || github.event.inputs.build_py312 == true }} | |
| env: | |
| BUILD_DOCKER_IMAGE: ${{ matrix.docker_image }} | |
| PYTHON_VERSION: ${{ matrix.python_version }} | |
| GPU_ARCHS: ${{ github.event.inputs.gpu_archs }} | |
| steps: | |
| - name: Checkout aiter repo | |
| if: ${{ matrix.build_enabled }} | |
| uses: actions/checkout@v4 | |
| - name: Checkout to user-specified commit (if provided) | |
| if: ${{ matrix.build_enabled }} | |
| run: | | |
| set -ex | |
| if [ -n "${{ github.event.inputs.commit }}" ]; then | |
| echo "Checking out to commit: ${{ github.event.inputs.commit }}" | |
| git fetch --all | |
| git checkout ${{ github.event.inputs.commit }} | |
| git submodule update --init --recursive --depth 1 --jobs 4 | |
| else | |
| echo "No commit input provided, using current commit: $(git rev-parse HEAD)" | |
| fi | |
| - name: Sync submodules | |
| if: ${{ matrix.build_enabled }} | |
| run: | | |
| set -ex | |
| git submodule sync | |
| git submodule update --init --recursive --depth 1 --jobs 4 | |
| - name: Run the container | |
| if: ${{ matrix.build_enabled }} | |
| run: | | |
| set -ex | |
| echo "Starting container: aiter_build_${{ matrix.python_version }}" | |
| docker run -dt \ | |
| --shm-size=16G \ | |
| -v "${{ github.workspace }}:/workspace" \ | |
| -w /workspace \ | |
| --name aiter_build_${{ matrix.python_version }} \ | |
| ${{ env.BUILD_DOCKER_IMAGE }} | |
| - name: Install Dependencies | |
| if: ${{ matrix.build_enabled }} | |
| run: | | |
| set -e | |
| echo "Install Dependencies" | |
| docker exec \ | |
| -w /workspace \ | |
| aiter_build_${{ matrix.python_version }} \ | |
| pip install --timeout=60 --retries=10 -r requirements.txt | |
| - name: Install ninja | |
| if: ${{ matrix.build_enabled }} | |
| run: | | |
| set -e | |
| echo "Install ninja" | |
| docker exec \ | |
| -w /workspace \ | |
| aiter_build_${{ matrix.python_version }} \ | |
| pip install --timeout=60 --retries=10 ninja | |
| - name: Build Aiter | |
| if: ${{ matrix.build_enabled }} | |
| run: | | |
| set -e | |
| echo "Building aiter whl packages for Python ${{ matrix.python_version }}..." | |
| docker exec \ | |
| -w /workspace \ | |
| aiter_build_${{ matrix.python_version }} \ | |
| bash -c 'PREBUILD_KERNELS=1 GPU_ARCHS="${{ env.GPU_ARCHS }}" python3 setup.py bdist_wheel && ls dist/*.whl' | |
| - name: Upload whl file as artifact | |
| if: ${{ matrix.build_enabled }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: aiter-whl-packages-py${{ matrix.python_version }}-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: dist/*.whl | |
| - name: Cleanup container | |
| if: always() | |
| run: | | |
| docker rm -f aiter_build_${{ matrix.python_version }} || true |