Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
7bdfd29a
Unverified
Commit
7bdfd29a
authored
Apr 18, 2025
by
rongfu.leng
Committed by
GitHub
Apr 17, 2025
Browse files
[Misc] add collect_env to cli and docker image (#16759)
Signed-off-by:
rongfu.leng
<
rongfu.leng@daocloud.io
>
parent
e78587a6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
12 deletions
+54
-12
.github/ISSUE_TEMPLATE/200-installation.yml
.github/ISSUE_TEMPLATE/200-installation.yml
+1
-1
.github/ISSUE_TEMPLATE/300-usage.yml
.github/ISSUE_TEMPLATE/300-usage.yml
+1
-1
.github/ISSUE_TEMPLATE/400-bug-report.yml
.github/ISSUE_TEMPLATE/400-bug-report.yml
+1
-1
.github/ISSUE_TEMPLATE/700-performance-discussion.yml
.github/ISSUE_TEMPLATE/700-performance-discussion.yml
+1
-1
docker/Dockerfile
docker/Dockerfile
+1
-0
docker/Dockerfile.cpu
docker/Dockerfile.cpu
+1
-0
vllm/collect_env.py
vllm/collect_env.py
+11
-8
vllm/entrypoints/cli/collect_env.py
vllm/entrypoints/cli/collect_env.py
+35
-0
vllm/entrypoints/cli/main.py
vllm/entrypoints/cli/main.py
+2
-0
No files found.
.github/ISSUE_TEMPLATE/200-installation.yml
View file @
7bdfd29a
...
@@ -14,7 +14,7 @@ body:
...
@@ -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
```
```
...
...
.github/ISSUE_TEMPLATE/300-usage.yml
View file @
7bdfd29a
...
@@ -14,7 +14,7 @@ body:
...
@@ -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
```
```
...
...
.github/ISSUE_TEMPLATE/400-bug-report.yml
View file @
7bdfd29a
...
@@ -14,7 +14,7 @@ body:
...
@@ -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
```
```
...
...
.github/ISSUE_TEMPLATE/700-performance-discussion.yml
View file @
7bdfd29a
...
@@ -35,7 +35,7 @@ body:
...
@@ -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
```
```
...
...
docker/Dockerfile
View file @
7bdfd29a
...
@@ -241,6 +241,7 @@ if [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
...
@@ -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
...
...
docker/Dockerfile.cpu
View file @
7bdfd29a
...
@@ -121,6 +121,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
...
@@ -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 \
...
...
collect_env.py
→
vllm/
collect_env.py
View file @
7bdfd29a
...
@@ -283,12 +283,13 @@ def get_vllm_version():
...
@@ -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):
...
@@ -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():
...
@@ -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():
...
@@ -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
)
...
...
vllm/entrypoints/cli/collect_env.py
0 → 100644
View file @
7bdfd29a
# 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
()]
vllm/entrypoints/cli/main.py
View file @
7bdfd29a
...
@@ -5,6 +5,7 @@ import signal
...
@@ -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 = [
...
@@ -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
,
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment