CI - Build CUDA Wheels #27
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: CI - Build CUDA Wheels | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-wheels: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [amd64, arm64] | |
| variant: [cu12, cu130] | |
| include: | |
| - arch: amd64 | |
| os: ubuntu-24.04 | |
| - arch: arm64 | |
| os: ubuntu-24.04-arm | |
| # cu12 uses Dockerfile defaults (CUDA 12.9.1 / cu129 / no local version). | |
| # cu130 overrides only what differs: | |
| - variant: cu130 | |
| cuda_version: "13.0.0" | |
| torch_cuda_index: "cu130" | |
| wheel_local_version: "+cu130" | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| - name: Build wheel in Docker | |
| run: | | |
| cd kv_connectors/llmd_fs_backend | |
| if [[ "${{ matrix.arch }}" == "arm64" ]]; then | |
| PLATFORM="linux/arm64" | |
| else | |
| PLATFORM="linux/amd64" | |
| fi | |
| BUILD_ARGS=( | |
| --build-arg torch_cuda_arch_list='8.7 8.9 9.0 10.0+PTX' | |
| --build-arg max_jobs=4 | |
| ) | |
| [[ -n "${{ matrix.cuda_version }}" ]] && BUILD_ARGS+=(--build-arg "CUDA_VERSION=${{ matrix.cuda_version }}") | |
| [[ -n "${{ matrix.torch_cuda_index }}" ]] && BUILD_ARGS+=(--build-arg "TORCH_CUDA_INDEX=${{ matrix.torch_cuda_index }}") | |
| [[ -n "${{ matrix.wheel_local_version }}" ]] && BUILD_ARGS+=(--build-arg "WHEEL_LOCAL_VERSION=${{ matrix.wheel_local_version }}") | |
| DOCKER_BUILDKIT=1 docker build \ | |
| --platform=${PLATFORM} \ | |
| "${BUILD_ARGS[@]}" \ | |
| --tag llmd-fs-backend:build-${{ matrix.arch }}-${{ matrix.variant }} \ | |
| --target build \ | |
| --progress plain \ | |
| -f Dockerfile.wheel . | |
| mkdir -p wheel-release | |
| docker run --rm -v "$(pwd)/wheel-release:/artifacts_host" llmd-fs-backend:build-${{ matrix.arch }}-${{ matrix.variant }} \ | |
| bash -lc 'cp -v dist/*.whl /artifacts_host/ && chmod -R a+rw /artifacts_host' | |
| ls -lh wheel-release/ | |
| # ----------------------- | |
| # Upload artifacts | |
| # ----------------------- | |
| - name: Upload wheels as workflow artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cuda-wheels-${{ matrix.arch }}-${{ matrix.variant }} | |
| path: kv_connectors/llmd_fs_backend/wheel-release/*.whl | |
| attach-assets: | |
| needs: build-wheels | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release_wheels | |
| - name: Attach wheels to the tag release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| files: release_wheels/**/*.whl | |
| fail_on_unmatched_files: true | |
| draft: true | |
| prerelease: true |