diff --git a/.github/workflows/cancel-all-pending-pr-test-runs.yml b/.github/workflows/cancel-all-pending-pr-test-runs.yml new file mode 100644 index 000000000..9da785458 --- /dev/null +++ b/.github/workflows/cancel-all-pending-pr-test-runs.yml @@ -0,0 +1,32 @@ +name: Cancel All Pending PR Test Runs + +on: + workflow_dispatch: # Manual trigger + +jobs: + cancel-pending: + runs-on: ubuntu-latest + steps: + - name: Install GitHub CLI + run: apt-get install -y gh jq + + - name: Authenticate GitHub CLI + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh auth login --with-token <<< "$GH_TOKEN" + + - name: Cancel all pending/waiting pr-test.yml runs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + run: | + # Get all pending or waiting runs of pr-test.yml across all branches + gh run list \ + --workflow pr-test.yml \ + --json databaseId,status,conclusion \ + --limit 1000 \ + | jq -r '.[] | select(.status=="queued" or .status=="in_progress") | .databaseId' \ + | while read run_id; do + echo "Cancelling run ID: $run_id" + gh run cancel "$run_id" + done diff --git a/.github/workflows/cancel-pr-workflow.yml b/.github/workflows/cancel-pr-workflow-on-merge.yml similarity index 100% rename from .github/workflows/cancel-pr-workflow.yml rename to .github/workflows/cancel-pr-workflow-on-merge.yml diff --git a/.github/workflows/pr-test-amd.yml b/.github/workflows/pr-test-amd.yml index 51ea12ea5..aba17ccb9 100644 --- a/.github/workflows/pr-test-amd.yml +++ b/.github/workflows/pr-test-amd.yml @@ -323,7 +323,7 @@ jobs: docker exec -w /sglang-checkout/sgl-kernel/tests ci_sglang python3 -m pytest test_moe_topk_softmax.py docker exec -w /sglang-checkout/sgl-kernel/tests/speculative ci_sglang python3 -m pytest test_eagle_utils.py - finish: + pr-test-amd-finish: if: always() needs: [ accuracy-test-1-gpu-amd, mla-test-1-gpu-amd, bench-test-2-gpu-amd, diff --git a/.github/workflows/pr-test-npu.yml b/.github/workflows/pr-test-npu.yml index 7cf45263c..777d75435 100644 --- a/.github/workflows/pr-test-npu.yml +++ b/.github/workflows/pr-test-npu.yml @@ -109,7 +109,7 @@ jobs: cd test/srt python3 run_suite.py --suite per-commit-4-ascend-npu --timeout-per-file 3600 - finish: + pr-test-npu-finish: if: always() needs: - per-commit-1-ascend-npu diff --git a/.github/workflows/pr-test-xeon.yml b/.github/workflows/pr-test-xeon.yml index b22a291b6..8af526850 100644 --- a/.github/workflows/pr-test-xeon.yml +++ b/.github/workflows/pr-test-xeon.yml @@ -1,17 +1,32 @@ name: PR Test (Xeon) + on: + push: + branches: [ main ] + paths: + - "python/**" + - "scripts/**" + - "test/**" + - "sgl-kernel/**" + - ".github/workflows/pr-test-xeon.yml" pull_request: - branches: - - main + branches: [ main ] + paths: + - "python/**" + - "scripts/**" + - "test/**" + - "sgl-kernel/**" + - ".github/workflows/pr-test-xeon.yml" workflow_dispatch: concurrency: - group: pr-test-xeon + group: pr-test-xeon-${{ github.ref }} cancel-in-progress: false jobs: build-test: - if: github.event_name == 'pull_request' + if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && + github.event.pull_request.draft == false runs-on: sglang-pvc strategy: matrix: @@ -34,16 +49,15 @@ jobs: --name ci_sglang_xeon \ sglang_xeon - - name: Install Dependency + - name: Install dependencies timeout-minutes: 20 run: | docker exec ci_sglang_xeon bash -c "python3 -m pip install --upgrade pip" docker exec ci_sglang_xeon pip uninstall sgl-kernel -y || true docker exec -w /sglang-checkout/sgl-kernel ci_sglang_xeon bash -c "cp pyproject_cpu.toml pyproject.toml && pip install -v ." - docker exec -w /sglang-checkout/ ci_sglang_xeon bash -c "pip install -e "python[all_cpu]"" - docker exec ci_sglang_xeon bash -c "python3 -m pip install pytest expecttest" + docker exec -w /sglang-checkout/ ci_sglang_xeon bash -c "pip install -e "python[dev_cpu]"" - - name: Check AMX Support + - name: Check AMX support id: check_amx timeout-minutes: 5 run: | @@ -51,7 +65,7 @@ jobs: bash -c "python3 -c 'import torch; import sgl_kernel; assert torch._C._cpu._is_amx_tile_supported(); assert hasattr(torch.ops.sgl_kernel, \"convert_weight_packed\"); '" continue-on-error: true - - name: Run UT Cases + - name: Run unit tests if: steps.check_amx.outcome == 'success' timeout-minutes: 20 run: | @@ -63,10 +77,10 @@ jobs: run: | docker rm -f ci_sglang_xeon || true - finish: + pr-test-xeon-finish: if: always() needs: [build-test] - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check all dependent job statuses run: | diff --git a/python/pyproject.toml b/python/pyproject.toml index 386806c77..f688803dd 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -105,6 +105,7 @@ torch_memory_saver = ["torch_memory_saver>=0.0.8"] decord = ["decord"] test = [ "accelerate", + "expecttest", "jsonlines", "matplotlib", "pandas",