[misc] Add sglang.bench_offline_throughput deprecation shim (#29085)
This commit is contained in:
@@ -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()
|
||||||
@@ -15,7 +15,7 @@ warnings.warn(
|
|||||||
"release; use `sglang.benchmark.one_batch` instead "
|
"release; use `sglang.benchmark.one_batch` instead "
|
||||||
"(e.g. `python -m sglang.benchmark.one_batch`).",
|
"(e.g. `python -m sglang.benchmark.one_batch`).",
|
||||||
DeprecationWarning,
|
DeprecationWarning,
|
||||||
stacklevel=2,
|
stacklevel=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ def throughput_test(
|
|||||||
# Parse args
|
# Parse args
|
||||||
extra_request_body = {}
|
extra_request_body = {}
|
||||||
if bench_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
|
# Read dataset
|
||||||
input_requests = get_dataset(bench_args, tokenizer)
|
input_requests = get_dataset(bench_args, tokenizer)
|
||||||
@@ -504,7 +504,7 @@ def throughput_test(
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def cli_main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
ServerArgs.add_cli_args(parser)
|
ServerArgs.add_cli_args(parser)
|
||||||
BenchArgs.add_cli_args(parser)
|
BenchArgs.add_cli_args(parser)
|
||||||
@@ -541,3 +541,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
while bench_args.do_not_exit:
|
while bench_args.do_not_exit:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
cli_main()
|
||||||
|
|||||||
Reference in New Issue
Block a user