diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index feff45db0..f71dab83d 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -526,6 +526,49 @@ jobs: # temporarily put backend-independent cpu tests here python3 run_suite.py --hw cpu --suite default $CONTINUE_ON_ERROR_FLAG + stage-a-cpu-only: + needs: [check-changes, call-gate] + if: | + always() && + ( + (inputs.target_stage == 'stage-a-cpu-only') || + ( + !inputs.target_stage && + (github.event_name == 'schedule' || (!failure() && !cancelled())) && + (needs.check-changes.outputs.main_package == 'true') + ) + ) + runs-on: ubuntu-latest + steps: + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc + df -h + + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.pr_head_sha || inputs.ref || github.sha }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + pip install -e "python/[dev]" + + - name: Run test + timeout-minutes: 10 + run: | + cd test/ + CONTINUE_ON_ERROR_FLAG="" + if [[ "${{ needs.check-changes.outputs.continue_on_error }}" == "true" ]]; then + CONTINUE_ON_ERROR_FLAG="--continue-on-error" + fi + python3 run_suite.py --hw cpu --suite stage-a-cpu-only $CONTINUE_ON_ERROR_FLAG + stage-b-test-small-1-gpu: needs: [check-changes, call-gate, stage-a-test-1, sgl-kernel-build-wheels] if: | @@ -1752,6 +1795,7 @@ jobs: multimodal-gen-test-2-gpu, stage-a-test-1, + stage-a-cpu-only, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, stage-b-test-large-2-gpu, diff --git a/scripts/ci/slash_command_handler.py b/scripts/ci/slash_command_handler.py index 537956f8d..6d4558dd4 100644 --- a/scripts/ci/slash_command_handler.py +++ b/scripts/ci/slash_command_handler.py @@ -145,6 +145,7 @@ def handle_rerun_stage( # Valid NVIDIA stage names that support target_stage nvidia_stages = [ "stage-a-test-1", + "stage-a-cpu-only", "stage-b-test-small-1-gpu", "stage-b-test-large-1-gpu", "stage-b-test-large-2-gpu", diff --git a/test/srt/test_harmony_parser.py b/test/registered/parser/test_harmony_parser.py similarity index 99% rename from test/srt/test_harmony_parser.py rename to test/registered/parser/test_harmony_parser.py index 20cc02e5c..cee13af88 100644 --- a/test/srt/test_harmony_parser.py +++ b/test/registered/parser/test_harmony_parser.py @@ -9,8 +9,11 @@ from sglang.srt.parser.harmony_parser import ( iter_tokens, prefix_hold, ) +from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase +register_cpu_ci(est_time=6, suite="stage-a-cpu-only") + class TestEvent(CustomTestCase): def test_init(self): diff --git a/test/srt/test_reasoning_parser.py b/test/registered/parser/test_reasoning_parser.py similarity index 99% rename from test/srt/test_reasoning_parser.py rename to test/registered/parser/test_reasoning_parser.py index 7d3f2a139..5c28066c7 100644 --- a/test/srt/test_reasoning_parser.py +++ b/test/registered/parser/test_reasoning_parser.py @@ -8,8 +8,11 @@ from sglang.srt.parser.reasoning_parser import ( ReasoningParser, StreamingParseResult, ) +from sglang.test.ci.ci_register import register_cpu_ci from sglang.test.test_utils import CustomTestCase +register_cpu_ci(est_time=5, suite="stage-a-cpu-only") + class TestStreamingParseResult(CustomTestCase): def test_init_default(self): diff --git a/test/run_suite.py b/test/run_suite.py index 57ae2c505..a4c73a011 100644 --- a/test/run_suite.py +++ b/test/run_suite.py @@ -17,7 +17,7 @@ HW_MAPPING = { # Per-commit test suites (run on every PR) PER_COMMIT_SUITES = { - HWBackend.CPU: ["default"], + HWBackend.CPU: ["default", "stage-a-cpu-only"], HWBackend.AMD: ["stage-a-test-1", "stage-b-test-small-1-gpu"], HWBackend.CUDA: [ "stage-a-test-1", diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 7793145cb..c82a53f98 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -43,7 +43,6 @@ suites = { TestFile("test_fp8_utils.py", 9), TestFile("rotary_embedding/test_mrope.py", 10), TestFile("test_gpt_oss_1gpu.py", 402), - TestFile("test_harmony_parser.py", 6), TestFile("test_hidden_states.py", 55), TestFile("test_input_embeddings.py", 38), TestFile("test_io_struct.py", 8), @@ -62,7 +61,6 @@ suites = { TestFile("test_prefill_adder.py", 1), TestFile("test_priority_scheduling.py", 130), TestFile("test_pytorch_sampling_backend.py", 66), - TestFile("test_reasoning_parser.py", 5), TestFile("test_request_queue_validation.py", 47), TestFile("test_retract_decode.py", 259), TestFile("test_score_api.py", 260), @@ -207,7 +205,6 @@ suite_amd = { TestFile("test_constrained_decoding.py", 120), TestFile("test_eval_fp8_accuracy.py", 303), TestFile("test_external_models.py", 45), - TestFile("test_harmony_parser.py", 20), TestFile("test_input_embeddings.py", 38), TestFile("test_io_struct.py", 8), TestFile("test_jinja_template_utils.py", 1), @@ -224,7 +221,6 @@ suite_amd = { TestFile("test_profile_merger.py", 12), TestFile("test_profile_merger_http_api.py", 15), TestFile("test_pytorch_sampling_backend.py", 66), - TestFile("test_reasoning_parser.py", 5), TestFile("test_request_queue_validation.py", 70), TestFile("test_retract_decode.py", 450), TestFile("test_rope_rocm.py", 3),