|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + tag_name: |
| 6 | + required: true |
| 7 | + type: string |
| 8 | + workflow_call: |
| 9 | + inputs: |
| 10 | + tag_name: |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + secrets: |
| 14 | + WHL_TOKEN: |
| 15 | + required: true |
| 16 | + |
| 17 | +env: |
| 18 | + TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX" |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + cuda: ["12.4"] |
| 26 | + torch: ["2.5"] |
| 27 | + |
| 28 | + runs-on: [self-hosted] |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + submodules: true |
| 33 | + |
| 34 | + - name: Build wheel |
| 35 | + run: | |
| 36 | + chown -R $CI_UID:$CI_GID "$GITHUB_WORKSPACE" |
| 37 | + docker run --rm -t \ |
| 38 | + -v "$CI_RUNNER_CACHE_DIR":/ci-cache \ |
| 39 | + -v "$GITHUB_WORKSPACE":/app \ |
| 40 | + -e FLASHINFER_CI_CACHE=/ci-cache \ |
| 41 | + -e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \ |
| 42 | + -e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \ |
| 43 | + -e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \ |
| 44 | + -e MAX_JOBS=128 \ |
| 45 | + --user $CI_UID:$CI_GID \ |
| 46 | + pytorch/manylinux-builder:cuda${{ matrix.cuda }} \ |
| 47 | + bash /app/scripts/run-ci-build-wheel.sh |
| 48 | + timeout-minutes: 120 |
| 49 | + - run: du -h dist/* |
| 50 | + |
| 51 | + - uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }} |
| 54 | + path: dist/* |
| 55 | + |
| 56 | + release: |
| 57 | + needs: build |
| 58 | + runs-on: [self-hosted] |
| 59 | + steps: |
| 60 | + - uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + path: dist/ |
| 63 | + merge-multiple: true |
| 64 | + pattern: wheel-* |
| 65 | + |
| 66 | + - run: ls -lah dist/ |
| 67 | + |
| 68 | + - uses: softprops/action-gh-release@v1 |
| 69 | + with: |
| 70 | + tag_name: ${{ inputs.tag_name }} |
| 71 | + files: | |
| 72 | + dist/flashinfer*.whl |
| 73 | +
|
| 74 | + - uses: softprops/action-gh-release@v1 |
| 75 | + with: |
| 76 | + tag_name: ${{ inputs.tag_name }} |
| 77 | + files: | |
| 78 | + dist/flashinfer-*.tar.gz |
| 79 | +
|
| 80 | + - name: Clone wheel index |
| 81 | + run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl |
| 82 | + env: |
| 83 | + WHL_TOKEN: ${{ secrets.WHL_TOKEN }} |
| 84 | + |
| 85 | + - name: Update wheel index |
| 86 | + run: python3 scripts/update_whl_index.py |
| 87 | + |
| 88 | + - name: Push wheel index |
| 89 | + run: | |
| 90 | + cd flashinfer-whl |
| 91 | + git config --local user.name "github-actions[bot]" |
| 92 | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 93 | + git add -A |
| 94 | + git commit -m "update whl" |
| 95 | + git push |
0 commit comments