|
| 1 | +# Adapted from https://github.com/punica-ai/punica/blob/591b59899f0a20760821785d06b331c8a2e5cb86/.github/workflows/release_wheel.yml |
| 2 | +name: Release |
| 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 | + # PYPI_TEST_TOKEN: |
| 18 | + # required: true |
| 19 | + |
| 20 | +env: |
| 21 | + TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX" |
| 22 | + |
| 23 | +jobs: |
| 24 | + build: |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + cuda: ["11.8", "12.1", "12.4"] |
| 29 | + torch: ["2.4", "2.5", "2.6"] |
| 30 | + exclude: # We use release_wheel_sglang.yml for faster release and verification. If everything is okay, then we trigger release_wheel.yml. This combination (cuda 12.4 or 11.8 + torch 2.5) is already handled in release_wheel_sglang.yml |
| 31 | + - cuda: "12.4" |
| 32 | + torch: "2.5" |
| 33 | + - cuda: "11.8" |
| 34 | + torch: "2.5" |
| 35 | + - cuda: "12.1" |
| 36 | + torch: "2.6" |
| 37 | + |
| 38 | + runs-on: [self-hosted] |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + with: |
| 42 | + submodules: true |
| 43 | + |
| 44 | + - name: Build wheel |
| 45 | + run: | |
| 46 | + chown -R $CI_UID:$CI_GID "$GITHUB_WORKSPACE" |
| 47 | + docker run --rm -t \ |
| 48 | + -v "$CI_RUNNER_CACHE_DIR":/ci-cache \ |
| 49 | + -v "$GITHUB_WORKSPACE":/app \ |
| 50 | + -e FLASHINFER_CI_CACHE=/ci-cache \ |
| 51 | + -e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \ |
| 52 | + -e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \ |
| 53 | + -e FLASHINFER_CI_PYTHON_VERSION=3.10 \ |
| 54 | + -e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \ |
| 55 | + -e MAX_JOBS=128 \ |
| 56 | + --user $CI_UID:$CI_GID \ |
| 57 | + pytorch/manylinux-builder:cuda${{ matrix.cuda }} \ |
| 58 | + bash /app/scripts/run-ci-build-wheel.sh |
| 59 | + timeout-minutes: 120 |
| 60 | + - run: du -h dist/* |
| 61 | + |
| 62 | + - uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }} |
| 65 | + path: dist/* |
| 66 | + |
| 67 | + release: |
| 68 | + needs: build |
| 69 | + runs-on: [self-hosted] |
| 70 | + steps: |
| 71 | + - uses: actions/download-artifact@v4 |
| 72 | + with: |
| 73 | + path: dist/ |
| 74 | + merge-multiple: true |
| 75 | + pattern: wheel-* |
| 76 | + |
| 77 | + - run: ls -lah dist/ |
| 78 | + |
| 79 | + - uses: softprops/action-gh-release@v1 |
| 80 | + with: |
| 81 | + tag_name: ${{ inputs.tag_name }} |
| 82 | + files: | |
| 83 | + dist/flashinfer*.whl |
| 84 | +
|
| 85 | + - uses: softprops/action-gh-release@v1 |
| 86 | + with: |
| 87 | + tag_name: ${{ inputs.tag_name }} |
| 88 | + files: | |
| 89 | + dist/flashinfer-*.tar.gz |
| 90 | +
|
| 91 | + - name: Clone wheel index |
| 92 | + run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl |
| 93 | + env: |
| 94 | + WHL_TOKEN: ${{ secrets.WHL_TOKEN }} |
| 95 | + |
| 96 | + - name: Update wheel index |
| 97 | + run: python3 scripts/update_whl_index.py |
| 98 | + |
| 99 | + - name: Push wheel index |
| 100 | + run: | |
| 101 | + cd flashinfer-whl |
| 102 | + git config --local user.name "github-actions[bot]" |
| 103 | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 104 | + git add -A |
| 105 | + git commit -m "update whl" |
| 106 | + git push |
| 107 | +
|
| 108 | + # - name: Upload sdist to pypi |
| 109 | + # run: | |
| 110 | + # pip install twine |
| 111 | + # python -m twine upload --repository testpypi --username=__token__ dist/*.tar.gz |
| 112 | + # env: |
| 113 | + # TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} |
0 commit comments