Skip to content

Commit

Permalink
simplify bench_latency.py
Browse files Browse the repository at this point in the history
  • Loading branch information
merrymercy committed Sep 24, 2024
1 parent e6692bf commit 0aa2616
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
10 changes: 2 additions & 8 deletions python/sglang/bench_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,10 @@ def main(server_args, bench_args):


if __name__ == "__main__":
multiprocessing.set_start_method("spawn", force=True)

parser = argparse.ArgumentParser()
ServerArgs.add_cli_args(parser)
BenchArgs.add_cli_args(parser)
# For this script, model-path is not required
assert (
parser._actions[1].option_strings[0] == "--model-path"
), "options changed, this code need to be updated"
parser._actions[1].required = False
args = parser.parse_args()

server_args = ServerArgs.from_cli_args(args)
bench_args = BenchArgs.from_cli_args(args)

Expand All @@ -511,6 +503,8 @@ def main(server_args, bench_args):
format="%(message)s",
)

multiprocessing.set_start_method("spawn", force=True)

try:
main(server_args, bench_args)
except Exception as e:
Expand Down
6 changes: 0 additions & 6 deletions python/sglang/bench_server_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,7 @@ def run_benchmark(server_args: ServerArgs, bench_args: BenchArgs):
parser = argparse.ArgumentParser()
ServerArgs.add_cli_args(parser)
BenchArgs.add_cli_args(parser)
# For this script, model-path is not required
assert (
parser._actions[1].option_strings[0] == "--model-path"
), "options changed, this code need to be updated"
parser._actions[1].required = False
args = parser.parse_args()

server_args = ServerArgs.from_cli_args(args)
bench_args = BenchArgs.from_cli_args(args)

Expand Down

0 comments on commit 0aa2616

Please sign in to comment.