|
| 1 | +name: Release aarch64 wheel |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag_name: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + workflow_call: |
| 10 | + inputs: |
| 11 | + tag_name: |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + secrets: |
| 15 | + WHL_TOKEN: |
| 16 | + required: true |
| 17 | + |
| 18 | +env: |
| 19 | + TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX" |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + include: |
| 27 | + - cuda: "12.6" |
| 28 | + torch: "2.5" |
| 29 | + python: "3.10" |
| 30 | + image: "nvcr.io/nvidia/pytorch:24.10-py3" |
| 31 | + - cuda: "12.8" |
| 32 | + torch: "2.6" |
| 33 | + python: "3.12" |
| 34 | + image: "nvcr.io/nvidia/pytorch:25.01-py3" |
| 35 | + - cuda: "12.8" |
| 36 | + torch: "2.7" |
| 37 | + python: "3.12" |
| 38 | + image: "nvcr.io/nvidia/pytorch:25.03-py3" |
| 39 | + |
| 40 | + runs-on: [self-hosted, Linux, ARM64] |
| 41 | + |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + submodules: true |
| 46 | + |
| 47 | + - name: Set version values |
| 48 | + id: set_versions |
| 49 | + run: | |
| 50 | + IFS='.' read -r major minor <<< "${{ matrix.torch }}" |
| 51 | + echo "TORCH_VERSION=$((major * 100 + minor))" >> $GITHUB_OUTPUT |
| 52 | + IFS='.' read -r major minor <<< "${{ matrix.cuda }}" |
| 53 | + echo "CUDA_VERSION=$((major * 100 + minor))" >> $GITHUB_OUTPUT |
| 54 | +
|
| 55 | + - name: Build wheel |
| 56 | + env: |
| 57 | + TORCH_VERSION: ${{ steps.set_versions.outputs.TORCH_VERSION }} |
| 58 | + CUDA_VERSION: ${{ steps.set_versions.outputs.CUDA_VERSION }} |
| 59 | + PYTHON_VERSION: ${{ matrix.python }} |
| 60 | + BUILDER_IMAGE: ${{ matrix.image }} |
| 61 | + run: | |
| 62 | + echo "TORCH_VERSION: $TORCH_VERSION" |
| 63 | + echo "CUDA_VERSION: $CUDA_VERSION" |
| 64 | + echo "PYTHON_VERSION: $PYTHON_VERSION" |
| 65 | + echo "BUILDER_IMAGE: $BUILDER_IMAGE" |
| 66 | + chown -R $(id -u):$(id -g) "$GITHUB_WORKSPACE" |
| 67 | + mkdir -p "$GITHUB_WORKSPACE/ci-cache" |
| 68 | + chown -R $(id -u):$(id -g) "$GITHUB_WORKSPACE/ci-cache" |
| 69 | + docker run --rm -t \ |
| 70 | + -v "$GITHUB_WORKSPACE":/app \ |
| 71 | + -v "$GITHUB_WORKSPACE/ci-cache":/ci-cache \ |
| 72 | + -e FLASHINFER_CI_CACHE=/ci-cache \ |
| 73 | + -e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \ |
| 74 | + -e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \ |
| 75 | + -e FLASHINFER_CI_PYTHON_VERSION=${{ matrix.python }} \ |
| 76 | + -e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \ |
| 77 | + -e MAX_JOBS=128 \ |
| 78 | + --user $(id -u):$(id -g) \ |
| 79 | + $BUILDER_IMAGE \ |
| 80 | + bash /app/scripts/run-ci-build-wheel.sh |
| 81 | + timeout-minutes: 120 |
| 82 | + |
| 83 | + - run: du -h dist/* |
| 84 | + |
| 85 | + - uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-aarch64 |
| 88 | + path: dist/* |
| 89 | + |
| 90 | + release: |
| 91 | + needs: build |
| 92 | + runs-on: [self-hosted, Linux, ARM64] |
| 93 | + steps: |
| 94 | + - uses: actions/download-artifact@v4 |
| 95 | + with: |
| 96 | + path: dist/ |
| 97 | + merge-multiple: true |
| 98 | + pattern: wheel-* |
| 99 | + |
| 100 | + - run: ls -lah dist/ |
| 101 | + |
| 102 | + - uses: softprops/action-gh-release@v1 |
| 103 | + with: |
| 104 | + tag_name: ${{ inputs.tag_name }} |
| 105 | + files: | |
| 106 | + dist/flashinfer*.whl |
| 107 | +
|
| 108 | + - uses: softprops/action-gh-release@v1 |
| 109 | + with: |
| 110 | + tag_name: ${{ inputs.tag_name }} |
| 111 | + files: | |
| 112 | + dist/flashinfer-*.tar.gz |
| 113 | +
|
| 114 | + - name: Clone wheel index |
| 115 | + run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl |
| 116 | + env: |
| 117 | + WHL_TOKEN: ${{ secrets.WHL_TOKEN }} |
| 118 | + |
| 119 | + - name: Update wheel index |
| 120 | + run: python3 scripts/update_whl_index.py |
| 121 | + |
| 122 | + - name: Push wheel index |
| 123 | + run: | |
| 124 | + cd flashinfer-whl |
| 125 | + git config --local user.name "github-actions[bot]" |
| 126 | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 127 | + git add -A |
| 128 | + git commit -m "update whl" |
| 129 | + git push |
0 commit comments