|
| 1 | +name: Nightly-Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + repo: |
| 7 | + description: "repo" |
| 8 | + default: "flashinfer-ai/flashinfer" |
| 9 | + branch: |
| 10 | + description: "branch" |
| 11 | + default: "main" |
| 12 | + |
| 13 | +env: |
| 14 | + TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX" |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + outputs: |
| 19 | + version: ${{ steps.get_version.outputs.version }} |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + python: ["3.10"] |
| 24 | + cuda: ["12.4"] |
| 25 | + torch: ["2.4"] |
| 26 | + runs-on: [self-hosted] |
| 27 | + steps: |
| 28 | + - run: | |
| 29 | + rm -rf flashinfer |
| 30 | + git clone -b ${{ inputs.branch }} --recurse-submodules --depth=1 https://github.com/${{ inputs.repo }} |
| 31 | + pushd flashinfer |
| 32 | + sed -i 's/+cu/\.cu/g' scripts/run-ci-build-wheel.sh |
| 33 | + sed -i 's|/ci-cache|/opt/dlami/nvme/flashinfer/github|g' scripts/run-ci-build-wheel.sh |
| 34 | + sed -i '/mkdir -p "\$CONDA_pkgs_dirs" "\$XDG_CACHE_HOME"/d' scripts/run-ci-build-wheel.sh |
| 35 | + version="$(cat version.txt)"+"$(git rev-parse HEAD | cut -c1-7)" |
| 36 | + echo "VERSION=$version" >> $GITHUB_ENV |
| 37 | + echo "version=$version" >> $GITHUB_OUTPUT |
| 38 | + id: get_version |
| 39 | + - name: Build wheel |
| 40 | + run: | |
| 41 | + pushd flashinfer |
| 42 | + docker run --rm -t \ |
| 43 | + -v "$(pwd)":/app \ |
| 44 | + -e FLASHINFER_CI_PYTHON_VERSION=${{ matrix.python }} \ |
| 45 | + -e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \ |
| 46 | + -e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \ |
| 47 | + -e FLASHINFER_BUILD_VERSION=${{ env.VERSION }} \ |
| 48 | + -e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \ |
| 49 | + -e MAX_JOBS=192 \ |
| 50 | + --user $(id -u):$(id -g) \ |
| 51 | + pytorch/manylinux-builder:cuda${{ matrix.cuda }} \ |
| 52 | + bash /app/scripts/run-ci-build-wheel.sh |
| 53 | + popd |
| 54 | + timeout-minutes: 30 |
| 55 | + - run: du -h flashinfer/python/dist/* |
| 56 | + - uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }} |
| 59 | + path: flashinfer/python/dist/* |
| 60 | + |
| 61 | + release: |
| 62 | + needs: build |
| 63 | + runs-on: [self-hosted] |
| 64 | + steps: |
| 65 | + - uses: actions/download-artifact@v4 |
| 66 | + with: |
| 67 | + path: python/dist/ |
| 68 | + merge-multiple: true |
| 69 | + pattern: wheel-* |
| 70 | + - run: ls -lah python/dist/ |
| 71 | + - uses: softprops/action-gh-release@v1 |
| 72 | + with: |
| 73 | + tag_name: ${{ needs.build.outputs.version }} |
| 74 | + files: python/dist/flashinfer*.whl |
0 commit comments