From 33373cbb12aff72f602ac11d71ba866e90177f8e Mon Sep 17 00:00:00 2001 From: Alex Tumanov Date: Tue, 23 Jun 2026 21:34:11 -0500 Subject: [PATCH] [misc] Move bench_serving into sglang.benchmark (#28996) --- python/sglang/auto_benchmark_lib.py | 2 +- python/sglang/{bench_serving.py => benchmark/serving.py} | 0 python/sglang/test/ascend/test_ascend_utils.py | 2 +- python/sglang/test/ci/ci_stress_utils.py | 2 +- python/sglang/test/kits/cache_hit_kit.py | 2 +- python/sglang/test/mock_model/utils.py | 2 +- python/sglang/test/test_utils.py | 2 +- test/manual/dsv4/test_dsv4_pro_mtp.py | 2 +- .../bench_fn/test_bench_serving_functionality.py | 2 +- .../bench_fn/test_bench_serving_reasoning_stream.py | 2 +- test/registered/bench_fn/test_benchmark_datasets_api.py | 8 ++++---- .../disaggregation/test_disaggregation_dp_attention.py | 2 +- .../jit/test_deepseek_v4_compress_state_runtime_shapes.py | 2 +- test/registered/scheduler/test_prefill_delayer.py | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) rename python/sglang/{bench_serving.py => benchmark/serving.py} (100%) diff --git a/python/sglang/auto_benchmark_lib.py b/python/sglang/auto_benchmark_lib.py index fe6d314ef..34a8cde74 100644 --- a/python/sglang/auto_benchmark_lib.py +++ b/python/sglang/auto_benchmark_lib.py @@ -1095,7 +1095,7 @@ def build_bench_command( command = [ sys.executable, "-m", - "sglang.bench_serving", + "sglang.benchmark.serving", "--backend", backend, "--base-url", diff --git a/python/sglang/bench_serving.py b/python/sglang/benchmark/serving.py similarity index 100% rename from python/sglang/bench_serving.py rename to python/sglang/benchmark/serving.py diff --git a/python/sglang/test/ascend/test_ascend_utils.py b/python/sglang/test/ascend/test_ascend_utils.py index ac503f4d1..7d13d5b62 100644 --- a/python/sglang/test/ascend/test_ascend_utils.py +++ b/python/sglang/test/ascend/test_ascend_utils.py @@ -18,7 +18,7 @@ import subprocess from types import SimpleNamespace from typing import Awaitable, Callable, NamedTuple, Optional -from sglang.bench_serving import run_benchmark +from sglang.benchmark.serving import run_benchmark from sglang.srt.utils import kill_process_tree from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, diff --git a/python/sglang/test/ci/ci_stress_utils.py b/python/sglang/test/ci/ci_stress_utils.py index 71542471a..942719da5 100644 --- a/python/sglang/test/ci/ci_stress_utils.py +++ b/python/sglang/test/ci/ci_stress_utils.py @@ -67,7 +67,7 @@ class StressTestRunner: command = [ "python3", "-m", - "sglang.bench_serving", + "sglang.benchmark.serving", "--backend", "sglang-oai", "--base-url", diff --git a/python/sglang/test/kits/cache_hit_kit.py b/python/sglang/test/kits/cache_hit_kit.py index d5117989e..c7202d833 100644 --- a/python/sglang/test/kits/cache_hit_kit.py +++ b/python/sglang/test/kits/cache_hit_kit.py @@ -5,8 +5,8 @@ import time import aiohttp import requests -from sglang.bench_serving import RequestFuncOutput from sglang.benchmark.datasets.random import sample_random_requests +from sglang.benchmark.serving import RequestFuncOutput from sglang.benchmark.utils import get_tokenizer, remove_prefix AIOHTTP_TIMEOUT = aiohttp.ClientTimeout(total=20 * 60 * 60) diff --git a/python/sglang/test/mock_model/utils.py b/python/sglang/test/mock_model/utils.py index 60888249a..65cb2dbdc 100644 --- a/python/sglang/test/mock_model/utils.py +++ b/python/sglang/test/mock_model/utils.py @@ -5,7 +5,7 @@ import subprocess from dataclasses import dataclass from typing import Any, Sequence -from sglang.bench_serving import run_benchmark +from sglang.benchmark.serving import run_benchmark from sglang.srt.utils import kill_process_tree from sglang.test.test_utils import ( DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, diff --git a/python/sglang/test/test_utils.py b/python/sglang/test/test_utils.py index 91406f717..dbbc648b9 100644 --- a/python/sglang/test/test_utils.py +++ b/python/sglang/test/test_utils.py @@ -31,7 +31,7 @@ import torch import torch.nn.functional as F from PIL import Image -from sglang.bench_serving import run_benchmark +from sglang.benchmark.serving import run_benchmark from sglang.global_config import global_config from sglang.srt.environ import envs from sglang.srt.utils import ( diff --git a/test/manual/dsv4/test_dsv4_pro_mtp.py b/test/manual/dsv4/test_dsv4_pro_mtp.py index 3b066b09c..9338dba0d 100644 --- a/test/manual/dsv4/test_dsv4_pro_mtp.py +++ b/test/manual/dsv4/test_dsv4_pro_mtp.py @@ -22,7 +22,7 @@ import requests from sglang.bench_one_batch_server import BenchArgs as OneBatchBenchArgs from sglang.bench_one_batch_server import run_benchmark as run_one_batch_benchmark -from sglang.bench_serving import run_benchmark as run_serving_benchmark +from sglang.benchmark.serving import run_benchmark as run_serving_benchmark from sglang.srt.server_args import ServerArgs from sglang.srt.utils import kill_process_tree from sglang.test.test_utils import ( diff --git a/test/registered/bench_fn/test_bench_serving_functionality.py b/test/registered/bench_fn/test_bench_serving_functionality.py index 4eaa74a9c..4f0126a52 100644 --- a/test/registered/bench_fn/test_bench_serving_functionality.py +++ b/test/registered/bench_fn/test_bench_serving_functionality.py @@ -6,7 +6,7 @@ import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from pathlib import Path -from sglang.bench_serving import run_benchmark +from sglang.benchmark.serving import run_benchmark from sglang.benchmark.utils import parse_custom_headers from sglang.srt.constants import HEALTH_CHECK_RID_PREFIX from sglang.srt.utils import kill_process_tree diff --git a/test/registered/bench_fn/test_bench_serving_reasoning_stream.py b/test/registered/bench_fn/test_bench_serving_reasoning_stream.py index 585d08d92..ec00e3b9b 100644 --- a/test/registered/bench_fn/test_bench_serving_reasoning_stream.py +++ b/test/registered/bench_fn/test_bench_serving_reasoning_stream.py @@ -16,7 +16,7 @@ import unittest from argparse import Namespace from http.server import BaseHTTPRequestHandler, HTTPServer -from sglang.bench_serving import ( +from sglang.benchmark.serving import ( RequestFuncInput, async_request_openai_chat_completions, calculate_metrics, diff --git a/test/registered/bench_fn/test_benchmark_datasets_api.py b/test/registered/bench_fn/test_benchmark_datasets_api.py index 0e1a0f816..46e5110e9 100644 --- a/test/registered/bench_fn/test_benchmark_datasets_api.py +++ b/test/registered/bench_fn/test_benchmark_datasets_api.py @@ -985,7 +985,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase): # flags with the rank-based Zipf formula and the alpha constraint, # and argparse rejects an unknown distribution choice. help_res = subprocess.run( - [sys.executable, "-m", "sglang.bench_serving", "--help"], + [sys.executable, "-m", "sglang.benchmark.serving", "--help"], capture_output=True, text=True, timeout=90, @@ -1005,7 +1005,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase): [ sys.executable, "-m", - "sglang.bench_serving", + "sglang.benchmark.serving", "--dataset-name", "generated-shared-prefix", "--gsp-group-distribution", @@ -1026,7 +1026,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase): [ sys.executable, "-m", - "sglang.bench_serving", + "sglang.benchmark.serving", "--dataset-name", "generated-shared-prefix", "--gsp-group-distribution", @@ -1061,7 +1061,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase): [ sys.executable, "-m", - "sglang.bench_serving", + "sglang.benchmark.serving", "--dataset-name", "generated-shared-prefix", "--gsp-group-distribution", diff --git a/test/registered/disaggregation/test_disaggregation_dp_attention.py b/test/registered/disaggregation/test_disaggregation_dp_attention.py index a9662130c..7438e04f4 100644 --- a/test/registered/disaggregation/test_disaggregation_dp_attention.py +++ b/test/registered/disaggregation/test_disaggregation_dp_attention.py @@ -1,7 +1,7 @@ import unittest from types import SimpleNamespace -from sglang.bench_serving import run_benchmark +from sglang.benchmark.serving import run_benchmark from sglang.srt.environ import envs from sglang.test.ci.ci_register import register_cuda_ci from sglang.test.run_eval import run_eval diff --git a/test/registered/jit/test_deepseek_v4_compress_state_runtime_shapes.py b/test/registered/jit/test_deepseek_v4_compress_state_runtime_shapes.py index 11e01dff3..568238671 100644 --- a/test/registered/jit/test_deepseek_v4_compress_state_runtime_shapes.py +++ b/test/registered/jit/test_deepseek_v4_compress_state_runtime_shapes.py @@ -59,7 +59,7 @@ # # Workload for the service-level scenario: # HF_ENDPOINT=https://hf-mirror.com \ -# python3 -m sglang.bench_serving \ +# python3 -m sglang.benchmark.serving \ # --host localhost \ # --port 8080 \ # --model /data00/models/DeepSeek-V4-Flash \ diff --git a/test/registered/scheduler/test_prefill_delayer.py b/test/registered/scheduler/test_prefill_delayer.py index 1bc2b9cb9..58074fbce 100644 --- a/test/registered/scheduler/test_prefill_delayer.py +++ b/test/registered/scheduler/test_prefill_delayer.py @@ -11,7 +11,7 @@ import openai import requests import torch -from sglang.bench_serving import run_benchmark +from sglang.benchmark.serving import run_benchmark from sglang.srt.managers.prefill_delayer import PrefillDelayer from sglang.srt.utils import kill_process_tree from sglang.test.ci.ci_register import register_cuda_ci