| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | import argparse |
| 4 | |
| 5 | from vllm.benchmarks.throughput import add_cli_args, main |
| 6 | from vllm.entrypoints.cli.benchmark.base import BenchmarkSubcommandBase |
| 7 | from vllm.utils.argparse_utils import FlexibleArgumentParser |
| 8 | |
| 9 | |
| 10 | class BenchmarkThroughputSubcommand(BenchmarkSubcommandBase): |
| 11 | """The `throughput` subcommand for `vllm bench`.""" |
| 12 | |
| 13 | name = "throughput" |
| 14 | help = "Benchmark offline inference throughput." |
| 15 | |
| 16 | @classmethod |
| 17 | def add_cli_args(cls, parser: FlexibleArgumentParser) -> None: |
| 18 | add_cli_args(parser) |
| 19 | |
| 20 | @staticmethod |
| 21 | def cmd(args: argparse.Namespace) -> None: |
| 22 | main(args) |