[Misc] Simplify vllm bench cli subcommand implementation (#19948)

This commit is contained in:
Ye (Charlotte) Qi
2025-06-22 12:34:48 -04:00
committed by GitHub
parent c76a506bd6
commit 2c11a29f0b
6 changed files with 44 additions and 80 deletions
+4 -13
View File
@@ -4,27 +4,18 @@ import argparse
from vllm.benchmarks.throughput import add_cli_args, main
from vllm.entrypoints.cli.benchmark.base import BenchmarkSubcommandBase
from vllm.entrypoints.cli.types import CLISubcommand
class BenchmarkThroughputSubcommand(BenchmarkSubcommandBase):
""" The `throughput` subcommand for vllm bench. """
def __init__(self):
self.name = "throughput"
super().__init__()
name = "throughput"
help = "Benchmark offline inference throughput."
@property
def help(self) -> str:
return "Benchmark offline inference throughput."
def add_cli_args(self, parser: argparse.ArgumentParser) -> None:
@classmethod
def add_cli_args(cls, parser: argparse.ArgumentParser) -> None:
add_cli_args(parser)
@staticmethod
def cmd(args: argparse.Namespace) -> None:
main(args)
def cmd_init() -> list[CLISubcommand]:
return [BenchmarkThroughputSubcommand()]