[Misc] add collect_env to cli and docker image (#16759)
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
This commit is contained in:
parent
e78587a64c
commit
7bdfd29a35
2
.github/ISSUE_TEMPLATE/200-installation.yml
vendored
2
.github/ISSUE_TEMPLATE/200-installation.yml
vendored
@ -14,7 +14,7 @@ body:
|
|||||||
description: |
|
description: |
|
||||||
Please run the following and paste the output below.
|
Please run the following and paste the output below.
|
||||||
```sh
|
```sh
|
||||||
wget https://raw.githubusercontent.com/vllm-project/vllm/main/collect_env.py
|
wget https://raw.githubusercontent.com/vllm-project/vllm/main/vllm/collect_env.py
|
||||||
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
||||||
python collect_env.py
|
python collect_env.py
|
||||||
```
|
```
|
||||||
|
2
.github/ISSUE_TEMPLATE/300-usage.yml
vendored
2
.github/ISSUE_TEMPLATE/300-usage.yml
vendored
@ -14,7 +14,7 @@ body:
|
|||||||
description: |
|
description: |
|
||||||
Please run the following and paste the output below.
|
Please run the following and paste the output below.
|
||||||
```sh
|
```sh
|
||||||
wget https://raw.githubusercontent.com/vllm-project/vllm/main/collect_env.py
|
wget https://raw.githubusercontent.com/vllm-project/vllm/main/vllm/collect_env.py
|
||||||
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
||||||
python collect_env.py
|
python collect_env.py
|
||||||
```
|
```
|
||||||
|
2
.github/ISSUE_TEMPLATE/400-bug-report.yml
vendored
2
.github/ISSUE_TEMPLATE/400-bug-report.yml
vendored
@ -14,7 +14,7 @@ body:
|
|||||||
description: |
|
description: |
|
||||||
Please run the following and paste the output below.
|
Please run the following and paste the output below.
|
||||||
```sh
|
```sh
|
||||||
wget https://raw.githubusercontent.com/vllm-project/vllm/main/collect_env.py
|
wget https://raw.githubusercontent.com/vllm-project/vllm/main/vllm/collect_env.py
|
||||||
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
||||||
python collect_env.py
|
python collect_env.py
|
||||||
```
|
```
|
||||||
|
@ -35,7 +35,7 @@ body:
|
|||||||
description: |
|
description: |
|
||||||
Please run the following and paste the output below.
|
Please run the following and paste the output below.
|
||||||
```sh
|
```sh
|
||||||
wget https://raw.githubusercontent.com/vllm-project/vllm/main/collect_env.py
|
wget https://raw.githubusercontent.com/vllm-project/vllm/main/vllm/collect_env.py
|
||||||
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
# For security purposes, please feel free to check the contents of collect_env.py before running it.
|
||||||
python collect_env.py
|
python collect_env.py
|
||||||
```
|
```
|
||||||
|
@ -241,6 +241,7 @@ if [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
|
|||||||
fi
|
fi
|
||||||
COPY examples examples
|
COPY examples examples
|
||||||
COPY benchmarks benchmarks
|
COPY benchmarks benchmarks
|
||||||
|
COPY ./vllm/collect_env.py .
|
||||||
|
|
||||||
# Although we build Flashinfer with AOT mode, there's still
|
# Although we build Flashinfer with AOT mode, there's still
|
||||||
# some issues w.r.t. JIT compilation. Therefore we need to
|
# some issues w.r.t. JIT compilation. Therefore we need to
|
||||||
|
@ -121,6 +121,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
ADD ./tests/ ./tests/
|
ADD ./tests/ ./tests/
|
||||||
ADD ./examples/ ./examples/
|
ADD ./examples/ ./examples/
|
||||||
ADD ./benchmarks/ ./benchmarks/
|
ADD ./benchmarks/ ./benchmarks/
|
||||||
|
ADD ./vllm/collect_env.py .
|
||||||
|
|
||||||
# install development dependencies (for testing)
|
# install development dependencies (for testing)
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
@ -283,12 +283,13 @@ def get_vllm_version():
|
|||||||
if __version__ == "dev":
|
if __version__ == "dev":
|
||||||
return "N/A (dev)"
|
return "N/A (dev)"
|
||||||
|
|
||||||
if len(__version_tuple__) == 4: # dev build
|
if len(__version_tuple__) == 4: # dev build
|
||||||
git_sha = __version_tuple__[-1][1:] # type: ignore
|
git_sha = __version_tuple__[-1][1:] # type: ignore
|
||||||
return f"{__version__} (git sha: {git_sha}"
|
return f"{__version__} (git sha: {git_sha}"
|
||||||
|
|
||||||
return __version__
|
return __version__
|
||||||
|
|
||||||
|
|
||||||
def summarize_vllm_build_flags():
|
def summarize_vllm_build_flags():
|
||||||
# This could be a static method if the flags are constant, or dynamic if you need to check environment variables, etc.
|
# This could be a static method if the flags are constant, or dynamic if you need to check environment variables, etc.
|
||||||
return 'CUDA Archs: {}; ROCm: {}; Neuron: {}'.format(
|
return 'CUDA Archs: {}; ROCm: {}; Neuron: {}'.format(
|
||||||
@ -502,7 +503,9 @@ def get_pip_packages(run_lambda, patterns=None):
|
|||||||
print("uv is set")
|
print("uv is set")
|
||||||
cmd = ["uv", "pip", "list", "--format=freeze"]
|
cmd = ["uv", "pip", "list", "--format=freeze"]
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("Could not collect pip list output (pip or uv module not available)")
|
raise RuntimeError(
|
||||||
|
"Could not collect pip list output (pip or uv module not available)"
|
||||||
|
)
|
||||||
|
|
||||||
out = run_and_read_all(run_lambda, cmd)
|
out = run_and_read_all(run_lambda, cmd)
|
||||||
return "\n".join(line for line in out.splitlines()
|
return "\n".join(line for line in out.splitlines()
|
||||||
@ -535,13 +538,12 @@ def is_xnnpack_available():
|
|||||||
else:
|
else:
|
||||||
return "N/A"
|
return "N/A"
|
||||||
|
|
||||||
|
|
||||||
def get_env_vars():
|
def get_env_vars():
|
||||||
env_vars = ''
|
env_vars = ''
|
||||||
secret_terms=('secret', 'token', 'api', 'access', 'password')
|
secret_terms = ('secret', 'token', 'api', 'access', 'password')
|
||||||
report_prefix = ("TORCH", "NCCL", "PYTORCH",
|
report_prefix = ("TORCH", "NCCL", "PYTORCH", "CUDA", "CUBLAS", "CUDNN",
|
||||||
"CUDA", "CUBLAS", "CUDNN",
|
"OMP_", "MKL_", "NVIDIA")
|
||||||
"OMP_", "MKL_",
|
|
||||||
"NVIDIA")
|
|
||||||
for k, v in os.environ.items():
|
for k, v in os.environ.items():
|
||||||
if any(term in k.lower() for term in secret_terms):
|
if any(term in k.lower() for term in secret_terms):
|
||||||
continue
|
continue
|
||||||
@ -552,6 +554,7 @@ def get_env_vars():
|
|||||||
|
|
||||||
return env_vars
|
return env_vars
|
||||||
|
|
||||||
|
|
||||||
def get_env_info():
|
def get_env_info():
|
||||||
run_lambda = run
|
run_lambda = run
|
||||||
pip_version, pip_list_output = get_pip_packages(run_lambda)
|
pip_version, pip_list_output = get_pip_packages(run_lambda)
|
35
vllm/entrypoints/cli/collect_env.py
Normal file
35
vllm/entrypoints/cli/collect_env.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
from vllm.collect_env import main as collect_env_main
|
||||||
|
from vllm.entrypoints.cli.types import CLISubcommand
|
||||||
|
from vllm.entrypoints.openai.cli_args import make_arg_parser
|
||||||
|
from vllm.utils import FlexibleArgumentParser
|
||||||
|
|
||||||
|
|
||||||
|
class CollectEnvSubcommand(CLISubcommand):
|
||||||
|
"""The `serve` subcommand for the vLLM CLI. """
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.name = "collect-env"
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def cmd(args: argparse.Namespace) -> None:
|
||||||
|
"""Collect information about the environment."""
|
||||||
|
collect_env_main()
|
||||||
|
|
||||||
|
def subparser_init(
|
||||||
|
self,
|
||||||
|
subparsers: argparse._SubParsersAction) -> FlexibleArgumentParser:
|
||||||
|
serve_parser = subparsers.add_parser(
|
||||||
|
"collect-env",
|
||||||
|
help="Start collecting environment information.",
|
||||||
|
description="Start collecting environment information.",
|
||||||
|
usage="vllm collect-env")
|
||||||
|
return make_arg_parser(serve_parser)
|
||||||
|
|
||||||
|
|
||||||
|
def cmd_init() -> list[CLISubcommand]:
|
||||||
|
return [CollectEnvSubcommand()]
|
@ -5,6 +5,7 @@ import signal
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import vllm.entrypoints.cli.benchmark.main
|
import vllm.entrypoints.cli.benchmark.main
|
||||||
|
import vllm.entrypoints.cli.collect_env
|
||||||
import vllm.entrypoints.cli.openai
|
import vllm.entrypoints.cli.openai
|
||||||
import vllm.entrypoints.cli.serve
|
import vllm.entrypoints.cli.serve
|
||||||
import vllm.version
|
import vllm.version
|
||||||
@ -15,6 +16,7 @@ CMD_MODULES = [
|
|||||||
vllm.entrypoints.cli.openai,
|
vllm.entrypoints.cli.openai,
|
||||||
vllm.entrypoints.cli.serve,
|
vllm.entrypoints.cli.serve,
|
||||||
vllm.entrypoints.cli.benchmark.main,
|
vllm.entrypoints.cli.benchmark.main,
|
||||||
|
vllm.entrypoints.cli.collect_env,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user