[misc] Move bench_serving into sglang.benchmark (#28996)
This commit is contained in:
@@ -1095,7 +1095,7 @@ def build_bench_command(
|
||||
command = [
|
||||
sys.executable,
|
||||
"-m",
|
||||
"sglang.bench_serving",
|
||||
"sglang.benchmark.serving",
|
||||
"--backend",
|
||||
backend,
|
||||
"--base-url",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -67,7 +67,7 @@ class StressTestRunner:
|
||||
command = [
|
||||
"python3",
|
||||
"-m",
|
||||
"sglang.bench_serving",
|
||||
"sglang.benchmark.serving",
|
||||
"--backend",
|
||||
"sglang-oai",
|
||||
"--base-url",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user