Skip to content

Nightly-Release

Nightly-Release #52

Workflow file for this run

name: Nightly-Release
on:
workflow_dispatch:
inputs:
repo:
description: "repo"
default: "flashinfer-ai/flashinfer"
branch:
description: "branch"
default: "main"
schedule:
- cron: '0 2 * * *'
env:
TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX"
jobs:
build:
outputs:
version: ${{ steps.get_version.outputs.version }}
strategy:
fail-fast: false
matrix:
cuda: ["12.1", "12.4"]
torch: ["2.4"]
runs-on: [self-hosted]
steps:
- name: Set default values
id: set_defaults
run: |
echo "[INFO] Event name is '${{ github.event_name }}'"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "REPO=${{ inputs.repo }}" >> $GITHUB_ENV
echo "BRANCH=${{ inputs.branch }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "REPO=flashinfer-ai/flashinfer" >> $GITHUB_ENV
echo "BRANCH=main" >> $GITHUB_ENV
else
echo "[ERROR] Unsupported event '${{ github.event_name }}'." >&2
exit 1
fi
- run: |
rm -rf flashinfer
git clone -b ${{ env.BRANCH }} --recurse-submodules --depth=1 https://github.com/${{ env.REPO }}
pushd flashinfer
sed -i 's|/ci-cache|/opt/dlami/nvme/flashinfer/github|g' scripts/run-ci-build-wheel.sh
sed -i '/mkdir -p "\$CONDA_pkgs_dirs" "\$XDG_CACHE_HOME"/d' scripts/run-ci-build-wheel.sh
version="$(cat version.txt)"+"$(git rev-parse HEAD | cut -c1-7)".cu${{ matrix.cuda }}torch${{ matrix.torch }}
echo "VERSION=$version" >> $GITHUB_ENV
echo "version=$version" >> $GITHUB_OUTPUT
id: get_version
- name: Build wheel
run: |
pushd flashinfer
docker run --rm -t \
-v "$(pwd)":/app \
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \
-e FLASHINFER_BUILD_VERSION=${{ env.VERSION }} \
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
-e MAX_JOBS=192 \
--user $(id -u):$(id -g) \
pytorch/manylinux-builder:cuda${{ matrix.cuda }} \
bash /app/scripts/run-ci-build-wheel.sh
popd
timeout-minutes: 30
- run: du -h flashinfer/dist/*
- uses: actions/upload-artifact@v4
with:
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}
path: flashinfer/dist/*
release:
needs: build
runs-on: [self-hosted]
steps:
- uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true
pattern: wheel-*
- run: ls -lah dist/
- run: |
version="${{ needs.build.outputs.version }}"
tag_version=$(echo $version | sed 's/\.cu[0-9.]*torch[0-9.]*$//')
echo "TAG_VERSION=$tag_version" >> $GITHUB_ENV
find dist -type f ! -name "*${tag_version}*" -delete
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_VERSION }}
files: dist/flashinfer*.whl