Skip to content

vllm.entrypoints.cli.download_kernels

The download-kernels subcommand for the vLLM CLI.

Installs the precompiled kernels that vLLM's dependencies would otherwise download or compile at startup. Run it after installing or upgrading vLLM:

vllm download-kernels

Classes:

DownloadKernelsSubcommand

Bases: CLISubcommand

The download-kernels subcommand for the vLLM CLI.

Source code in vllm/entrypoints/cli/download_kernels.py
class DownloadKernelsSubcommand(CLISubcommand):
    """The `download-kernels` subcommand for the vLLM CLI."""

    name = "download-kernels"

    @staticmethod
    def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
        parser.add_argument(
            "--dry-run",
            action="store_true",
            help="Print the install commands without running them.",
        )
        return parser

    @staticmethod
    def cmd(args: argparse.Namespace) -> None:
        sys.exit(_download_flashinfer_kernels(args.dry_run))

    def subparser_init(
        self, subparsers: argparse._SubParsersAction
    ) -> FlexibleArgumentParser:
        parser = subparsers.add_parser(
            self.name,
            help="Install precompiled kernels for faster startup.",
            description=(
                "Install the precompiled kernels that vLLM's dependencies would "
                "otherwise download or compile at startup. Run it after "
                "installing or upgrading vLLM."
            ),
            usage="vllm download-kernels [--dry-run]",
        )
        return DownloadKernelsSubcommand.add_cli_args(parser)