From db93a31c10003445b53766d5cf5a6b88035e1ae1 Mon Sep 17 00:00:00 2001 From: zhyncs Date: Sun, 1 Dec 2024 18:08:37 +0800 Subject: [PATCH 1/2] upd --- .github/workflows/pr-test.yml | 25 +++++++++++++++++++++++++ python/sglang/check_env.py | 2 +- scripts/ci_install_dependency.sh | 5 ++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index c6f6a3a9685..f6238aa536a 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -12,6 +12,15 @@ on: - "python/sglang/**" - "test/**" workflow_dispatch: + inputs: + version: + description: "FlashInfer version" + required: true + type: choice + default: 'release' + options: + - 'release' + - 'nightly' concurrency: group: pr-test-${{ github.ref }} @@ -26,6 +35,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -46,6 +57,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -66,6 +79,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -92,6 +107,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -127,6 +144,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -156,6 +175,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -185,6 +206,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh @@ -207,6 +230,8 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies + env: + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} run: | bash scripts/ci_install_dependency.sh diff --git a/python/sglang/check_env.py b/python/sglang/check_env.py index 870ffe1c413..aafb8c101c2 100644 --- a/python/sglang/check_env.py +++ b/python/sglang/check_env.py @@ -9,7 +9,7 @@ import torch -# List of packages to check versions for +# List of packages to check versions PACKAGE_LIST = [ "sglang", "flashinfer", diff --git a/scripts/ci_install_dependency.sh b/scripts/ci_install_dependency.sh index e553fda1a31..a796a8a33a2 100755 --- a/scripts/ci_install_dependency.sh +++ b/scripts/ci_install_dependency.sh @@ -2,13 +2,16 @@ Install the dependency in CI. """ +# Use repo from environment variable, passed from GitHub Actions +FLASHINFER_REPO="${FLASHINFER_REPO:-https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/}" + ./killall_sglang.sh pip install --upgrade pip pip install -e "python[all]" --find-links https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/ # Force reinstall flashinfer -pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall +pip install flashinfer -i ${FLASHINFER_REPO} --force-reinstall pip install transformers==4.45.2 sentence_transformers accelerate peft From 291bd5444c5c6e53f77b2375da249af8ee7e02cc Mon Sep 17 00:00:00 2001 From: zhyncs Date: Sun, 1 Dec 2024 18:26:00 +0800 Subject: [PATCH 2/2] fix --- .github/workflows/pr-test.yml | 16 ++++++++-------- scripts/ci_install_dependency.sh | 9 ++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index f6238aa536a..0eb1ad96cb4 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -36,7 +36,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -58,7 +58,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -80,7 +80,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -108,7 +108,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -145,7 +145,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -176,7 +176,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -207,7 +207,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh @@ -231,7 +231,7 @@ jobs: - name: Install dependencies env: - FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/flashinfer/' || 'https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/' }} + FLASHINFER_REPO: ${{ inputs.version == 'nightly' && 'https://flashinfer.ai/whl/nightly/cu121/torch2.4/' || 'https://flashinfer.ai/whl/cu121/torch2.4/' }} run: | bash scripts/ci_install_dependency.sh diff --git a/scripts/ci_install_dependency.sh b/scripts/ci_install_dependency.sh index a796a8a33a2..787cc8b952c 100755 --- a/scripts/ci_install_dependency.sh +++ b/scripts/ci_install_dependency.sh @@ -1,11 +1,10 @@ -""" -Install the dependency in CI. -""" +# Install the dependency in CI. # Use repo from environment variable, passed from GitHub Actions -FLASHINFER_REPO="${FLASHINFER_REPO:-https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/}" +FLASHINFER_REPO="${FLASHINFER_REPO:-https://flashinfer.ai/whl/cu121/torch2.4}" -./killall_sglang.sh +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +bash "${SCRIPT_DIR}/killall_sglang.sh" pip install --upgrade pip pip install -e "python[all]" --find-links https://flashinfer.ai/whl/cu121/torch2.4/flashinfer/