Skip to content

Commit 5532e8a

Browse files
authored
[FD CLI] Add bench cli (#4160)
* add bench cli * Update test_main.py
1 parent 5e1f13b commit 5532e8a

File tree

11 files changed

+2890
-3
lines changed

11 files changed

+2890
-3
lines changed

benchmarks/benchmark_serving.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ def main(args: argparse.Namespace):
965965
parser.add_argument(
966966
"--backend",
967967
type=str,
968-
default="vllm",
968+
default="openai-chat",
969969
choices=list(ASYNC_REQUEST_FUNCS.keys()),
970970
)
971971
parser.add_argument(
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from fastdeploy.entrypoints.cli.benchmark.latency import BenchmarkLatencySubcommand
2+
from fastdeploy.entrypoints.cli.benchmark.serve import BenchmarkServingSubcommand
3+
4+
__all__: list[str] = [
5+
"BenchmarkLatencySubcommand",
6+
"BenchmarkServingSubcommand",
7+
]

fastdeploy/entrypoints/cli/benchmark/__init__.py

Whitespace-only changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""
2+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
"""
16+
17+
# This file is modified from https://github.com/vllm-project/vllm/blob/main/vllm/entrypoints/cli/benchmark/base.py
18+
19+
import argparse
20+
21+
from fastdeploy.entrypoints.cli.types import CLISubcommand
22+
23+
24+
class BenchmarkSubcommandBase(CLISubcommand):
25+
"""The base class of subcommands for vllm bench."""
26+
27+
help: str
28+
29+
@classmethod
30+
def add_cli_args(cls, parser: argparse.ArgumentParser) -> None:
31+
"""Add the CLI arguments to the parser."""
32+
raise NotImplementedError
33+
34+
@staticmethod
35+
def cmd(args: argparse.Namespace) -> None:
36+
"""Run the benchmark.
37+
38+
Args:
39+
args: The arguments to the command.
40+
"""
41+
raise NotImplementedError

0 commit comments

Comments
 (0)