From 5c8a04ac4ebde13fbb4de2458146c504904638e0 Mon Sep 17 00:00:00 2001 From: ashwini rathi Date: Thu, 4 Jun 2026 09:30:25 +0530 Subject: [PATCH] [XPU CI] Expand stage-a and consolidate stage-b tests into stage-a (#27156) Co-authored-by: vshekhawat-hlab Co-authored-by: Ma Mingfei --- .github/workflows/pr-test-xpu.yml | 119 +++++++++--------- .../attention/test_chunk_gated_delta_rule.py | 2 +- .../lora/test_lora_eviction_policy.py | 2 + .../unit/sampling/test_sampling_params.py | 3 +- .../unit/spec/test_adaptive_spec_params.py | 3 +- test/registered/xpu/test_deepseek_ocr.py | 2 +- .../xpu/test_deepseek_ocr_triton.py | 2 +- test/registered/xpu/test_intel_xpu_backend.py | 2 +- test/registered/xpu/test_topk.py | 2 +- 9 files changed, 68 insertions(+), 69 deletions(-) diff --git a/.github/workflows/pr-test-xpu.yml b/.github/workflows/pr-test-xpu.yml index 6e38f9a2b..2cbcc8b6f 100644 --- a/.github/workflows/pr-test-xpu.yml +++ b/.github/workflows/pr-test-xpu.yml @@ -132,79 +132,74 @@ jobs: steps: - run: echo "stage-a passed" - # ==================== Stage B ==================== # - stage-b-test-1-gpu-xpu: - needs: [check-changes, pr-gate, wait-for-stage-a] - if: needs.check-changes.outputs.main_package == 'true' - runs-on: intel-bmg - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ inputs.ref || github.ref }} - - - name: Build Docker image - run: | - PR_REPO=${{ github.event.pull_request.head.repo.clone_url }} - PR_HEAD_REF=${{ github.head_ref }} - docker build \ - ${PR_REPO:+--build-arg SG_LANG_REPO=$PR_REPO} \ - ${PR_HEAD_REF:+--build-arg SG_LANG_BRANCH=$PR_HEAD_REF} \ - --no-cache --progress=plain -f docker/xpu.Dockerfile -t xpu_sglang_main:bmg . - - - name: Run container - id: start_container - run: | - container_id=$(docker run -dt \ - --group-add 992 \ - --group-add $(getent group video | cut -d: -f3) \ - --group-add $(getent group render | cut -d: -f3) \ - -v $HOME/.cache/huggingface:/root/.cache/huggingface \ - --device /dev/dri \ - -v /dev/dri/by-path:/dev/dri/by-path \ - -e HF_TOKEN="$(cat ~/huggingface_token.txt)" \ - xpu_sglang_main:bmg) - echo "Started container: $container_id" - echo "container_id=$container_id" >> "$GITHUB_OUTPUT" - - - name: Install Dependency - timeout-minutes: 20 - run: | - cid="${{ steps.start_container.outputs.container_id }}" - docker exec "$cid" /opt/venv/bin/python3 -m pip install --upgrade pip - docker exec "$cid" /opt/venv/bin/python3 -m pip install pytest expecttest ray huggingface_hub tabulate - docker exec "$cid" /opt/venv/bin/python3 -m pip uninstall -y flashinfer-python - docker exec "$cid" /bin/bash -c '/opt/venv/bin/hf auth login --token ${HF_TOKEN} ' - - - name: Run stage-b tests - timeout-minutes: 60 - run: | - cid="${{ steps.start_container.outputs.container_id }}" - docker exec "$cid" bash -c "source /opt/venv/bin/activate && cd /sgl-workspace/sglang/test && python3 run_suite.py --hw xpu --suite stage-b-test-1-gpu-xpu" - - - name: Cleanup container - if: always() - run: | - cid="${{ steps.start_container.outputs.container_id }}" - docker rm -f "$cid" || true + # ==================== Stage B (disabled — tests moved to Stage A) ==================== # + # stage-b-test-1-gpu-xpu: + # needs: [check-changes, pr-gate, wait-for-stage-a] + # if: needs.check-changes.outputs.main_package == 'true' + # runs-on: intel-bmg + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # ref: ${{ inputs.ref || github.ref }} + # + # - name: Build Docker image + # run: | + # PR_REPO=${{ github.event.pull_request.head.repo.clone_url }} + # PR_HEAD_REF=${{ github.head_ref }} + # docker build \ + # ${PR_REPO:+--build-arg SG_LANG_REPO=$PR_REPO} \ + # ${PR_HEAD_REF:+--build-arg SG_LANG_BRANCH=$PR_HEAD_REF} \ + # --no-cache --progress=plain -f docker/xpu.Dockerfile -t xpu_sglang_main:bmg . + # + # - name: Run container + # id: start_container + # run: | + # container_id=$(docker run -dt \ + # --group-add 992 \ + # --group-add $(getent group video | cut -d: -f3) \ + # --group-add $(getent group render | cut -d: -f3) \ + # -v $HOME/.cache/huggingface:/root/.cache/huggingface \ + # --device /dev/dri \ + # -v /dev/dri/by-path:/dev/dri/by-path \ + # -e HF_TOKEN="$(cat ~/huggingface_token.txt)" \ + # xpu_sglang_main:bmg) + # echo "Started container: $container_id" + # echo "container_id=$container_id" >> "$GITHUB_OUTPUT" + # + # - name: Install Dependency + # timeout-minutes: 20 + # run: | + # cid="${{ steps.start_container.outputs.container_id }}" + # docker exec "$cid" /opt/venv/bin/python3 -m pip install --upgrade pip + # docker exec "$cid" /opt/venv/bin/python3 -m pip install pytest expecttest ray huggingface_hub tabulate + # docker exec "$cid" /opt/venv/bin/python3 -m pip uninstall -y flashinfer-python + # docker exec "$cid" /bin/bash -c '/opt/venv/bin/hf auth login --token ${HF_TOKEN} ' + # + # - name: Run stage-b tests + # timeout-minutes: 60 + # run: | + # cid="${{ steps.start_container.outputs.container_id }}" + # docker exec "$cid" bash -c "source /opt/venv/bin/activate && cd /sgl-workspace/sglang/test && python3 run_suite.py --hw xpu --suite stage-b-test-1-gpu-xpu" + # + # - name: Cleanup container + # if: always() + # run: | + # cid="${{ steps.start_container.outputs.container_id }}" + # docker rm -f "$cid" || true finish: if: always() - needs: [stage-a-test-1-gpu-xpu, stage-b-test-1-gpu-xpu, pr-gate] + needs: [stage-a-test-1-gpu-xpu, pr-gate] runs-on: ubuntu-latest steps: - name: Check job status run: | stage_a="${{ needs.stage-a-test-1-gpu-xpu.result }}" - stage_b="${{ needs.stage-b-test-1-gpu-xpu.result }}" if [ "$stage_a" != "success" ] && [ "$stage_a" != "skipped" ]; then echo "stage-a failed with result: $stage_a" exit 1 fi - if [ "$stage_b" != "success" ] && [ "$stage_b" != "skipped" ]; then - echo "stage-b failed with result: $stage_b" - exit 1 - fi echo "All jobs completed successfully" exit 0 diff --git a/test/registered/attention/test_chunk_gated_delta_rule.py b/test/registered/attention/test_chunk_gated_delta_rule.py index 680c2b50e..bbff6078e 100644 --- a/test/registered/attention/test_chunk_gated_delta_rule.py +++ b/test/registered/attention/test_chunk_gated_delta_rule.py @@ -10,7 +10,7 @@ from sglang.srt.utils import get_device from sglang.test.ci.ci_register import register_cuda_ci, register_xpu_ci register_cuda_ci(est_time=11, stage="base-b", runner_config="1-gpu-large") -register_xpu_ci(est_time=900, suite="stage-b-test-1-gpu-xpu") +register_xpu_ci(est_time=900, suite="stage-a-test-1-gpu-xpu") @unittest.skipIf( diff --git a/test/registered/lora/test_lora_eviction_policy.py b/test/registered/lora/test_lora_eviction_policy.py index 3d70e2d45..218b7ccfe 100644 --- a/test/registered/lora/test_lora_eviction_policy.py +++ b/test/registered/lora/test_lora_eviction_policy.py @@ -24,11 +24,13 @@ from sglang.test.ci.ci_register import ( register_amd_ci, register_cpu_ci, register_cuda_ci, + register_xpu_ci, ) register_cuda_ci(est_time=200, suite="nightly-1-gpu", nightly=True) register_amd_ci(est_time=200, suite="nightly-amd-1-gpu", nightly=True) register_cpu_ci(est_time=6, suite="base-b-test-cpu") +register_xpu_ci(est_time=10, suite="stage-a-test-1-gpu-xpu") class TestLoRAEvictionPolicy(unittest.TestCase): diff --git a/test/registered/unit/sampling/test_sampling_params.py b/test/registered/unit/sampling/test_sampling_params.py index 8d9641894..c98222b2f 100644 --- a/test/registered/unit/sampling/test_sampling_params.py +++ b/test/registered/unit/sampling/test_sampling_params.py @@ -1,9 +1,10 @@ """Unit tests for srt/sampling/sampling_params.py — no server, no model loading.""" -from sglang.test.ci.ci_register import register_cpu_ci +from sglang.test.ci.ci_register import register_cpu_ci, register_xpu_ci register_cpu_ci(est_time=7, suite="base-a-test-cpu") register_cpu_ci(est_time=7, suite="base-b-test-cpu") +register_xpu_ci(est_time=10, suite="stage-a-test-1-gpu-xpu") import unittest from unittest.mock import MagicMock diff --git a/test/registered/unit/spec/test_adaptive_spec_params.py b/test/registered/unit/spec/test_adaptive_spec_params.py index ecb58617c..da26c7b6c 100644 --- a/test/registered/unit/spec/test_adaptive_spec_params.py +++ b/test/registered/unit/spec/test_adaptive_spec_params.py @@ -5,9 +5,10 @@ import unittest from sglang.srt.speculative.adaptive_spec_params import ( AdaptiveSpeculativeParams, ) -from sglang.test.ci.ci_register import register_cpu_ci +from sglang.test.ci.ci_register import register_cpu_ci, register_xpu_ci register_cpu_ci(est_time=6, suite="base-a-test-cpu") +register_xpu_ci(est_time=10, suite="stage-a-test-1-gpu-xpu") class TestAdaptiveSpeculativeParams(unittest.TestCase): diff --git a/test/registered/xpu/test_deepseek_ocr.py b/test/registered/xpu/test_deepseek_ocr.py index 33e38c789..060e04df5 100644 --- a/test/registered/xpu/test_deepseek_ocr.py +++ b/test/registered/xpu/test_deepseek_ocr.py @@ -19,7 +19,7 @@ from sglang.test.test_utils import ( popen_launch_server, ) -register_xpu_ci(est_time=360, suite="stage-b-test-1-gpu-xpu") +register_xpu_ci(est_time=360, suite="stage-a-test-1-gpu-xpu") class TestDeepSeekOCR(CustomTestCase): diff --git a/test/registered/xpu/test_deepseek_ocr_triton.py b/test/registered/xpu/test_deepseek_ocr_triton.py index b17c29710..f605cf41e 100644 --- a/test/registered/xpu/test_deepseek_ocr_triton.py +++ b/test/registered/xpu/test_deepseek_ocr_triton.py @@ -18,7 +18,7 @@ from sglang.test.test_utils import ( register_xpu_ci( est_time=360, - suite="stage-b-test-1-gpu-xpu", + suite="stage-a-test-1-gpu-xpu", disabled="Temporarily disabled until Triton-XPU upgrade", ) diff --git a/test/registered/xpu/test_intel_xpu_backend.py b/test/registered/xpu/test_intel_xpu_backend.py index b38c57984..c73f30102 100644 --- a/test/registered/xpu/test_intel_xpu_backend.py +++ b/test/registered/xpu/test_intel_xpu_backend.py @@ -16,7 +16,7 @@ from sglang.test.test_utils import ( run_bench_one_batch, ) -register_xpu_ci(est_time=600, suite="stage-b-test-1-gpu-xpu") +register_xpu_ci(est_time=600, suite="stage-a-test-1-gpu-xpu") def intel_xpu_benchmark( diff --git a/test/registered/xpu/test_topk.py b/test/registered/xpu/test_topk.py index 2ddc0be59..2522950b8 100644 --- a/test/registered/xpu/test_topk.py +++ b/test/registered/xpu/test_topk.py @@ -11,7 +11,7 @@ from sglang.srt.layers.moe.topk import ( from sglang.test.ci.ci_register import register_xpu_ci from sglang.test.test_utils import CustomTestCase -register_xpu_ci(est_time=5, suite="stage-b-test-1-gpu-xpu") +register_xpu_ci(est_time=5, suite="stage-a-test-1-gpu-xpu") # Nemotron-3 uses biased_grouped_topk