[misc] Move bench_serving into sglang.benchmark (#28996)
This commit is contained in:
@@ -1095,7 +1095,7 @@ def build_bench_command(
|
|||||||
command = [
|
command = [
|
||||||
sys.executable,
|
sys.executable,
|
||||||
"-m",
|
"-m",
|
||||||
"sglang.bench_serving",
|
"sglang.benchmark.serving",
|
||||||
"--backend",
|
"--backend",
|
||||||
backend,
|
backend,
|
||||||
"--base-url",
|
"--base-url",
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import subprocess
|
|||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from typing import Awaitable, Callable, NamedTuple, Optional
|
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.srt.utils import kill_process_tree
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class StressTestRunner:
|
|||||||
command = [
|
command = [
|
||||||
"python3",
|
"python3",
|
||||||
"-m",
|
"-m",
|
||||||
"sglang.bench_serving",
|
"sglang.benchmark.serving",
|
||||||
"--backend",
|
"--backend",
|
||||||
"sglang-oai",
|
"sglang-oai",
|
||||||
"--base-url",
|
"--base-url",
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import time
|
|||||||
import aiohttp
|
import aiohttp
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from sglang.bench_serving import RequestFuncOutput
|
|
||||||
from sglang.benchmark.datasets.random import sample_random_requests
|
from sglang.benchmark.datasets.random import sample_random_requests
|
||||||
|
from sglang.benchmark.serving import RequestFuncOutput
|
||||||
from sglang.benchmark.utils import get_tokenizer, remove_prefix
|
from sglang.benchmark.utils import get_tokenizer, remove_prefix
|
||||||
|
|
||||||
AIOHTTP_TIMEOUT = aiohttp.ClientTimeout(total=20 * 60 * 60)
|
AIOHTTP_TIMEOUT = aiohttp.ClientTimeout(total=20 * 60 * 60)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import subprocess
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, Sequence
|
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.srt.utils import kill_process_tree
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import torch
|
|||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from PIL import Image
|
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.global_config import global_config
|
||||||
from sglang.srt.environ import envs
|
from sglang.srt.environ import envs
|
||||||
from sglang.srt.utils import (
|
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 BenchArgs as OneBatchBenchArgs
|
||||||
from sglang.bench_one_batch_server import run_benchmark as run_one_batch_benchmark
|
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.server_args import ServerArgs
|
||||||
from sglang.srt.utils import kill_process_tree
|
from sglang.srt.utils import kill_process_tree
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import unittest
|
|||||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||||
from pathlib import Path
|
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.benchmark.utils import parse_custom_headers
|
||||||
from sglang.srt.constants import HEALTH_CHECK_RID_PREFIX
|
from sglang.srt.constants import HEALTH_CHECK_RID_PREFIX
|
||||||
from sglang.srt.utils import kill_process_tree
|
from sglang.srt.utils import kill_process_tree
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import unittest
|
|||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||||
|
|
||||||
from sglang.bench_serving import (
|
from sglang.benchmark.serving import (
|
||||||
RequestFuncInput,
|
RequestFuncInput,
|
||||||
async_request_openai_chat_completions,
|
async_request_openai_chat_completions,
|
||||||
calculate_metrics,
|
calculate_metrics,
|
||||||
|
|||||||
@@ -985,7 +985,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase):
|
|||||||
# flags with the rank-based Zipf formula and the alpha constraint,
|
# flags with the rank-based Zipf formula and the alpha constraint,
|
||||||
# and argparse rejects an unknown distribution choice.
|
# and argparse rejects an unknown distribution choice.
|
||||||
help_res = subprocess.run(
|
help_res = subprocess.run(
|
||||||
[sys.executable, "-m", "sglang.bench_serving", "--help"],
|
[sys.executable, "-m", "sglang.benchmark.serving", "--help"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
timeout=90,
|
timeout=90,
|
||||||
@@ -1005,7 +1005,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase):
|
|||||||
[
|
[
|
||||||
sys.executable,
|
sys.executable,
|
||||||
"-m",
|
"-m",
|
||||||
"sglang.bench_serving",
|
"sglang.benchmark.serving",
|
||||||
"--dataset-name",
|
"--dataset-name",
|
||||||
"generated-shared-prefix",
|
"generated-shared-prefix",
|
||||||
"--gsp-group-distribution",
|
"--gsp-group-distribution",
|
||||||
@@ -1026,7 +1026,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase):
|
|||||||
[
|
[
|
||||||
sys.executable,
|
sys.executable,
|
||||||
"-m",
|
"-m",
|
||||||
"sglang.bench_serving",
|
"sglang.benchmark.serving",
|
||||||
"--dataset-name",
|
"--dataset-name",
|
||||||
"generated-shared-prefix",
|
"generated-shared-prefix",
|
||||||
"--gsp-group-distribution",
|
"--gsp-group-distribution",
|
||||||
@@ -1061,7 +1061,7 @@ class TestBenchmarkDatasetsAPI(unittest.TestCase):
|
|||||||
[
|
[
|
||||||
sys.executable,
|
sys.executable,
|
||||||
"-m",
|
"-m",
|
||||||
"sglang.bench_serving",
|
"sglang.benchmark.serving",
|
||||||
"--dataset-name",
|
"--dataset-name",
|
||||||
"generated-shared-prefix",
|
"generated-shared-prefix",
|
||||||
"--gsp-group-distribution",
|
"--gsp-group-distribution",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from types import SimpleNamespace
|
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.srt.environ import envs
|
||||||
from sglang.test.ci.ci_register import register_cuda_ci
|
from sglang.test.ci.ci_register import register_cuda_ci
|
||||||
from sglang.test.run_eval import run_eval
|
from sglang.test.run_eval import run_eval
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
#
|
#
|
||||||
# Workload for the service-level scenario:
|
# Workload for the service-level scenario:
|
||||||
# HF_ENDPOINT=https://hf-mirror.com \
|
# HF_ENDPOINT=https://hf-mirror.com \
|
||||||
# python3 -m sglang.bench_serving \
|
# python3 -m sglang.benchmark.serving \
|
||||||
# --host localhost \
|
# --host localhost \
|
||||||
# --port 8080 \
|
# --port 8080 \
|
||||||
# --model /data00/models/DeepSeek-V4-Flash \
|
# --model /data00/models/DeepSeek-V4-Flash \
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import openai
|
|||||||
import requests
|
import requests
|
||||||
import torch
|
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.managers.prefill_delayer import PrefillDelayer
|
||||||
from sglang.srt.utils import kill_process_tree
|
from sglang.srt.utils import kill_process_tree
|
||||||
from sglang.test.ci.ci_register import register_cuda_ci
|
from sglang.test.ci.ci_register import register_cuda_ci
|
||||||
|
|||||||
Reference in New Issue
Block a user