[misc] Add sglang.bench_offline_throughput deprecation shim (#29085)

This commit is contained in:
Liangsheng Yin
2026-06-23 18:39:58 -07:00
committed by GitHub
parent b448b08401
commit f76c6c95be
3 changed files with 30 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
"""Deprecated import path for ``sglang.benchmark.offline_throughput``.
``python -m sglang.bench_offline_throughput`` and
``from sglang.bench_offline_throughput import ...`` still work, but the
implementation now lives in ``sglang.benchmark.offline_throughput``.
Update references to the new path.
"""
import warnings
from sglang.benchmark.offline_throughput import * # noqa: F401,F403
from sglang.benchmark.offline_throughput import cli_main
warnings.warn(
"`sglang.bench_offline_throughput` is deprecated and will be removed in a "
"future release; use `sglang.benchmark.offline_throughput` instead "
"(e.g. `python -m sglang.benchmark.offline_throughput`).",
DeprecationWarning,
stacklevel=1,
)
if __name__ == "__main__":
cli_main()
+1 -1
View File
@@ -15,7 +15,7 @@ warnings.warn(
"release; use `sglang.benchmark.one_batch` instead "
"(e.g. `python -m sglang.benchmark.one_batch`).",
DeprecationWarning,
stacklevel=2,
stacklevel=1,
)
if __name__ == "__main__":
@@ -418,7 +418,7 @@ def throughput_test(
# Parse args
extra_request_body = {}
if bench_args.extra_request_body:
extra_request_body = json.loads(args.extra_request_body)
extra_request_body = json.loads(bench_args.extra_request_body)
# Read dataset
input_requests = get_dataset(bench_args, tokenizer)
@@ -504,7 +504,7 @@ def throughput_test(
return result
if __name__ == "__main__":
def cli_main():
parser = argparse.ArgumentParser()
ServerArgs.add_cli_args(parser)
BenchArgs.add_cli_args(parser)
@@ -541,3 +541,7 @@ if __name__ == "__main__":
while bench_args.do_not_exit:
pass
if __name__ == "__main__":
cli_main()