This repository was archived by the owner on Jun 8, 2025. It is now read-only.
Nightly-Release #277
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
python: ["3.10"] | |
cuda: ["12.4", "12.6"] | |
torch: ["2.5", "2.6"] | |
exclude: | |
- cuda: "12.6" | |
torch: "2.5" | |
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: Set torch and cuda version value | |
id: set_torch_and_cuda_version | |
run: | | |
IFS='.' read -r major minor <<< "${{ matrix.torch }}" | |
version_value=$((major * 100 + minor)) | |
echo "TORCH_VERSION=$version_value" >> $GITHUB_OUTPUT | |
IFS='.' read -r major minor <<< "${{ matrix.cuda }}" | |
version_value=$((major * 100 + minor)) | |
echo "CUDA_VERSION=$version_value" >> $GITHUB_OUTPUT | |
- name: Build wheel | |
env: | |
TORCH_VERSION: ${{ steps.set_torch_and_cuda_version.outputs.TORCH_VERSION }} | |
CUDA_VERSION: ${{ steps.set_torch_and_cuda_version.outputs.CUDA_VERSION }} | |
BUILDER_IMAGE: ${{ ((steps.set_torch_and_cuda_version.outputs.TORCH_VERSION == 206 && steps.set_torch_and_cuda_version.outputs.CUDA_VERSION >= 1206) || steps.set_torch_and_cuda_version.outputs.TORCH_VERSION > 206) && 'pytorch/manylinux2_28-builder:cuda' || 'pytorch/manylinux-builder:cuda' }}${{ matrix.cuda }} | |
run: | | |
echo "TORCH_VERSION: $TORCH_VERSION" | |
echo "CUDA_VERSION: $CUDA_VERSION" | |
echo "BUILDER_IMAGE: $BUILDER_IMAGE" | |
pushd flashinfer | |
docker run --rm -t \ | |
-v "$(pwd)":/app \ | |
-e FLASHINFER_CI_PYTHON_VERSION=${{ matrix.python }} \ | |
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \ | |
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \ | |
-e FLASHINFER_CI_CACHE=/opt/dlami/nvme/flashinfer/github \ | |
-e FLASHINFER_GIT_SHA="$(git rev-parse HEAD | cut -c1-7)" \ | |
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \ | |
-e MAX_JOBS=192 \ | |
--user $(id -u):$(id -g) \ | |
$BUILDER_IMAGE \ | |
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 }}-python${{ matrix.python }} | |
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 |