From c1ce9947bca09c72800c5994c3b91fa40b56d246 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Wed, 19 Nov 2025 20:21:23 -0800 Subject: [PATCH 01/12] Move manual tests from test/srt/ to test/manual/ This PR organizes tests by moving all manual tests (previously in __not_in_ci__ section) to a dedicated test/manual/ directory. Changes: - Moved 77 manual tests from test/srt/ to test/manual/ - Removed __not_in_ci__ section from test/srt/run_suite.py - Updated .github/workflows/pr-test.yml - Added REORGANIZATION_PLAN.md documenting the changes Benefits: - Clearer separation between CI and manual tests - Easier to identify which tests are not run in CI - Cleaner run_suite.py without __not_in_ci__ section --- .github/workflows/pr-test.yml | 194 ++++++++++++++++++ .../ascend/test_ascend_w8a8_quantization.py | 0 .../ascend/test_mindspore_models.py | 0 test/{srt => manual}/cpu/test_comm.py | 0 .../debug_utils/test_log_parser.py | 0 .../http_server/test_abort_request.py | 0 .../hicache/test_disaggregation_hicache.py | 0 .../attention/nsa/test_act_quant_triton.py | 0 .../layers/moe/test_moe_runners.py | 0 .../lora/test_chunked_sgmv_backend.py | 0 .../lora/test_lora_cuda_graph.py | 0 test/{srt => manual}/lora/test_lora_llama4.py | 0 .../lora/test_lora_qwen3_vl.py | 0 .../models/test_clip_models.py | 0 .../models/test_dummy_grok_models.py | 0 .../models/test_falcon_h1_models.py | 0 .../models/test_gme_qwen_models.py | 0 .../models/test_grok_models.py | 0 .../models/test_llama4_models.py | 0 .../{srt => manual}/models/test_mtp_models.py | 0 .../models/test_unsloth_models.py | 0 .../nightly/test_deepseek_v31_perf.py | 0 .../nightly/test_deepseek_v32_perf.py | 0 .../nightly/test_text_models_gsm8k_eval.py | 0 .../nightly/test_text_models_perf.py | 0 .../nightly/test_vlms_mmmu_eval.py | 0 .../{srt => manual}/nightly/test_vlms_perf.py | 0 .../nightly/test_vlms_piecewise_cuda_graph.py | 0 .../features/test_cache_report.py | 0 .../features/test_continuous_usage_stats.py | 0 .../features/test_structural_tag.py | 0 .../{srt => manual}/quant/test_fp8_kvcache.py | 0 .../rl/test_verl_engine_2_gpu.py | 0 .../rl/test_verl_engine_4_gpu.py | 0 .../test_async_dynamic_batch_tokenizer.py | 0 .../test_async_mm_data_processor.py | 0 test/{srt => manual}/test_bench_one_batch.py | 0 test/{srt => manual}/test_bench_serving.py | 0 .../test_config_integration.py | 0 test/{srt => manual}/test_custom_allreduce.py | 0 .../test_deepseek_chat_templates.py | 0 .../test_deepseek_v32_cp_single_node.py | 0 .../test_deepseek_v3_cutedsl_4gpu.py | 0 test/{srt => manual}/test_double_sparsity.py | 0 .../test_eagle_infer_beta_dp_attention.py | 0 .../test_eval_accuracy_large.py | 0 .../test_expert_distribution.py | 0 .../test_expert_location_updater.py | 0 test/{srt => manual}/test_fim_completion.py | 0 .../test_forward_split_prefill.py | 0 .../test_get_weights_by_name.py | 0 test/{srt => manual}/test_gpt_oss_common.py | 0 test/{srt => manual}/test_health_check.py | 0 test/{srt => manual}/test_kv_events.py | 0 test/{srt => manual}/test_logprobs.py | 0 test/{srt => manual}/test_mla_tp.py | 0 test/{srt => manual}/test_modelopt.py | 0 .../test_modelopt_fp8kvcache.py | 0 .../test_models_from_modelscope.py | 0 .../test_moe_eval_accuracy_large.py | 0 test/{srt => manual}/test_mscclpp.py | 0 test/{srt => manual}/test_quick_allreduce.py | 0 test/{srt => manual}/test_sagemaker_server.py | 0 test/{srt => manual}/test_schedule_policy.py | 0 test/{srt => manual}/test_session_control.py | 0 .../test_srt_engine_with_quant_args.py | 0 .../test_tokenizer_batch_encode.py | 0 .../{srt => manual}/test_tokenizer_manager.py | 0 .../test_torch_flex_attention_backend.py | 0 test/{srt => manual}/test_torch_tp.py | 0 test/{srt => manual}/test_tracing.py | 0 .../test_triton_attention_rocm_mla.py | 0 test/{srt => manual}/test_triton_fused_moe.py | 0 test/{srt => manual}/test_triton_moe_wna16.py | 0 .../{srt => manual}/test_two_batch_overlap.py | 0 test/{srt => manual}/test_vertex_endpoint.py | 0 .../test_vision_openai_server_common.py | 0 test/{srt => manual}/test_vlm_accuracy.py | 0 .../test_wave_attention_backend.py | 0 test/{srt => manual}/test_weight_version.py | 0 test/srt/REORGANIZATION_PLAN.md | 68 ++++++ test/srt/run_suite.py | 82 -------- 82 files changed, 262 insertions(+), 82 deletions(-) rename test/{srt => manual}/ascend/test_ascend_w8a8_quantization.py (100%) rename test/{srt => manual}/ascend/test_mindspore_models.py (100%) rename test/{srt => manual}/cpu/test_comm.py (100%) rename test/{srt => manual}/debug_utils/test_log_parser.py (100%) rename test/{srt => manual}/entrypoints/http_server/test_abort_request.py (100%) rename test/{srt => manual}/hicache/test_disaggregation_hicache.py (100%) rename test/{srt => manual}/layers/attention/nsa/test_act_quant_triton.py (100%) rename test/{srt => manual}/layers/moe/test_moe_runners.py (100%) rename test/{srt => manual}/lora/test_chunked_sgmv_backend.py (100%) rename test/{srt => manual}/lora/test_lora_cuda_graph.py (100%) rename test/{srt => manual}/lora/test_lora_llama4.py (100%) rename test/{srt => manual}/lora/test_lora_qwen3_vl.py (100%) rename test/{srt => manual}/models/test_clip_models.py (100%) rename test/{srt => manual}/models/test_dummy_grok_models.py (100%) rename test/{srt => manual}/models/test_falcon_h1_models.py (100%) rename test/{srt => manual}/models/test_gme_qwen_models.py (100%) rename test/{srt => manual}/models/test_grok_models.py (100%) rename test/{srt => manual}/models/test_llama4_models.py (100%) rename test/{srt => manual}/models/test_mtp_models.py (100%) rename test/{srt => manual}/models/test_unsloth_models.py (100%) rename test/{srt => manual}/nightly/test_deepseek_v31_perf.py (100%) rename test/{srt => manual}/nightly/test_deepseek_v32_perf.py (100%) rename test/{srt => manual}/nightly/test_text_models_gsm8k_eval.py (100%) rename test/{srt => manual}/nightly/test_text_models_perf.py (100%) rename test/{srt => manual}/nightly/test_vlms_mmmu_eval.py (100%) rename test/{srt => manual}/nightly/test_vlms_perf.py (100%) rename test/{srt => manual}/nightly/test_vlms_piecewise_cuda_graph.py (100%) rename test/{srt => manual}/openai_server/features/test_cache_report.py (100%) rename test/{srt => manual}/openai_server/features/test_continuous_usage_stats.py (100%) rename test/{srt => manual}/openai_server/features/test_structural_tag.py (100%) rename test/{srt => manual}/quant/test_fp8_kvcache.py (100%) rename test/{srt => manual}/rl/test_verl_engine_2_gpu.py (100%) rename test/{srt => manual}/rl/test_verl_engine_4_gpu.py (100%) rename test/{srt => manual}/test_async_dynamic_batch_tokenizer.py (100%) rename test/{srt => manual}/test_async_mm_data_processor.py (100%) rename test/{srt => manual}/test_bench_one_batch.py (100%) rename test/{srt => manual}/test_bench_serving.py (100%) rename test/{srt => manual}/test_config_integration.py (100%) rename test/{srt => manual}/test_custom_allreduce.py (100%) rename test/{srt => manual}/test_deepseek_chat_templates.py (100%) rename test/{srt => manual}/test_deepseek_v32_cp_single_node.py (100%) rename test/{srt => manual}/test_deepseek_v3_cutedsl_4gpu.py (100%) rename test/{srt => manual}/test_double_sparsity.py (100%) rename test/{srt => manual}/test_eagle_infer_beta_dp_attention.py (100%) rename test/{srt => manual}/test_eval_accuracy_large.py (100%) rename test/{srt => manual}/test_expert_distribution.py (100%) rename test/{srt => manual}/test_expert_location_updater.py (100%) rename test/{srt => manual}/test_fim_completion.py (100%) rename test/{srt => manual}/test_forward_split_prefill.py (100%) rename test/{srt => manual}/test_get_weights_by_name.py (100%) rename test/{srt => manual}/test_gpt_oss_common.py (100%) rename test/{srt => manual}/test_health_check.py (100%) rename test/{srt => manual}/test_kv_events.py (100%) rename test/{srt => manual}/test_logprobs.py (100%) rename test/{srt => manual}/test_mla_tp.py (100%) rename test/{srt => manual}/test_modelopt.py (100%) rename test/{srt => manual}/test_modelopt_fp8kvcache.py (100%) rename test/{srt => manual}/test_models_from_modelscope.py (100%) rename test/{srt => manual}/test_moe_eval_accuracy_large.py (100%) rename test/{srt => manual}/test_mscclpp.py (100%) rename test/{srt => manual}/test_quick_allreduce.py (100%) rename test/{srt => manual}/test_sagemaker_server.py (100%) rename test/{srt => manual}/test_schedule_policy.py (100%) rename test/{srt => manual}/test_session_control.py (100%) rename test/{srt => manual}/test_srt_engine_with_quant_args.py (100%) rename test/{srt => manual}/test_tokenizer_batch_encode.py (100%) rename test/{srt => manual}/test_tokenizer_manager.py (100%) rename test/{srt => manual}/test_torch_flex_attention_backend.py (100%) rename test/{srt => manual}/test_torch_tp.py (100%) rename test/{srt => manual}/test_tracing.py (100%) rename test/{srt => manual}/test_triton_attention_rocm_mla.py (100%) rename test/{srt => manual}/test_triton_fused_moe.py (100%) rename test/{srt => manual}/test_triton_moe_wna16.py (100%) rename test/{srt => manual}/test_two_batch_overlap.py (100%) rename test/{srt => manual}/test_vertex_endpoint.py (100%) rename test/{srt => manual}/test_vision_openai_server_common.py (100%) rename test/{srt => manual}/test_vlm_accuracy.py (100%) rename test/{srt => manual}/test_wave_attention_backend.py (100%) rename test/{srt => manual}/test_weight_version.py (100%) create mode 100644 test/srt/REORGANIZATION_PLAN.md diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index d378a9aeafd2..cdef3436ae2e 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -244,6 +244,8 @@ jobs: echo "All benchmark tests completed!" + # =============================================== multimodal_gen ==================================================== + # Adding a single CUDA13 smoke test to verify that the kernel builds and runs # TODO: Add back this test when it can pass on CI # cuda13-kernel-smoke-test: @@ -313,6 +315,191 @@ jobs: run: | rm -rf python/sglang/logs || true + stage-a-test-2: + needs: [check-changes, stage-a-test-1, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 1-gpu-runner + env: + RUNNER_LABELS: 1-gpu-runner + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-a-test-2 + + stage-b-test-small-1-gpu: + needs: [check-changes, stage-a-test-2, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 1-gpu-runner + strategy: + fail-fast: false + matrix: + partition: [0, 1, 2, 3] + env: + RUNNER_LABELS: 1-gpu-runner + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-b-test-small-1-gpu --auto-partition-id ${{ matrix.partition }} --auto-partition-size 4 + + stage-b-test-large-1-gpu: + needs: [check-changes, stage-a-test-2, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 1-gpu-runner + env: + RUNNER_LABELS: 1-gpu-runner + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-b-test-large-1-gpu + + stage-b-test-large-2-gpu: + needs: [check-changes, stage-a-test-2, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 2-gpu-runner + env: + RUNNER_LABELS: 2-gpu-runner + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-b-test-large-2-gpu + + stage-c-test-large-1-gpu: + needs: [check-changes, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 1-gpu-runner + env: + RUNNER_LABELS: 1-gpu-runner + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-c-test-large-1-gpu + + stage-c-test-large-2-gpu: + needs: [check-changes, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, stage-b-test-large-2-gpu, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 2-gpu-runner + env: + RUNNER_LABELS: 2-gpu-runner + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-c-test-large-2-gpu + + stage-c-test-large-4-gpu: + needs: [check-changes, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, stage-b-test-large-2-gpu, sgl-kernel-build-wheels] + if: always() && !failure() && !cancelled() && + ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) + runs-on: 4-gpu-h100 + env: + RUNNER_LABELS: 4-gpu-h100 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Download artifacts + if: needs.check-changes.outputs.sgl_kernel == 'true' + uses: actions/download-artifact@v4 + with: + path: sgl-kernel/dist/ + merge-multiple: true + pattern: wheel-python3.10-cuda12.9 + - name: Install dependencies + run: | + CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh + - name: Run test + timeout-minutes: 30 + run: | + cd test + python3 run_suite.py --hw cuda --suite stage-c-test-large-4-gpu multimodal-gen-test: needs: [check-changes, sgl-kernel-build-wheels] @@ -933,6 +1120,13 @@ jobs: multimodal-gen-test, stage-a-test-1, + stage-a-test-2, + stage-b-test-small-1-gpu, + stage-b-test-large-1-gpu, + stage-b-test-large-2-gpu, + stage-c-test-large-1-gpu, + stage-c-test-large-2-gpu, + stage-c-test-large-4-gpu, unit-test-backend-1-gpu, unit-test-backend-2-gpu, unit-test-backend-4-gpu, diff --git a/test/srt/ascend/test_ascend_w8a8_quantization.py b/test/manual/ascend/test_ascend_w8a8_quantization.py similarity index 100% rename from test/srt/ascend/test_ascend_w8a8_quantization.py rename to test/manual/ascend/test_ascend_w8a8_quantization.py diff --git a/test/srt/ascend/test_mindspore_models.py b/test/manual/ascend/test_mindspore_models.py similarity index 100% rename from test/srt/ascend/test_mindspore_models.py rename to test/manual/ascend/test_mindspore_models.py diff --git a/test/srt/cpu/test_comm.py b/test/manual/cpu/test_comm.py similarity index 100% rename from test/srt/cpu/test_comm.py rename to test/manual/cpu/test_comm.py diff --git a/test/srt/debug_utils/test_log_parser.py b/test/manual/debug_utils/test_log_parser.py similarity index 100% rename from test/srt/debug_utils/test_log_parser.py rename to test/manual/debug_utils/test_log_parser.py diff --git a/test/srt/entrypoints/http_server/test_abort_request.py b/test/manual/entrypoints/http_server/test_abort_request.py similarity index 100% rename from test/srt/entrypoints/http_server/test_abort_request.py rename to test/manual/entrypoints/http_server/test_abort_request.py diff --git a/test/srt/hicache/test_disaggregation_hicache.py b/test/manual/hicache/test_disaggregation_hicache.py similarity index 100% rename from test/srt/hicache/test_disaggregation_hicache.py rename to test/manual/hicache/test_disaggregation_hicache.py diff --git a/test/srt/layers/attention/nsa/test_act_quant_triton.py b/test/manual/layers/attention/nsa/test_act_quant_triton.py similarity index 100% rename from test/srt/layers/attention/nsa/test_act_quant_triton.py rename to test/manual/layers/attention/nsa/test_act_quant_triton.py diff --git a/test/srt/layers/moe/test_moe_runners.py b/test/manual/layers/moe/test_moe_runners.py similarity index 100% rename from test/srt/layers/moe/test_moe_runners.py rename to test/manual/layers/moe/test_moe_runners.py diff --git a/test/srt/lora/test_chunked_sgmv_backend.py b/test/manual/lora/test_chunked_sgmv_backend.py similarity index 100% rename from test/srt/lora/test_chunked_sgmv_backend.py rename to test/manual/lora/test_chunked_sgmv_backend.py diff --git a/test/srt/lora/test_lora_cuda_graph.py b/test/manual/lora/test_lora_cuda_graph.py similarity index 100% rename from test/srt/lora/test_lora_cuda_graph.py rename to test/manual/lora/test_lora_cuda_graph.py diff --git a/test/srt/lora/test_lora_llama4.py b/test/manual/lora/test_lora_llama4.py similarity index 100% rename from test/srt/lora/test_lora_llama4.py rename to test/manual/lora/test_lora_llama4.py diff --git a/test/srt/lora/test_lora_qwen3_vl.py b/test/manual/lora/test_lora_qwen3_vl.py similarity index 100% rename from test/srt/lora/test_lora_qwen3_vl.py rename to test/manual/lora/test_lora_qwen3_vl.py diff --git a/test/srt/models/test_clip_models.py b/test/manual/models/test_clip_models.py similarity index 100% rename from test/srt/models/test_clip_models.py rename to test/manual/models/test_clip_models.py diff --git a/test/srt/models/test_dummy_grok_models.py b/test/manual/models/test_dummy_grok_models.py similarity index 100% rename from test/srt/models/test_dummy_grok_models.py rename to test/manual/models/test_dummy_grok_models.py diff --git a/test/srt/models/test_falcon_h1_models.py b/test/manual/models/test_falcon_h1_models.py similarity index 100% rename from test/srt/models/test_falcon_h1_models.py rename to test/manual/models/test_falcon_h1_models.py diff --git a/test/srt/models/test_gme_qwen_models.py b/test/manual/models/test_gme_qwen_models.py similarity index 100% rename from test/srt/models/test_gme_qwen_models.py rename to test/manual/models/test_gme_qwen_models.py diff --git a/test/srt/models/test_grok_models.py b/test/manual/models/test_grok_models.py similarity index 100% rename from test/srt/models/test_grok_models.py rename to test/manual/models/test_grok_models.py diff --git a/test/srt/models/test_llama4_models.py b/test/manual/models/test_llama4_models.py similarity index 100% rename from test/srt/models/test_llama4_models.py rename to test/manual/models/test_llama4_models.py diff --git a/test/srt/models/test_mtp_models.py b/test/manual/models/test_mtp_models.py similarity index 100% rename from test/srt/models/test_mtp_models.py rename to test/manual/models/test_mtp_models.py diff --git a/test/srt/models/test_unsloth_models.py b/test/manual/models/test_unsloth_models.py similarity index 100% rename from test/srt/models/test_unsloth_models.py rename to test/manual/models/test_unsloth_models.py diff --git a/test/srt/nightly/test_deepseek_v31_perf.py b/test/manual/nightly/test_deepseek_v31_perf.py similarity index 100% rename from test/srt/nightly/test_deepseek_v31_perf.py rename to test/manual/nightly/test_deepseek_v31_perf.py diff --git a/test/srt/nightly/test_deepseek_v32_perf.py b/test/manual/nightly/test_deepseek_v32_perf.py similarity index 100% rename from test/srt/nightly/test_deepseek_v32_perf.py rename to test/manual/nightly/test_deepseek_v32_perf.py diff --git a/test/srt/nightly/test_text_models_gsm8k_eval.py b/test/manual/nightly/test_text_models_gsm8k_eval.py similarity index 100% rename from test/srt/nightly/test_text_models_gsm8k_eval.py rename to test/manual/nightly/test_text_models_gsm8k_eval.py diff --git a/test/srt/nightly/test_text_models_perf.py b/test/manual/nightly/test_text_models_perf.py similarity index 100% rename from test/srt/nightly/test_text_models_perf.py rename to test/manual/nightly/test_text_models_perf.py diff --git a/test/srt/nightly/test_vlms_mmmu_eval.py b/test/manual/nightly/test_vlms_mmmu_eval.py similarity index 100% rename from test/srt/nightly/test_vlms_mmmu_eval.py rename to test/manual/nightly/test_vlms_mmmu_eval.py diff --git a/test/srt/nightly/test_vlms_perf.py b/test/manual/nightly/test_vlms_perf.py similarity index 100% rename from test/srt/nightly/test_vlms_perf.py rename to test/manual/nightly/test_vlms_perf.py diff --git a/test/srt/nightly/test_vlms_piecewise_cuda_graph.py b/test/manual/nightly/test_vlms_piecewise_cuda_graph.py similarity index 100% rename from test/srt/nightly/test_vlms_piecewise_cuda_graph.py rename to test/manual/nightly/test_vlms_piecewise_cuda_graph.py diff --git a/test/srt/openai_server/features/test_cache_report.py b/test/manual/openai_server/features/test_cache_report.py similarity index 100% rename from test/srt/openai_server/features/test_cache_report.py rename to test/manual/openai_server/features/test_cache_report.py diff --git a/test/srt/openai_server/features/test_continuous_usage_stats.py b/test/manual/openai_server/features/test_continuous_usage_stats.py similarity index 100% rename from test/srt/openai_server/features/test_continuous_usage_stats.py rename to test/manual/openai_server/features/test_continuous_usage_stats.py diff --git a/test/srt/openai_server/features/test_structural_tag.py b/test/manual/openai_server/features/test_structural_tag.py similarity index 100% rename from test/srt/openai_server/features/test_structural_tag.py rename to test/manual/openai_server/features/test_structural_tag.py diff --git a/test/srt/quant/test_fp8_kvcache.py b/test/manual/quant/test_fp8_kvcache.py similarity index 100% rename from test/srt/quant/test_fp8_kvcache.py rename to test/manual/quant/test_fp8_kvcache.py diff --git a/test/srt/rl/test_verl_engine_2_gpu.py b/test/manual/rl/test_verl_engine_2_gpu.py similarity index 100% rename from test/srt/rl/test_verl_engine_2_gpu.py rename to test/manual/rl/test_verl_engine_2_gpu.py diff --git a/test/srt/rl/test_verl_engine_4_gpu.py b/test/manual/rl/test_verl_engine_4_gpu.py similarity index 100% rename from test/srt/rl/test_verl_engine_4_gpu.py rename to test/manual/rl/test_verl_engine_4_gpu.py diff --git a/test/srt/test_async_dynamic_batch_tokenizer.py b/test/manual/test_async_dynamic_batch_tokenizer.py similarity index 100% rename from test/srt/test_async_dynamic_batch_tokenizer.py rename to test/manual/test_async_dynamic_batch_tokenizer.py diff --git a/test/srt/test_async_mm_data_processor.py b/test/manual/test_async_mm_data_processor.py similarity index 100% rename from test/srt/test_async_mm_data_processor.py rename to test/manual/test_async_mm_data_processor.py diff --git a/test/srt/test_bench_one_batch.py b/test/manual/test_bench_one_batch.py similarity index 100% rename from test/srt/test_bench_one_batch.py rename to test/manual/test_bench_one_batch.py diff --git a/test/srt/test_bench_serving.py b/test/manual/test_bench_serving.py similarity index 100% rename from test/srt/test_bench_serving.py rename to test/manual/test_bench_serving.py diff --git a/test/srt/test_config_integration.py b/test/manual/test_config_integration.py similarity index 100% rename from test/srt/test_config_integration.py rename to test/manual/test_config_integration.py diff --git a/test/srt/test_custom_allreduce.py b/test/manual/test_custom_allreduce.py similarity index 100% rename from test/srt/test_custom_allreduce.py rename to test/manual/test_custom_allreduce.py diff --git a/test/srt/test_deepseek_chat_templates.py b/test/manual/test_deepseek_chat_templates.py similarity index 100% rename from test/srt/test_deepseek_chat_templates.py rename to test/manual/test_deepseek_chat_templates.py diff --git a/test/srt/test_deepseek_v32_cp_single_node.py b/test/manual/test_deepseek_v32_cp_single_node.py similarity index 100% rename from test/srt/test_deepseek_v32_cp_single_node.py rename to test/manual/test_deepseek_v32_cp_single_node.py diff --git a/test/srt/test_deepseek_v3_cutedsl_4gpu.py b/test/manual/test_deepseek_v3_cutedsl_4gpu.py similarity index 100% rename from test/srt/test_deepseek_v3_cutedsl_4gpu.py rename to test/manual/test_deepseek_v3_cutedsl_4gpu.py diff --git a/test/srt/test_double_sparsity.py b/test/manual/test_double_sparsity.py similarity index 100% rename from test/srt/test_double_sparsity.py rename to test/manual/test_double_sparsity.py diff --git a/test/srt/test_eagle_infer_beta_dp_attention.py b/test/manual/test_eagle_infer_beta_dp_attention.py similarity index 100% rename from test/srt/test_eagle_infer_beta_dp_attention.py rename to test/manual/test_eagle_infer_beta_dp_attention.py diff --git a/test/srt/test_eval_accuracy_large.py b/test/manual/test_eval_accuracy_large.py similarity index 100% rename from test/srt/test_eval_accuracy_large.py rename to test/manual/test_eval_accuracy_large.py diff --git a/test/srt/test_expert_distribution.py b/test/manual/test_expert_distribution.py similarity index 100% rename from test/srt/test_expert_distribution.py rename to test/manual/test_expert_distribution.py diff --git a/test/srt/test_expert_location_updater.py b/test/manual/test_expert_location_updater.py similarity index 100% rename from test/srt/test_expert_location_updater.py rename to test/manual/test_expert_location_updater.py diff --git a/test/srt/test_fim_completion.py b/test/manual/test_fim_completion.py similarity index 100% rename from test/srt/test_fim_completion.py rename to test/manual/test_fim_completion.py diff --git a/test/srt/test_forward_split_prefill.py b/test/manual/test_forward_split_prefill.py similarity index 100% rename from test/srt/test_forward_split_prefill.py rename to test/manual/test_forward_split_prefill.py diff --git a/test/srt/test_get_weights_by_name.py b/test/manual/test_get_weights_by_name.py similarity index 100% rename from test/srt/test_get_weights_by_name.py rename to test/manual/test_get_weights_by_name.py diff --git a/test/srt/test_gpt_oss_common.py b/test/manual/test_gpt_oss_common.py similarity index 100% rename from test/srt/test_gpt_oss_common.py rename to test/manual/test_gpt_oss_common.py diff --git a/test/srt/test_health_check.py b/test/manual/test_health_check.py similarity index 100% rename from test/srt/test_health_check.py rename to test/manual/test_health_check.py diff --git a/test/srt/test_kv_events.py b/test/manual/test_kv_events.py similarity index 100% rename from test/srt/test_kv_events.py rename to test/manual/test_kv_events.py diff --git a/test/srt/test_logprobs.py b/test/manual/test_logprobs.py similarity index 100% rename from test/srt/test_logprobs.py rename to test/manual/test_logprobs.py diff --git a/test/srt/test_mla_tp.py b/test/manual/test_mla_tp.py similarity index 100% rename from test/srt/test_mla_tp.py rename to test/manual/test_mla_tp.py diff --git a/test/srt/test_modelopt.py b/test/manual/test_modelopt.py similarity index 100% rename from test/srt/test_modelopt.py rename to test/manual/test_modelopt.py diff --git a/test/srt/test_modelopt_fp8kvcache.py b/test/manual/test_modelopt_fp8kvcache.py similarity index 100% rename from test/srt/test_modelopt_fp8kvcache.py rename to test/manual/test_modelopt_fp8kvcache.py diff --git a/test/srt/test_models_from_modelscope.py b/test/manual/test_models_from_modelscope.py similarity index 100% rename from test/srt/test_models_from_modelscope.py rename to test/manual/test_models_from_modelscope.py diff --git a/test/srt/test_moe_eval_accuracy_large.py b/test/manual/test_moe_eval_accuracy_large.py similarity index 100% rename from test/srt/test_moe_eval_accuracy_large.py rename to test/manual/test_moe_eval_accuracy_large.py diff --git a/test/srt/test_mscclpp.py b/test/manual/test_mscclpp.py similarity index 100% rename from test/srt/test_mscclpp.py rename to test/manual/test_mscclpp.py diff --git a/test/srt/test_quick_allreduce.py b/test/manual/test_quick_allreduce.py similarity index 100% rename from test/srt/test_quick_allreduce.py rename to test/manual/test_quick_allreduce.py diff --git a/test/srt/test_sagemaker_server.py b/test/manual/test_sagemaker_server.py similarity index 100% rename from test/srt/test_sagemaker_server.py rename to test/manual/test_sagemaker_server.py diff --git a/test/srt/test_schedule_policy.py b/test/manual/test_schedule_policy.py similarity index 100% rename from test/srt/test_schedule_policy.py rename to test/manual/test_schedule_policy.py diff --git a/test/srt/test_session_control.py b/test/manual/test_session_control.py similarity index 100% rename from test/srt/test_session_control.py rename to test/manual/test_session_control.py diff --git a/test/srt/test_srt_engine_with_quant_args.py b/test/manual/test_srt_engine_with_quant_args.py similarity index 100% rename from test/srt/test_srt_engine_with_quant_args.py rename to test/manual/test_srt_engine_with_quant_args.py diff --git a/test/srt/test_tokenizer_batch_encode.py b/test/manual/test_tokenizer_batch_encode.py similarity index 100% rename from test/srt/test_tokenizer_batch_encode.py rename to test/manual/test_tokenizer_batch_encode.py diff --git a/test/srt/test_tokenizer_manager.py b/test/manual/test_tokenizer_manager.py similarity index 100% rename from test/srt/test_tokenizer_manager.py rename to test/manual/test_tokenizer_manager.py diff --git a/test/srt/test_torch_flex_attention_backend.py b/test/manual/test_torch_flex_attention_backend.py similarity index 100% rename from test/srt/test_torch_flex_attention_backend.py rename to test/manual/test_torch_flex_attention_backend.py diff --git a/test/srt/test_torch_tp.py b/test/manual/test_torch_tp.py similarity index 100% rename from test/srt/test_torch_tp.py rename to test/manual/test_torch_tp.py diff --git a/test/srt/test_tracing.py b/test/manual/test_tracing.py similarity index 100% rename from test/srt/test_tracing.py rename to test/manual/test_tracing.py diff --git a/test/srt/test_triton_attention_rocm_mla.py b/test/manual/test_triton_attention_rocm_mla.py similarity index 100% rename from test/srt/test_triton_attention_rocm_mla.py rename to test/manual/test_triton_attention_rocm_mla.py diff --git a/test/srt/test_triton_fused_moe.py b/test/manual/test_triton_fused_moe.py similarity index 100% rename from test/srt/test_triton_fused_moe.py rename to test/manual/test_triton_fused_moe.py diff --git a/test/srt/test_triton_moe_wna16.py b/test/manual/test_triton_moe_wna16.py similarity index 100% rename from test/srt/test_triton_moe_wna16.py rename to test/manual/test_triton_moe_wna16.py diff --git a/test/srt/test_two_batch_overlap.py b/test/manual/test_two_batch_overlap.py similarity index 100% rename from test/srt/test_two_batch_overlap.py rename to test/manual/test_two_batch_overlap.py diff --git a/test/srt/test_vertex_endpoint.py b/test/manual/test_vertex_endpoint.py similarity index 100% rename from test/srt/test_vertex_endpoint.py rename to test/manual/test_vertex_endpoint.py diff --git a/test/srt/test_vision_openai_server_common.py b/test/manual/test_vision_openai_server_common.py similarity index 100% rename from test/srt/test_vision_openai_server_common.py rename to test/manual/test_vision_openai_server_common.py diff --git a/test/srt/test_vlm_accuracy.py b/test/manual/test_vlm_accuracy.py similarity index 100% rename from test/srt/test_vlm_accuracy.py rename to test/manual/test_vlm_accuracy.py diff --git a/test/srt/test_wave_attention_backend.py b/test/manual/test_wave_attention_backend.py similarity index 100% rename from test/srt/test_wave_attention_backend.py rename to test/manual/test_wave_attention_backend.py diff --git a/test/srt/test_weight_version.py b/test/manual/test_weight_version.py similarity index 100% rename from test/srt/test_weight_version.py rename to test/manual/test_weight_version.py diff --git a/test/srt/REORGANIZATION_PLAN.md b/test/srt/REORGANIZATION_PLAN.md new file mode 100644 index 000000000000..e804a431092c --- /dev/null +++ b/test/srt/REORGANIZATION_PLAN.md @@ -0,0 +1,68 @@ +# Test Directory Reorganization Plan + +## Overview + +This PR moves all tests marked as "__not_in_ci__" from test/srt/ to test/manual/ for easier organization and review. It also updates the pr-test.yml CI configuration. + +## Changes Made + +### 1. Moved Manual Tests +- **77 tests** moved from test/srt/ to test/manual/ +- These were previously in the "__not_in_ci__" section of run_suite.py +- Tests are not run in CI and are kept for manual testing purposes +- Directory structure preserved (e.g., models/, lora/, nightly/, etc.) + +### 2. Updated CI Configuration +- Updated `.github/workflows/pr-test.yml` with improvements + +### 3. Cleaned Up run_suite.py +- Removed the "__not_in_ci__" section from test/srt/run_suite.py +- All manual tests are now in test/manual/ + +## Directory Structure + +``` +test/ +├── manual/ # ✅ NEW: Manual tests not run in CI +│ ├── ascend/ # Ascend-specific manual tests +│ ├── cpu/ # CPU manual tests +│ ├── debug_utils/ # Debug utilities +│ ├── entrypoints/ # Entrypoint tests +│ ├── hicache/ # HiCache tests +│ ├── layers/ # Layer-specific tests +│ ├── lora/ # LoRA manual tests +│ ├── models/ # Model manual tests +│ ├── nightly/ # Nightly performance tests +│ ├── openai_server/ # OpenAI server tests +│ ├── quant/ # Quantization tests +│ ├── rl/ # RL tests +│ └── test_*.py # Various manual tests +│ +└── srt/ # All CI tests remain here + ├── run_suite.py # Test runner (cleaned up) + └── ... (all other test files) +``` + +## Manual Tests Moved (77 tests) + +Tests moved to test/manual/: +- Ascend NPU tests (2) +- CPU communication tests (1) +- Debug utilities (1) +- Entrypoint tests (1) +- HiCache tests (1) +- Layer tests (2) +- LoRA tests (3) +- Model tests (7) +- Nightly performance tests (7) +- OpenAI server tests (3) +- Quantization tests (1) +- RL tests (2) +- Various other manual tests (46) + +## Benefits + +1. **Cleaner organization**: Manual tests clearly separated from CI tests +2. **Easier review**: No more "__not_in_ci__" section in run_suite.py +3. **Better structure**: test/manual/ directory clearly indicates purpose +4. **Simpler CI logic**: No special handling for "__not_in_ci__" tests diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 1bcde43a1542..30f9885a1d87 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -229,88 +229,6 @@ TestFile("test_deepseek_v32_nsabackend.py", 600), ], "nightly-8-gpu-h20": [], - "__not_in_ci__": [ - TestFile("ascend/test_ascend_w8a8_quantization.py"), - TestFile("ascend/test_mindspore_models.py"), - TestFile("cpu/test_comm.py"), - TestFile("debug_utils/test_log_parser.py", 5), - TestFile("test_deepseek_v3_cutedsl_4gpu.py"), - TestFile("entrypoints/http_server/test_abort_request.py"), - TestFile("hicache/test_disaggregation_hicache.py"), - TestFile("layers/attention/nsa/test_act_quant_triton.py"), - TestFile("layers/moe/test_moe_runners.py"), - TestFile("lora/test_chunked_sgmv_backend.py"), - TestFile("lora/test_lora_llama4.py"), - TestFile("lora/test_lora_cuda_graph.py"), - TestFile("lora/test_lora_qwen3_vl.py"), - TestFile("models/test_clip_models.py"), - TestFile("models/test_dummy_grok_models.py"), - TestFile("models/test_falcon_h1_models.py"), - TestFile("models/test_gme_qwen_models.py"), - TestFile("models/test_grok_models.py"), - TestFile("models/test_llama4_models.py"), - TestFile("models/test_mtp_models.py"), - TestFile("models/test_unsloth_models.py"), - TestFile("openai_server/features/test_cache_report.py"), - TestFile("openai_server/features/test_continuous_usage_stats.py"), - TestFile("openai_server/features/test_structural_tag.py"), - TestFile("quant/test_fp8_kvcache.py"), - TestFile("rl/test_verl_engine_2_gpu.py"), - TestFile("rl/test_verl_engine_4_gpu.py"), - TestFile("test_async_dynamic_batch_tokenizer.py"), - TestFile("test_async_mm_data_processor.py"), - TestFile("test_bench_one_batch.py"), - TestFile("test_bench_serving.py"), - TestFile("test_config_integration.py"), - TestFile("test_custom_allreduce.py"), - TestFile("test_deepseek_chat_templates.py"), - TestFile("test_double_sparsity.py"), - TestFile("test_eagle_infer_beta_dp_attention.py"), - TestFile("test_eval_accuracy_large.py"), - TestFile("test_expert_distribution.py"), - TestFile("test_expert_location_updater.py"), - TestFile("test_fim_completion.py"), - TestFile("test_forward_split_prefill.py"), - TestFile("test_get_weights_by_name.py"), - TestFile("test_gpt_oss_common.py"), - TestFile("test_health_check.py"), - TestFile("test_kv_events.py"), - TestFile("test_logprobs.py"), - TestFile("test_mla_tp.py"), - TestFile("test_modelopt.py"), - TestFile("test_modelopt_fp8kvcache.py"), - TestFile("test_models_from_modelscope.py"), - TestFile("test_moe_eval_accuracy_large.py"), - TestFile("test_mscclpp.py"), - TestFile("nightly/test_deepseek_v31_perf.py"), - TestFile("nightly/test_deepseek_v32_perf.py"), - TestFile("nightly/test_text_models_gsm8k_eval.py"), - TestFile("nightly/test_text_models_perf.py"), - TestFile("nightly/test_vlms_mmmu_eval.py"), - TestFile("nightly/test_vlms_perf.py"), - TestFile("nightly/test_vlms_piecewise_cuda_graph.py"), - TestFile("test_quick_allreduce.py"), - TestFile("test_sagemaker_server.py"), - TestFile("test_schedule_policy.py"), - TestFile("test_session_control.py"), - TestFile("test_srt_engine_with_quant_args.py"), - TestFile("test_tokenizer_batch_encode.py"), - TestFile("test_tokenizer_manager.py"), - TestFile("test_torch_flex_attention_backend.py"), - TestFile("test_torch_tp.py"), - TestFile("test_tracing.py"), - TestFile("test_triton_attention_rocm_mla.py"), - TestFile("test_triton_fused_moe.py"), - TestFile("test_triton_moe_wna16.py"), - TestFile("test_two_batch_overlap.py"), - TestFile("test_vertex_endpoint.py"), - # TestFile("test_vision_openai_server_a.py"), # TODO: Fix timeout - TestFile("test_vision_openai_server_common.py"), - TestFile("test_vlm_accuracy.py"), - TestFile("test_wave_attention_backend.py"), - TestFile("test_weight_version.py"), - TestFile("test_deepseek_v32_cp_single_node.py", 275), - ], } # Add AMD tests From be1af7a0abd52181efb47efbd87abef53a3b2e77 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Wed, 19 Nov 2025 23:44:15 -0800 Subject: [PATCH 02/12] Fix test/run_suite.py: Add missing stage labels and auto-partition support - Added all stage labels to LABEL_MAPPING (stage-a-test-2, stage-b-*, stage-c-*) - Added auto-partition function and command-line arguments - Stages with no registered tests will now pass with 0 tests instead of failing --- test/run_suite.py | 61 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/test/run_suite.py b/test/run_suite.py index 88e6f185f6bf..cf715732fb04 100644 --- a/test/run_suite.py +++ b/test/run_suite.py @@ -14,7 +14,16 @@ LABEL_MAPPING = { HWBackend.CPU: ["default"], HWBackend.AMD: ["stage-a-test-1"], - HWBackend.CUDA: ["stage-a-test-1"], + HWBackend.CUDA: [ + "stage-a-test-1", + "stage-a-test-2", + "stage-b-test-small-1-gpu", + "stage-b-test-large-1-gpu", + "stage-b-test-large-2-gpu", + "stage-c-test-large-1-gpu", + "stage-c-test-large-2-gpu", + "stage-c-test-large-4-gpu", + ], } @@ -30,11 +39,47 @@ def _filter_tests( return ret -def run_per_commit(hw: HWBackend, suite: str): +def auto_partition(files, rank, size): + """ + Partition files into size sublists with approximately equal sums of estimated times + using stable sorting, and return the partition for the specified rank. + """ + weights = [f.estimated_time for f in files] + + if not weights or size <= 0 or size > len(weights): + return [] + + # Create list of (weight, original_index) tuples + indexed_weights = [(w, -i) for i, w in enumerate(weights)] + # Stable sort in descending order by weight + indexed_weights = sorted(indexed_weights, reverse=True) + + # Extract original indices (negate back to positive) + indexed_weights = [(w, -i) for w, i in indexed_weights] + + # Initialize partitions and their sums + partitions = [[] for _ in range(size)] + sums = [0.0] * size + + # Greedy approach: assign each weight to partition with smallest current sum + for weight, idx in indexed_weights: + min_sum_idx = sums.index(min(sums)) + partitions[min_sum_idx].append(idx) + sums[min_sum_idx] += weight + + # Return the files corresponding to the indices in the specified rank's partition + indices = partitions[rank] + return [files[i] for i in indices] + + +def run_per_commit(hw: HWBackend, suite: str, auto_partition_id: int = None, auto_partition_size: int = None): files = glob.glob("per_commit/**/*.py", recursive=True) ci_tests = _filter_tests(collect_tests(files), hw, suite) test_files = [TestFile(t.filename, t.est_time) for t in ci_tests] + if auto_partition_size: + test_files = auto_partition(test_files, auto_partition_id, auto_partition_size) + run_unittest_files( test_files, timeout_per_file=1200, @@ -57,9 +102,19 @@ def main(): required=True, help="Test suite to run.", ) + parser.add_argument( + "--auto-partition-id", + type=int, + help="Use auto load balancing. The part id.", + ) + parser.add_argument( + "--auto-partition-size", + type=int, + help="Use auto load balancing. The number of parts.", + ) args = parser.parse_args() hw = HW_MAPPING[args.hw] - run_per_commit(hw, args.suite) + run_per_commit(hw, args.suite, args.auto_partition_id, args.auto_partition_size) if __name__ == "__main__": From 34fda15217c475f879b2a5bde3fdbac32a6e2a85 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Wed, 19 Nov 2025 23:46:57 -0800 Subject: [PATCH 03/12] Fix performance tests: Update paths from test/srt to test/manual Performance benchmark tests (test_bench_one_batch and test_bench_serving) were moved to test/manual/ but workflow still referenced test/srt/. Updated all performance-test-1-gpu-part-* jobs to use test/manual/. --- .github/workflows/pr-test.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index cdef3436ae2e..c0063567b1ec 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -720,38 +720,38 @@ jobs: - name: Benchmark single latency timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_bs1_small python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_bs1_default - name: Benchmark online latency timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_online_latency_default - name: Benchmark offline throughput timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_default - name: Benchmark offline throughput (Non-streaming, small batch size) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_non_stream_small_batch_size - name: Benchmark online latency (EAGLE) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_online_latency_eagle - name: Benchmark online latency (LoRA) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_lora_online_latency python3 -m unittest test_bench_serving.TestBenchServing.test_lora_online_latency_with_concurrent_adapter_updates @@ -781,31 +781,31 @@ jobs: - name: Benchmark offline throughput (w/o RadixAttention) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_without_radix_cache - name: Benchmark offline throughput (w/ Triton) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_with_triton_attention_backend - name: Benchmark offline throughput (w/ FP8) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_default_fp8 - name: Benchmark VLM offline throughput timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_vlm_offline_throughput - name: Benchmark VLM online latency timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_vlm_online_latency performance-test-1-gpu-part-3: @@ -834,25 +834,25 @@ jobs: - name: Benchmark Scores online latency and throughput timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_score_api_latency_throughput - name: Benchmark Scores online latency and throughput (batch size scaling) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_score_api_batch_scaling - name: Benchmark Embeddings online latency and throughput timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_latency_throughput - name: Benchmark Embeddings online latency and throughput (batch size scaling) timeout-minutes: 10 run: | - cd test/srt + cd test/manual python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_batch_scaling - name: Cleanup logs directory From 7dc708589cddc29b436fdf663e7b5cf97422aa18 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 00:04:52 -0800 Subject: [PATCH 04/12] Fix linting: Apply black formatting to test/run_suite.py --- test/run_suite.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/run_suite.py b/test/run_suite.py index cf715732fb04..3103741d2aa5 100644 --- a/test/run_suite.py +++ b/test/run_suite.py @@ -72,7 +72,12 @@ def auto_partition(files, rank, size): return [files[i] for i in indices] -def run_per_commit(hw: HWBackend, suite: str, auto_partition_id: int = None, auto_partition_size: int = None): +def run_per_commit( + hw: HWBackend, + suite: str, + auto_partition_id: int = None, + auto_partition_size: int = None, +): files = glob.glob("per_commit/**/*.py", recursive=True) ci_tests = _filter_tests(collect_tests(files), hw, suite) test_files = [TestFile(t.filename, t.est_time) for t in ci_tests] From 51e43831364710fb925c7a28ddec8fd80dc63f2c Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 00:52:30 -0800 Subject: [PATCH 05/12] Move bench tests back to test/srt/ and revert workflow paths - Moved test_bench_one_batch.py and test_bench_serving.py back to test/srt/ - Reverted all performance test workflow paths from test/manual to test/srt - These tests should stay in srt to avoid breaking sanity checks --- .github/workflows/pr-test.yml | 30 +- test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md | 396 +++++++++++++++++++ test/{manual => srt}/test_bench_one_batch.py | 0 test/{manual => srt}/test_bench_serving.py | 0 4 files changed, 411 insertions(+), 15 deletions(-) create mode 100644 test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md rename test/{manual => srt}/test_bench_one_batch.py (100%) rename test/{manual => srt}/test_bench_serving.py (100%) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index c0063567b1ec..cdef3436ae2e 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -720,38 +720,38 @@ jobs: - name: Benchmark single latency timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_bs1_small python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_bs1_default - name: Benchmark online latency timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_online_latency_default - name: Benchmark offline throughput timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_default - name: Benchmark offline throughput (Non-streaming, small batch size) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_non_stream_small_batch_size - name: Benchmark online latency (EAGLE) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_online_latency_eagle - name: Benchmark online latency (LoRA) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_lora_online_latency python3 -m unittest test_bench_serving.TestBenchServing.test_lora_online_latency_with_concurrent_adapter_updates @@ -781,31 +781,31 @@ jobs: - name: Benchmark offline throughput (w/o RadixAttention) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_without_radix_cache - name: Benchmark offline throughput (w/ Triton) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_with_triton_attention_backend - name: Benchmark offline throughput (w/ FP8) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_default_fp8 - name: Benchmark VLM offline throughput timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_vlm_offline_throughput - name: Benchmark VLM online latency timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_vlm_online_latency performance-test-1-gpu-part-3: @@ -834,25 +834,25 @@ jobs: - name: Benchmark Scores online latency and throughput timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_score_api_latency_throughput - name: Benchmark Scores online latency and throughput (batch size scaling) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_score_api_batch_scaling - name: Benchmark Embeddings online latency and throughput timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_latency_throughput - name: Benchmark Embeddings online latency and throughput (batch size scaling) timeout-minutes: 10 run: | - cd test/manual + cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_batch_scaling - name: Cleanup logs directory diff --git a/test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md b/test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md new file mode 100644 index 000000000000..d2afe806ed15 --- /dev/null +++ b/test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md @@ -0,0 +1,396 @@ +# Per-Commit-1-GPU Tests Migration Plan + +## Overview + +This document tracks the migration of all 122 tests from `per-commit-1-gpu` suite in `test/srt/run_suite.py` to the new `test/per_commit/` structure with registration decorators. + +**Total Tests**: 122 tests +**Total Estimated Runtime**: ~19,009 seconds (~5.3 hours) + +## Migration Strategy + +Each PR will: +1. Move tests for ONE feature from `test/srt/` to `test/per_commit/` +2. Add registration decorators to each moved test +3. Remove moved tests from `test/srt/run_suite.py` +4. Preserve original folder structure under `test/per_commit/` + +## Migration Order (from smallest/simplest to largest) + +1. **rotary_embedding** (1 test, 10s) - ✅ BEST START: Single test, already in subfolder +2. **debug_utils** (1 test, 15s) - Second best: Single test, clean separation +3. **cache** (3 tests, 170s) - Small, cohesive feature +4. **utils** (2 tests, 56s) - Small utility tests +5. **hicache** (2 tests, 520s) - Already in subfolder +6. **rl** (3 tests, 320s) - Already in subfolder +7. **runtime** (3 tests, 1040s) - Core runtime tests (abort, deterministic, retract) +8. **moe** (3 tests, 315s) - MoE-specific tests +9. **scheduler** (3 tests, 394s) - Scheduling tests +10. **tokenization** (3 tests, 385s) - Tokenization tests +11. **vision** (3 tests, 1370s) - Vision/VLM tests +12. **performance** (4 tests, 1344s) - Performance optimization tests +13. **layers/attention/mamba** (4 tests, 99s) - Already in subfolder structure +14. **openai_server/validation** (4 tests, 217s) - Already in subfolder +15. **sampling** (6 tests, 324s) - Sampling/decoding tests +16. **openai_server/features** (5 tests, 539s) - Already in subfolder +17. **quant** (6 tests, 266s) - Already in subfolder (quantization kernels) +18. **attention/backends** (6 tests, 1080s) - Attention backend tests +19. **attention/mla** (6 tests, 1605s) - MLA attention tests +20. **quantization** (6 tests, 468s) - Quantization tests (modelopt, fp8, torchao) +21. **observability** (6 tests, 343s) - Metrics, profiling, monitoring +22. **other** (6 tests, 904s) - Miscellaneous tests to categorize better +23. **lora** (6 tests, 1299s) - Already in subfolder +24. **openai_server/basic** (6 tests, 389s) - Already in subfolder +25. **speculative_decoding** (7 tests, 2039s) - EAGLE and speculative decoding +26. **openai_server/function_call** (2 tests, 180s) - Already in subfolder +27. **openai_server** (2 tests, 131s) - Root-level OpenAI server tests +28. **models** (13 tests, 3187s) - Model tests (longest) + +--- + +## Detailed Test Breakdown by Feature + +### 1. rotary_embedding (1 test, ~10s) +**Target**: `test/per_commit/rotary_embedding/` + +- `rotary_embedding/test_mrope.py` (10s) + +--- + +### 2. debug_utils (1 test, ~15s) +**Target**: `test/per_commit/debug_utils/` + +- `debug_utils/test_tensor_dump_forward_hook.py` (15s) + +--- + +### 3. cache (3 tests, ~170s) +**Target**: `test/per_commit/cache/` + +- `test_page_size.py` (60s) +- `test_radix_attention.py` (105s) +- `test_radix_cache_unit.py` (5s) + +--- + +### 4. utils (2 tests, ~56s) +**Target**: `test/per_commit/utils/` + +- `test_io_struct.py` (8s) +- `test_utils_update_weights.py` (48s) + +--- + +### 5. hicache (2 tests, ~520s) +**Target**: `test/per_commit/hicache/` + +- `hicache/test_hicache_storage.py` (127s) +- `hicache/test_hicache_variants.py` (393s) + +--- + +### 6. rl (3 tests, ~320s) +**Target**: `test/per_commit/rl/` + +- `rl/test_fp32_lm_head.py` (30s) +- `rl/test_update_weights_from_disk.py` (210s) +- `rl/test_update_weights_from_tensor.py` (80s) + +--- + +### 7. runtime (3 tests, ~1040s) +**Target**: `test/per_commit/runtime/` + +- `test_abort.py` (190s) +- `test_deterministic.py` (400s) +- `test_retract_decode.py` (450s) + +--- + +### 8. moe (3 tests, ~315s) +**Target**: `test/per_commit/moe/` + +- `test_fused_moe.py` (80s) +- `test_torch_compile_moe.py` (210s) +- `test_triton_moe_channel_fp8_kernel.py` (25s) + +--- + +### 9. scheduler (3 tests, ~394s) +**Target**: `test/per_commit/scheduler/` + +- `test_no_overlap_scheduler.py` (234s) +- `test_priority_scheduling.py` (130s) +- `test_request_queue_validation.py` (30s) + +--- + +### 10. tokenization (3 tests, ~385s) +**Target**: `test/per_commit/tokenization/` + +- `test_input_embeddings.py` (38s) +- `test_multi_tokenizer.py` (230s) +- `test_skip_tokenizer_init.py` (117s) + +--- + +### 11. vision (3 tests, ~1370s) +**Target**: `test/per_commit/vision/` + +- `test_vision_chunked_prefill.py` (170s) +- `test_vision_openai_server_a.py` (900s) +- `test_vlm_input_format.py` (300s) + +--- + +### 12. performance (4 tests, ~1344s) +**Target**: `test/per_commit/performance/` + +- `test_chunked_prefill.py` (410s) +- `test_no_chunked_prefill.py` (108s) +- `test_piecewise_cuda_graph.py` (750s) +- `test_torch_compile.py` (76s) + +--- + +### 13. layers/attention/mamba (4 tests, ~99s) +**Target**: `test/per_commit/layers/attention/mamba/` + +- `layers/attention/mamba/test_causal_conv1d.py` (25s) +- `layers/attention/mamba/test_mamba_ssm.py` (50s) +- `layers/attention/mamba/test_mamba_ssm_ssd.py` (20s) +- `test_mamba_unittest.py` (4s) + +--- + +### 14. openai_server/validation (4 tests, ~217s) +**Target**: `test/per_commit/openai_server/validation/` + +- `openai_server/validation/test_large_max_new_tokens.py` (41s) +- `openai_server/validation/test_matched_stop.py` (60s) +- `openai_server/validation/test_openai_server_ignore_eos.py` (85s) +- `openai_server/validation/test_request_length_validation.py` (31s) + +--- + +### 15. sampling (6 tests, ~324s) +**Target**: `test/per_commit/sampling/` + +- `test_constrained_decoding.py` (150s) +- `test_harmony_parser.py` (20s) +- `test_jinja_template_utils.py` (1s) +- `test_penalty.py` (82s) +- `test_pytorch_sampling_backend.py` (66s) +- `test_reasoning_parser.py` (5s) + +--- + +### 16. openai_server/features (5 tests, ~539s) +**Target**: `test/per_commit/openai_server/features/` + +- `openai_server/features/test_enable_thinking.py` (70s) +- `openai_server/features/test_json_mode.py` (120s) +- `openai_server/features/test_openai_server_ebnf.py` (20s) +- `openai_server/features/test_openai_server_hidden_states.py` (240s) +- `openai_server/features/test_reasoning_content.py` (89s) + +--- + +### 17. quant (6 tests, ~266s) +**Target**: `test/per_commit/quant/` + +- `quant/test_autoround.py` (60s) +- `quant/test_block_int8.py` (22s) +- `quant/test_fp8_kernel.py` (8s) +- `quant/test_int8_kernel.py` (8s) +- `quant/test_triton_scaled_mm.py` (8s) +- `quant/test_w8a8_quantization.py` (160s) + +--- + +### 18. attention/backends (6 tests, ~1080s) +**Target**: `test/per_commit/attention/backends/` + +- `test_fa3.py` (420s) +- `test_hybrid_attn_backend.py` (379s) +- `test_torch_native_attention_backend.py` (123s) +- `test_triton_attention_backend.py` (150s) +- `test_triton_attention_kernels.py` (4s) +- `test_triton_attention_kernels.py` (4s) *(duplicate entry)* + +--- + +### 19. attention/mla (6 tests, ~1605s) +**Target**: `test/per_commit/attention/mla/` + +- `test_flashmla.py` (230s) +- `test_mla.py` (180s) +- `test_mla_deepseek_v3.py` (500s) +- `test_mla_flashinfer.py` (302s) +- `test_mla_fp8.py` (93s) +- `test_mla_int8_deepseek_v3.py` (300s) + +--- + +### 20. quantization (6 tests, ~468s) +**Target**: `test/per_commit/quantization/` + +- `test_eval_fp8_accuracy.py` (303s) +- `test_fp8_utils.py` (5s) +- `test_modelopt_export.py` (30s) +- `test_modelopt_loader.py` (30s) +- `test_modelopt_loader.py` (30s) *(duplicate entry)* +- `test_torchao.py` (70s) + +--- + +### 21. observability (6 tests, ~343s) +**Target**: `test/per_commit/observability/` + +- `test_hidden_states.py` (55s) +- `test_metrics.py` (32s) +- `test_metrics_utils.py` (1s) +- `test_profile_merger.py` (60s) +- `test_profile_merger_http_api.py` (15s) +- `test_start_profile.py` (180s) + +--- + +### 22. other (6 tests, ~904s) +**Target**: `test/per_commit/other/` *(to be recategorized)* + +- `test_create_kvindices.py` (2s) +- `test_original_logprobs.py` (41s) +- `test_score_api.py` (310s) +- `test_srt_engine.py` (450s) +- `test_swa_unittest.py` (1s) +- `test_triton_sliding_window.py` (100s) + +--- + +### 23. lora (6 tests, ~1299s) +**Target**: `test/per_commit/lora/` + +- `lora/test_lora.py` (150s) +- `lora/test_lora_backend.py` (99s) +- `lora/test_lora_eviction.py` (240s) +- `lora/test_lora_spec_decoding.py` (150s) +- `lora/test_lora_update.py` (600s) +- `lora/test_multi_lora_backend.py` (60s) + +--- + +### 24. openai_server/basic (6 tests, ~389s) +**Target**: `test/per_commit/openai_server/basic/` + +- `openai_server/basic/test_openai_embedding.py` (79s) +- `openai_server/basic/test_openai_server.py` (270s) +- `openai_server/basic/test_protocol.py` (10s) +- `openai_server/basic/test_serving_chat.py` (10s) +- `openai_server/basic/test_serving_completions.py` (10s) +- `openai_server/basic/test_serving_embedding.py` (10s) + +--- + +### 25. speculative_decoding (7 tests, ~2039s) +**Target**: `test/per_commit/speculative_decoding/` + +- `test_build_eagle_tree.py` (8s) +- `test_eagle_infer_a.py` (750s) +- `test_eagle_infer_b.py` (750s) +- `test_eagle_infer_beta.py` (90s) +- `test_ngram_speculative_decoding.py` (290s) +- `test_speculative_registry.py` (1s) +- `test_standalone_speculative_decoding.py` (150s) + +--- + +### 26. openai_server/function_call (2 tests, ~180s) +**Target**: `test/per_commit/openai_server/function_call/` + +- `openai_server/function_call/test_openai_function_calling.py` (60s) +- `openai_server/function_call/test_tool_choice.py` (120s) + +--- + +### 27. openai_server (2 tests, ~131s) +**Target**: `test/per_commit/openai_server/` + +- `test_server_args.py` (1s) +- `test_srt_endpoint.py` (130s) + +--- + +### 28. models (13 tests, ~3187s) +**Target**: `test/per_commit/models/` + +- `models/test_compressed_tensors_models.py` (42s) +- `models/test_cross_encoder_models.py` (100s) +- `models/test_embedding_models.py` (73s) +- `models/test_encoder_embedding_models.py` (460s) +- `models/test_generation_models.py` (103s) +- `models/test_nvidia_nemotron_nano_v2.py` (160s) +- `models/test_qwen_models.py` (150s) +- `models/test_reward_models.py` (132s) +- `models/test_transformers_models.py` (320s) +- `models/test_vlm_models.py` (741s) +- `test_external_models.py` (155s) +- `test_gpt_oss_1gpu.py` (750s) +- `test_model_hooks.py` (1s) + +--- + +## Registration Decorator Pattern + +Each test should add the appropriate registration decorator at the top: + +```python +from sglang.test.ci.ci_register import register_cuda_ci + +register_cuda_ci(est_time=, suite="stage-b-test-small-1-gpu") + +import unittest +# ... rest of test +``` + +**Suite assignment guidelines:** +- Simple unit tests (< 60s, no model loading) → `stage-a-test-2` +- Small model tests → `stage-b-test-small-1-gpu` +- Large model tests → `stage-b-test-large-1-gpu` + +--- + +## Progress Tracker + +| # | Feature | Status | PR Link | Tests Migrated | Notes | +|---|---------|--------|---------|----------------|-------| +| 1 | rotary_embedding | ⏳ Pending | - | 0/1 | - | +| 2 | debug_utils | ⏳ Pending | - | 0/1 | - | +| 3 | cache | ⏳ Pending | - | 0/3 | - | +| 4 | utils | ⏳ Pending | - | 0/2 | - | +| 5 | hicache | ⏳ Pending | - | 0/2 | - | +| 6 | rl | ⏳ Pending | - | 0/3 | - | +| 7 | runtime | ⏳ Pending | - | 0/3 | - | +| 8 | moe | ⏳ Pending | - | 0/3 | - | +| 9 | scheduler | ⏳ Pending | - | 0/3 | - | +| 10 | tokenization | ⏳ Pending | - | 0/3 | - | +| 11 | vision | ⏳ Pending | - | 0/3 | - | +| 12 | performance | ⏳ Pending | - | 0/4 | - | +| 13 | layers/attention/mamba | ⏳ Pending | - | 0/4 | - | +| 14 | openai_server/validation | ⏳ Pending | - | 0/4 | - | +| 15 | sampling | ⏳ Pending | - | 0/6 | - | +| 16 | openai_server/features | ⏳ Pending | - | 0/5 | - | +| 17 | quant | ⏳ Pending | - | 0/6 | - | +| 18 | attention/backends | ⏳ Pending | - | 0/6 | - | +| 19 | attention/mla | ⏳ Pending | - | 0/6 | - | +| 20 | quantization | ⏳ Pending | - | 0/6 | - | +| 21 | observability | ⏳ Pending | - | 0/6 | - | +| 22 | other | ⏳ Pending | - | 0/6 | - | +| 23 | lora | ⏳ Pending | - | 0/6 | - | +| 24 | openai_server/basic | ⏳ Pending | - | 0/6 | - | +| 25 | speculative_decoding | ⏳ Pending | - | 0/7 | - | +| 26 | openai_server/function_call | ⏳ Pending | - | 0/2 | - | +| 27 | openai_server | ⏳ Pending | - | 0/2 | - | +| 28 | models | ⏳ Pending | - | 0/13 | - | + +**Total Progress**: 0/122 tests migrated (0%) diff --git a/test/manual/test_bench_one_batch.py b/test/srt/test_bench_one_batch.py similarity index 100% rename from test/manual/test_bench_one_batch.py rename to test/srt/test_bench_one_batch.py diff --git a/test/manual/test_bench_serving.py b/test/srt/test_bench_serving.py similarity index 100% rename from test/manual/test_bench_serving.py rename to test/srt/test_bench_serving.py From df1d7788c3f23a4bb59b4777819d5d01a4490d63 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 00:58:45 -0800 Subject: [PATCH 06/12] Add bench tests to __not_in_ci__ to pass sanity check test_bench_one_batch.py and test_bench_serving.py are run via performance-test-1-gpu-part-* jobs directly, not through run_suite.py, so they need to be in __not_in_ci__ to pass the sanity check. --- test/srt/run_suite.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 30f9885a1d87..8aa5511abcf1 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -229,6 +229,10 @@ TestFile("test_deepseek_v32_nsabackend.py", 600), ], "nightly-8-gpu-h20": [], + "__not_in_ci__": [ + TestFile("test_bench_one_batch.py"), + TestFile("test_bench_serving.py"), + ], } # Add AMD tests From ab4345ab685678b3bc7c5186bb6264054149903a Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 01:40:39 -0800 Subject: [PATCH 07/12] Move test_eval_accuracy_large.py back to test/srt/ This test is run directly via accuracy-test-1-gpu jobs in the workflow, not through run_suite.py. Added to __not_in_ci__ section. --- test/srt/run_suite.py | 1 + test/{manual => srt}/test_eval_accuracy_large.py | 0 2 files changed, 1 insertion(+) rename test/{manual => srt}/test_eval_accuracy_large.py (100%) diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 8aa5511abcf1..2095762c58bd 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -232,6 +232,7 @@ "__not_in_ci__": [ TestFile("test_bench_one_batch.py"), TestFile("test_bench_serving.py"), + TestFile("test_eval_accuracy_large.py"), ], } diff --git a/test/manual/test_eval_accuracy_large.py b/test/srt/test_eval_accuracy_large.py similarity index 100% rename from test/manual/test_eval_accuracy_large.py rename to test/srt/test_eval_accuracy_large.py From ee0013f985ab9e483ab4f58d2721737e274118cb Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 02:26:35 -0800 Subject: [PATCH 08/12] Move test_moe_eval_accuracy_large.py back to test/srt/ This test is run directly via CI jobs, not through run_suite.py. Added to __not_in_ci__ section. --- test/srt/run_suite.py | 1 + test/{manual => srt}/test_moe_eval_accuracy_large.py | 0 2 files changed, 1 insertion(+) rename test/{manual => srt}/test_moe_eval_accuracy_large.py (100%) diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 2095762c58bd..5ac4791ed04c 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -233,6 +233,7 @@ TestFile("test_bench_one_batch.py"), TestFile("test_bench_serving.py"), TestFile("test_eval_accuracy_large.py"), + TestFile("test_moe_eval_accuracy_large.py"), ], } diff --git a/test/manual/test_moe_eval_accuracy_large.py b/test/srt/test_moe_eval_accuracy_large.py similarity index 100% rename from test/manual/test_moe_eval_accuracy_large.py rename to test/srt/test_moe_eval_accuracy_large.py From 5ea924503057243624df8f67886cfb6b0568da59 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 02:55:47 -0800 Subject: [PATCH 09/12] Move test helper/common files back to test/srt/ Moved back: - test_gpt_oss_common.py (imported by test_gpt_oss_1gpu.py, test_gpt_oss_4gpu.py) - test_vision_openai_server_common.py (imported by test_vision_openai_server_a.py) These are helper/base class files that need to be in test/srt/ so they can be imported by tests running in CI. Added to __not_in_ci__ section. --- test/srt/run_suite.py | 2 ++ test/{manual => srt}/test_gpt_oss_common.py | 0 test/{manual => srt}/test_vision_openai_server_common.py | 0 3 files changed, 2 insertions(+) rename test/{manual => srt}/test_gpt_oss_common.py (100%) rename test/{manual => srt}/test_vision_openai_server_common.py (100%) diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 5ac4791ed04c..964b06ec3a88 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -233,7 +233,9 @@ TestFile("test_bench_one_batch.py"), TestFile("test_bench_serving.py"), TestFile("test_eval_accuracy_large.py"), + TestFile("test_gpt_oss_common.py"), TestFile("test_moe_eval_accuracy_large.py"), + TestFile("test_vision_openai_server_common.py"), ], } diff --git a/test/manual/test_gpt_oss_common.py b/test/srt/test_gpt_oss_common.py similarity index 100% rename from test/manual/test_gpt_oss_common.py rename to test/srt/test_gpt_oss_common.py diff --git a/test/manual/test_vision_openai_server_common.py b/test/srt/test_vision_openai_server_common.py similarity index 100% rename from test/manual/test_vision_openai_server_common.py rename to test/srt/test_vision_openai_server_common.py From 2e43e9703ce34399a596c02f8dda0fa26d241849 Mon Sep 17 00:00:00 2001 From: alisonshao Date: Thu, 20 Nov 2025 13:19:29 -0800 Subject: [PATCH 10/12] Revert test suite changes for separate PR Remove test suite changes from this PR to keep it focused on file movements only. The changes to pr-test.yml and test/run_suite.py will be submitted in a separate PR along with the reorganization plan documents. --- .github/workflows/pr-test.yml | 209 +---------- test/run_suite.py | 66 +--- test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md | 396 --------------------- test/srt/REORGANIZATION_PLAN.md | 68 ---- 4 files changed, 8 insertions(+), 731 deletions(-) delete mode 100644 test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md delete mode 100644 test/srt/REORGANIZATION_PLAN.md diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 25a93c3a119b..f314ae193191 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -55,18 +55,6 @@ jobs: - "python/*.toml" - ".github/workflows/pr-test.yml" - - name: Show filter results in summary (table) - run: | - { - echo "## Change Detection" - echo "" - echo "| Component | Changed |" - echo "|----------------|---------|" - echo "| main_package | ${{ steps.filter.outputs.main_package }} |" - echo "| sgl_kernel | ${{ steps.filter.outputs.sgl_kernel }} |" - echo "| multimodal_gen | ${{ steps.filter.outputs.multimodal_gen }} |" - } >> $GITHUB_STEP_SUMMARY - # =============================================== sgl-kernel ==================================================== sgl-kernel-build-wheels: @@ -327,191 +315,6 @@ jobs: run: | rm -rf python/sglang/logs || true - stage-a-test-2: - needs: [check-changes, stage-a-test-1, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 1-gpu-runner - env: - RUNNER_LABELS: 1-gpu-runner - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-a-test-2 - - stage-b-test-small-1-gpu: - needs: [check-changes, stage-a-test-2, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 1-gpu-runner - strategy: - fail-fast: false - matrix: - partition: [0, 1, 2, 3] - env: - RUNNER_LABELS: 1-gpu-runner - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-b-test-small-1-gpu --auto-partition-id ${{ matrix.partition }} --auto-partition-size 4 - - stage-b-test-large-1-gpu: - needs: [check-changes, stage-a-test-2, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 1-gpu-runner - env: - RUNNER_LABELS: 1-gpu-runner - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-b-test-large-1-gpu - - stage-b-test-large-2-gpu: - needs: [check-changes, stage-a-test-2, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 2-gpu-runner - env: - RUNNER_LABELS: 2-gpu-runner - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-b-test-large-2-gpu - - stage-c-test-large-1-gpu: - needs: [check-changes, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 1-gpu-runner - env: - RUNNER_LABELS: 1-gpu-runner - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-c-test-large-1-gpu - - stage-c-test-large-2-gpu: - needs: [check-changes, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, stage-b-test-large-2-gpu, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 2-gpu-runner - env: - RUNNER_LABELS: 2-gpu-runner - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-c-test-large-2-gpu - - stage-c-test-large-4-gpu: - needs: [check-changes, stage-b-test-small-1-gpu, stage-b-test-large-1-gpu, stage-b-test-large-2-gpu, sgl-kernel-build-wheels] - if: always() && !failure() && !cancelled() && - ((needs.check-changes.outputs.main_package == 'true') || (needs.check-changes.outputs.sgl_kernel == 'true')) - runs-on: 4-gpu-h100 - env: - RUNNER_LABELS: 4-gpu-h100 - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Download artifacts - if: needs.check-changes.outputs.sgl_kernel == 'true' - uses: actions/download-artifact@v4 - with: - path: sgl-kernel/dist/ - merge-multiple: true - pattern: wheel-python3.10-cuda12.9 - - name: Install dependencies - run: | - CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/ci_install_dependency.sh - - name: Run test - timeout-minutes: 30 - run: | - cd test - python3 run_suite.py --hw cuda --suite stage-c-test-large-4-gpu multimodal-gen-test: needs: [check-changes, sgl-kernel-build-wheels] @@ -867,6 +670,11 @@ jobs: cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_batch_scaling + - name: Cleanup logs directory + if: always() + run: | + rm -rf python/sglang/logs || true + performance-test-2-gpu: needs: [check-changes, unit-test-backend-2-gpu] if: always() && !failure() && !cancelled() && @@ -1127,13 +935,6 @@ jobs: multimodal-gen-test, stage-a-test-1, - stage-a-test-2, - stage-b-test-small-1-gpu, - stage-b-test-large-1-gpu, - stage-b-test-large-2-gpu, - stage-c-test-large-1-gpu, - stage-c-test-large-2-gpu, - stage-c-test-large-4-gpu, unit-test-backend-1-gpu, unit-test-backend-2-gpu, unit-test-backend-4-gpu, diff --git a/test/run_suite.py b/test/run_suite.py index 3103741d2aa5..88e6f185f6bf 100644 --- a/test/run_suite.py +++ b/test/run_suite.py @@ -14,16 +14,7 @@ LABEL_MAPPING = { HWBackend.CPU: ["default"], HWBackend.AMD: ["stage-a-test-1"], - HWBackend.CUDA: [ - "stage-a-test-1", - "stage-a-test-2", - "stage-b-test-small-1-gpu", - "stage-b-test-large-1-gpu", - "stage-b-test-large-2-gpu", - "stage-c-test-large-1-gpu", - "stage-c-test-large-2-gpu", - "stage-c-test-large-4-gpu", - ], + HWBackend.CUDA: ["stage-a-test-1"], } @@ -39,52 +30,11 @@ def _filter_tests( return ret -def auto_partition(files, rank, size): - """ - Partition files into size sublists with approximately equal sums of estimated times - using stable sorting, and return the partition for the specified rank. - """ - weights = [f.estimated_time for f in files] - - if not weights or size <= 0 or size > len(weights): - return [] - - # Create list of (weight, original_index) tuples - indexed_weights = [(w, -i) for i, w in enumerate(weights)] - # Stable sort in descending order by weight - indexed_weights = sorted(indexed_weights, reverse=True) - - # Extract original indices (negate back to positive) - indexed_weights = [(w, -i) for w, i in indexed_weights] - - # Initialize partitions and their sums - partitions = [[] for _ in range(size)] - sums = [0.0] * size - - # Greedy approach: assign each weight to partition with smallest current sum - for weight, idx in indexed_weights: - min_sum_idx = sums.index(min(sums)) - partitions[min_sum_idx].append(idx) - sums[min_sum_idx] += weight - - # Return the files corresponding to the indices in the specified rank's partition - indices = partitions[rank] - return [files[i] for i in indices] - - -def run_per_commit( - hw: HWBackend, - suite: str, - auto_partition_id: int = None, - auto_partition_size: int = None, -): +def run_per_commit(hw: HWBackend, suite: str): files = glob.glob("per_commit/**/*.py", recursive=True) ci_tests = _filter_tests(collect_tests(files), hw, suite) test_files = [TestFile(t.filename, t.est_time) for t in ci_tests] - if auto_partition_size: - test_files = auto_partition(test_files, auto_partition_id, auto_partition_size) - run_unittest_files( test_files, timeout_per_file=1200, @@ -107,19 +57,9 @@ def main(): required=True, help="Test suite to run.", ) - parser.add_argument( - "--auto-partition-id", - type=int, - help="Use auto load balancing. The part id.", - ) - parser.add_argument( - "--auto-partition-size", - type=int, - help="Use auto load balancing. The number of parts.", - ) args = parser.parse_args() hw = HW_MAPPING[args.hw] - run_per_commit(hw, args.suite, args.auto_partition_id, args.auto_partition_size) + run_per_commit(hw, args.suite) if __name__ == "__main__": diff --git a/test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md b/test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md deleted file mode 100644 index d2afe806ed15..000000000000 --- a/test/srt/PER_COMMIT_1GPU_MIGRATION_PLAN.md +++ /dev/null @@ -1,396 +0,0 @@ -# Per-Commit-1-GPU Tests Migration Plan - -## Overview - -This document tracks the migration of all 122 tests from `per-commit-1-gpu` suite in `test/srt/run_suite.py` to the new `test/per_commit/` structure with registration decorators. - -**Total Tests**: 122 tests -**Total Estimated Runtime**: ~19,009 seconds (~5.3 hours) - -## Migration Strategy - -Each PR will: -1. Move tests for ONE feature from `test/srt/` to `test/per_commit/` -2. Add registration decorators to each moved test -3. Remove moved tests from `test/srt/run_suite.py` -4. Preserve original folder structure under `test/per_commit/` - -## Migration Order (from smallest/simplest to largest) - -1. **rotary_embedding** (1 test, 10s) - ✅ BEST START: Single test, already in subfolder -2. **debug_utils** (1 test, 15s) - Second best: Single test, clean separation -3. **cache** (3 tests, 170s) - Small, cohesive feature -4. **utils** (2 tests, 56s) - Small utility tests -5. **hicache** (2 tests, 520s) - Already in subfolder -6. **rl** (3 tests, 320s) - Already in subfolder -7. **runtime** (3 tests, 1040s) - Core runtime tests (abort, deterministic, retract) -8. **moe** (3 tests, 315s) - MoE-specific tests -9. **scheduler** (3 tests, 394s) - Scheduling tests -10. **tokenization** (3 tests, 385s) - Tokenization tests -11. **vision** (3 tests, 1370s) - Vision/VLM tests -12. **performance** (4 tests, 1344s) - Performance optimization tests -13. **layers/attention/mamba** (4 tests, 99s) - Already in subfolder structure -14. **openai_server/validation** (4 tests, 217s) - Already in subfolder -15. **sampling** (6 tests, 324s) - Sampling/decoding tests -16. **openai_server/features** (5 tests, 539s) - Already in subfolder -17. **quant** (6 tests, 266s) - Already in subfolder (quantization kernels) -18. **attention/backends** (6 tests, 1080s) - Attention backend tests -19. **attention/mla** (6 tests, 1605s) - MLA attention tests -20. **quantization** (6 tests, 468s) - Quantization tests (modelopt, fp8, torchao) -21. **observability** (6 tests, 343s) - Metrics, profiling, monitoring -22. **other** (6 tests, 904s) - Miscellaneous tests to categorize better -23. **lora** (6 tests, 1299s) - Already in subfolder -24. **openai_server/basic** (6 tests, 389s) - Already in subfolder -25. **speculative_decoding** (7 tests, 2039s) - EAGLE and speculative decoding -26. **openai_server/function_call** (2 tests, 180s) - Already in subfolder -27. **openai_server** (2 tests, 131s) - Root-level OpenAI server tests -28. **models** (13 tests, 3187s) - Model tests (longest) - ---- - -## Detailed Test Breakdown by Feature - -### 1. rotary_embedding (1 test, ~10s) -**Target**: `test/per_commit/rotary_embedding/` - -- `rotary_embedding/test_mrope.py` (10s) - ---- - -### 2. debug_utils (1 test, ~15s) -**Target**: `test/per_commit/debug_utils/` - -- `debug_utils/test_tensor_dump_forward_hook.py` (15s) - ---- - -### 3. cache (3 tests, ~170s) -**Target**: `test/per_commit/cache/` - -- `test_page_size.py` (60s) -- `test_radix_attention.py` (105s) -- `test_radix_cache_unit.py` (5s) - ---- - -### 4. utils (2 tests, ~56s) -**Target**: `test/per_commit/utils/` - -- `test_io_struct.py` (8s) -- `test_utils_update_weights.py` (48s) - ---- - -### 5. hicache (2 tests, ~520s) -**Target**: `test/per_commit/hicache/` - -- `hicache/test_hicache_storage.py` (127s) -- `hicache/test_hicache_variants.py` (393s) - ---- - -### 6. rl (3 tests, ~320s) -**Target**: `test/per_commit/rl/` - -- `rl/test_fp32_lm_head.py` (30s) -- `rl/test_update_weights_from_disk.py` (210s) -- `rl/test_update_weights_from_tensor.py` (80s) - ---- - -### 7. runtime (3 tests, ~1040s) -**Target**: `test/per_commit/runtime/` - -- `test_abort.py` (190s) -- `test_deterministic.py` (400s) -- `test_retract_decode.py` (450s) - ---- - -### 8. moe (3 tests, ~315s) -**Target**: `test/per_commit/moe/` - -- `test_fused_moe.py` (80s) -- `test_torch_compile_moe.py` (210s) -- `test_triton_moe_channel_fp8_kernel.py` (25s) - ---- - -### 9. scheduler (3 tests, ~394s) -**Target**: `test/per_commit/scheduler/` - -- `test_no_overlap_scheduler.py` (234s) -- `test_priority_scheduling.py` (130s) -- `test_request_queue_validation.py` (30s) - ---- - -### 10. tokenization (3 tests, ~385s) -**Target**: `test/per_commit/tokenization/` - -- `test_input_embeddings.py` (38s) -- `test_multi_tokenizer.py` (230s) -- `test_skip_tokenizer_init.py` (117s) - ---- - -### 11. vision (3 tests, ~1370s) -**Target**: `test/per_commit/vision/` - -- `test_vision_chunked_prefill.py` (170s) -- `test_vision_openai_server_a.py` (900s) -- `test_vlm_input_format.py` (300s) - ---- - -### 12. performance (4 tests, ~1344s) -**Target**: `test/per_commit/performance/` - -- `test_chunked_prefill.py` (410s) -- `test_no_chunked_prefill.py` (108s) -- `test_piecewise_cuda_graph.py` (750s) -- `test_torch_compile.py` (76s) - ---- - -### 13. layers/attention/mamba (4 tests, ~99s) -**Target**: `test/per_commit/layers/attention/mamba/` - -- `layers/attention/mamba/test_causal_conv1d.py` (25s) -- `layers/attention/mamba/test_mamba_ssm.py` (50s) -- `layers/attention/mamba/test_mamba_ssm_ssd.py` (20s) -- `test_mamba_unittest.py` (4s) - ---- - -### 14. openai_server/validation (4 tests, ~217s) -**Target**: `test/per_commit/openai_server/validation/` - -- `openai_server/validation/test_large_max_new_tokens.py` (41s) -- `openai_server/validation/test_matched_stop.py` (60s) -- `openai_server/validation/test_openai_server_ignore_eos.py` (85s) -- `openai_server/validation/test_request_length_validation.py` (31s) - ---- - -### 15. sampling (6 tests, ~324s) -**Target**: `test/per_commit/sampling/` - -- `test_constrained_decoding.py` (150s) -- `test_harmony_parser.py` (20s) -- `test_jinja_template_utils.py` (1s) -- `test_penalty.py` (82s) -- `test_pytorch_sampling_backend.py` (66s) -- `test_reasoning_parser.py` (5s) - ---- - -### 16. openai_server/features (5 tests, ~539s) -**Target**: `test/per_commit/openai_server/features/` - -- `openai_server/features/test_enable_thinking.py` (70s) -- `openai_server/features/test_json_mode.py` (120s) -- `openai_server/features/test_openai_server_ebnf.py` (20s) -- `openai_server/features/test_openai_server_hidden_states.py` (240s) -- `openai_server/features/test_reasoning_content.py` (89s) - ---- - -### 17. quant (6 tests, ~266s) -**Target**: `test/per_commit/quant/` - -- `quant/test_autoround.py` (60s) -- `quant/test_block_int8.py` (22s) -- `quant/test_fp8_kernel.py` (8s) -- `quant/test_int8_kernel.py` (8s) -- `quant/test_triton_scaled_mm.py` (8s) -- `quant/test_w8a8_quantization.py` (160s) - ---- - -### 18. attention/backends (6 tests, ~1080s) -**Target**: `test/per_commit/attention/backends/` - -- `test_fa3.py` (420s) -- `test_hybrid_attn_backend.py` (379s) -- `test_torch_native_attention_backend.py` (123s) -- `test_triton_attention_backend.py` (150s) -- `test_triton_attention_kernels.py` (4s) -- `test_triton_attention_kernels.py` (4s) *(duplicate entry)* - ---- - -### 19. attention/mla (6 tests, ~1605s) -**Target**: `test/per_commit/attention/mla/` - -- `test_flashmla.py` (230s) -- `test_mla.py` (180s) -- `test_mla_deepseek_v3.py` (500s) -- `test_mla_flashinfer.py` (302s) -- `test_mla_fp8.py` (93s) -- `test_mla_int8_deepseek_v3.py` (300s) - ---- - -### 20. quantization (6 tests, ~468s) -**Target**: `test/per_commit/quantization/` - -- `test_eval_fp8_accuracy.py` (303s) -- `test_fp8_utils.py` (5s) -- `test_modelopt_export.py` (30s) -- `test_modelopt_loader.py` (30s) -- `test_modelopt_loader.py` (30s) *(duplicate entry)* -- `test_torchao.py` (70s) - ---- - -### 21. observability (6 tests, ~343s) -**Target**: `test/per_commit/observability/` - -- `test_hidden_states.py` (55s) -- `test_metrics.py` (32s) -- `test_metrics_utils.py` (1s) -- `test_profile_merger.py` (60s) -- `test_profile_merger_http_api.py` (15s) -- `test_start_profile.py` (180s) - ---- - -### 22. other (6 tests, ~904s) -**Target**: `test/per_commit/other/` *(to be recategorized)* - -- `test_create_kvindices.py` (2s) -- `test_original_logprobs.py` (41s) -- `test_score_api.py` (310s) -- `test_srt_engine.py` (450s) -- `test_swa_unittest.py` (1s) -- `test_triton_sliding_window.py` (100s) - ---- - -### 23. lora (6 tests, ~1299s) -**Target**: `test/per_commit/lora/` - -- `lora/test_lora.py` (150s) -- `lora/test_lora_backend.py` (99s) -- `lora/test_lora_eviction.py` (240s) -- `lora/test_lora_spec_decoding.py` (150s) -- `lora/test_lora_update.py` (600s) -- `lora/test_multi_lora_backend.py` (60s) - ---- - -### 24. openai_server/basic (6 tests, ~389s) -**Target**: `test/per_commit/openai_server/basic/` - -- `openai_server/basic/test_openai_embedding.py` (79s) -- `openai_server/basic/test_openai_server.py` (270s) -- `openai_server/basic/test_protocol.py` (10s) -- `openai_server/basic/test_serving_chat.py` (10s) -- `openai_server/basic/test_serving_completions.py` (10s) -- `openai_server/basic/test_serving_embedding.py` (10s) - ---- - -### 25. speculative_decoding (7 tests, ~2039s) -**Target**: `test/per_commit/speculative_decoding/` - -- `test_build_eagle_tree.py` (8s) -- `test_eagle_infer_a.py` (750s) -- `test_eagle_infer_b.py` (750s) -- `test_eagle_infer_beta.py` (90s) -- `test_ngram_speculative_decoding.py` (290s) -- `test_speculative_registry.py` (1s) -- `test_standalone_speculative_decoding.py` (150s) - ---- - -### 26. openai_server/function_call (2 tests, ~180s) -**Target**: `test/per_commit/openai_server/function_call/` - -- `openai_server/function_call/test_openai_function_calling.py` (60s) -- `openai_server/function_call/test_tool_choice.py` (120s) - ---- - -### 27. openai_server (2 tests, ~131s) -**Target**: `test/per_commit/openai_server/` - -- `test_server_args.py` (1s) -- `test_srt_endpoint.py` (130s) - ---- - -### 28. models (13 tests, ~3187s) -**Target**: `test/per_commit/models/` - -- `models/test_compressed_tensors_models.py` (42s) -- `models/test_cross_encoder_models.py` (100s) -- `models/test_embedding_models.py` (73s) -- `models/test_encoder_embedding_models.py` (460s) -- `models/test_generation_models.py` (103s) -- `models/test_nvidia_nemotron_nano_v2.py` (160s) -- `models/test_qwen_models.py` (150s) -- `models/test_reward_models.py` (132s) -- `models/test_transformers_models.py` (320s) -- `models/test_vlm_models.py` (741s) -- `test_external_models.py` (155s) -- `test_gpt_oss_1gpu.py` (750s) -- `test_model_hooks.py` (1s) - ---- - -## Registration Decorator Pattern - -Each test should add the appropriate registration decorator at the top: - -```python -from sglang.test.ci.ci_register import register_cuda_ci - -register_cuda_ci(est_time=, suite="stage-b-test-small-1-gpu") - -import unittest -# ... rest of test -``` - -**Suite assignment guidelines:** -- Simple unit tests (< 60s, no model loading) → `stage-a-test-2` -- Small model tests → `stage-b-test-small-1-gpu` -- Large model tests → `stage-b-test-large-1-gpu` - ---- - -## Progress Tracker - -| # | Feature | Status | PR Link | Tests Migrated | Notes | -|---|---------|--------|---------|----------------|-------| -| 1 | rotary_embedding | ⏳ Pending | - | 0/1 | - | -| 2 | debug_utils | ⏳ Pending | - | 0/1 | - | -| 3 | cache | ⏳ Pending | - | 0/3 | - | -| 4 | utils | ⏳ Pending | - | 0/2 | - | -| 5 | hicache | ⏳ Pending | - | 0/2 | - | -| 6 | rl | ⏳ Pending | - | 0/3 | - | -| 7 | runtime | ⏳ Pending | - | 0/3 | - | -| 8 | moe | ⏳ Pending | - | 0/3 | - | -| 9 | scheduler | ⏳ Pending | - | 0/3 | - | -| 10 | tokenization | ⏳ Pending | - | 0/3 | - | -| 11 | vision | ⏳ Pending | - | 0/3 | - | -| 12 | performance | ⏳ Pending | - | 0/4 | - | -| 13 | layers/attention/mamba | ⏳ Pending | - | 0/4 | - | -| 14 | openai_server/validation | ⏳ Pending | - | 0/4 | - | -| 15 | sampling | ⏳ Pending | - | 0/6 | - | -| 16 | openai_server/features | ⏳ Pending | - | 0/5 | - | -| 17 | quant | ⏳ Pending | - | 0/6 | - | -| 18 | attention/backends | ⏳ Pending | - | 0/6 | - | -| 19 | attention/mla | ⏳ Pending | - | 0/6 | - | -| 20 | quantization | ⏳ Pending | - | 0/6 | - | -| 21 | observability | ⏳ Pending | - | 0/6 | - | -| 22 | other | ⏳ Pending | - | 0/6 | - | -| 23 | lora | ⏳ Pending | - | 0/6 | - | -| 24 | openai_server/basic | ⏳ Pending | - | 0/6 | - | -| 25 | speculative_decoding | ⏳ Pending | - | 0/7 | - | -| 26 | openai_server/function_call | ⏳ Pending | - | 0/2 | - | -| 27 | openai_server | ⏳ Pending | - | 0/2 | - | -| 28 | models | ⏳ Pending | - | 0/13 | - | - -**Total Progress**: 0/122 tests migrated (0%) diff --git a/test/srt/REORGANIZATION_PLAN.md b/test/srt/REORGANIZATION_PLAN.md deleted file mode 100644 index e804a431092c..000000000000 --- a/test/srt/REORGANIZATION_PLAN.md +++ /dev/null @@ -1,68 +0,0 @@ -# Test Directory Reorganization Plan - -## Overview - -This PR moves all tests marked as "__not_in_ci__" from test/srt/ to test/manual/ for easier organization and review. It also updates the pr-test.yml CI configuration. - -## Changes Made - -### 1. Moved Manual Tests -- **77 tests** moved from test/srt/ to test/manual/ -- These were previously in the "__not_in_ci__" section of run_suite.py -- Tests are not run in CI and are kept for manual testing purposes -- Directory structure preserved (e.g., models/, lora/, nightly/, etc.) - -### 2. Updated CI Configuration -- Updated `.github/workflows/pr-test.yml` with improvements - -### 3. Cleaned Up run_suite.py -- Removed the "__not_in_ci__" section from test/srt/run_suite.py -- All manual tests are now in test/manual/ - -## Directory Structure - -``` -test/ -├── manual/ # ✅ NEW: Manual tests not run in CI -│ ├── ascend/ # Ascend-specific manual tests -│ ├── cpu/ # CPU manual tests -│ ├── debug_utils/ # Debug utilities -│ ├── entrypoints/ # Entrypoint tests -│ ├── hicache/ # HiCache tests -│ ├── layers/ # Layer-specific tests -│ ├── lora/ # LoRA manual tests -│ ├── models/ # Model manual tests -│ ├── nightly/ # Nightly performance tests -│ ├── openai_server/ # OpenAI server tests -│ ├── quant/ # Quantization tests -│ ├── rl/ # RL tests -│ └── test_*.py # Various manual tests -│ -└── srt/ # All CI tests remain here - ├── run_suite.py # Test runner (cleaned up) - └── ... (all other test files) -``` - -## Manual Tests Moved (77 tests) - -Tests moved to test/manual/: -- Ascend NPU tests (2) -- CPU communication tests (1) -- Debug utilities (1) -- Entrypoint tests (1) -- HiCache tests (1) -- Layer tests (2) -- LoRA tests (3) -- Model tests (7) -- Nightly performance tests (7) -- OpenAI server tests (3) -- Quantization tests (1) -- RL tests (2) -- Various other manual tests (46) - -## Benefits - -1. **Cleaner organization**: Manual tests clearly separated from CI tests -2. **Easier review**: No more "__not_in_ci__" section in run_suite.py -3. **Better structure**: test/manual/ directory clearly indicates purpose -4. **Simpler CI logic**: No special handling for "__not_in_ci__" tests From 9144ac637bf29d7f0c36a5b028d833e7a417c65a Mon Sep 17 00:00:00 2001 From: alisonshao <54658187+alisonshao@users.noreply.github.com> Date: Thu, 20 Nov 2025 13:26:32 -0800 Subject: [PATCH 11/12] revert changes in pr-test --- .github/workflows/pr-test.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index f314ae193191..8f951bfea12e 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -55,6 +55,18 @@ jobs: - "python/*.toml" - ".github/workflows/pr-test.yml" + - name: Show filter results in summary (table) + run: | + { + echo "## Change Detection" + echo "" + echo "| Component | Changed |" + echo "|----------------|---------|" + echo "| main_package | ${{ steps.filter.outputs.main_package }} |" + echo "| sgl_kernel | ${{ steps.filter.outputs.sgl_kernel }} |" + echo "| multimodal_gen | ${{ steps.filter.outputs.multimodal_gen }} |" + } >> $GITHUB_STEP_SUMMARY + # =============================================== sgl-kernel ==================================================== sgl-kernel-build-wheels: @@ -244,8 +256,6 @@ jobs: echo "All benchmark tests completed!" - # =============================================== multimodal_gen ==================================================== - # Adding a single CUDA13 smoke test to verify that the kernel builds and runs # TODO: Add back this test when it can pass on CI # cuda13-kernel-smoke-test: @@ -310,11 +320,6 @@ jobs: # temporarily put backend-independent cpu tests here python3 run_suite.py --hw cpu --suite default - - name: Cleanup logs directory - if: always() - run: | - rm -rf python/sglang/logs || true - multimodal-gen-test: needs: [check-changes, sgl-kernel-build-wheels] @@ -670,10 +675,6 @@ jobs: cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_batch_scaling - - name: Cleanup logs directory - if: always() - run: | - rm -rf python/sglang/logs || true performance-test-2-gpu: needs: [check-changes, unit-test-backend-2-gpu] From fe054e0bc6b48a19d0fafbf8a5ba6f6ed185429f Mon Sep 17 00:00:00 2001 From: alisonshao <54658187+alisonshao@users.noreply.github.com> Date: Thu, 20 Nov 2025 13:27:08 -0800 Subject: [PATCH 12/12] Update pr-test.yml --- .github/workflows/pr-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 8f951bfea12e..65991dc3aaa7 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -675,7 +675,6 @@ jobs: cd test/srt python3 -m unittest test_bench_serving.TestBenchServing.test_embeddings_api_batch_scaling - performance-test-2-gpu: needs: [check-changes, unit-test-backend-2-gpu] if: always() && !failure() && !cancelled() &&