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
073a4727
Unverified
Commit
073a4727
authored
Nov 07, 2024
by
Jiangtao Hu
Committed by
GitHub
Nov 07, 2024
Browse files
[Misc] report relevant env vars in collect_env.py tool (#9293)
parent
93bff421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
collect_env.py
collect_env.py
+25
-3
No files found.
collect_env.py
View file @
073a4727
# ruff: noqa
# code borrowed from https://github.com/pytorch/pytorch/blob/main/torch/utils/collect_env.py
# Unlike the rest of the PyTorch this file must be python2 compliant.
# This script outputs relevant system environment info
# Run it with `python collect_env.py` or `python -m torch.utils.collect_env`
import
datetime
import
locale
import
os
import
re
import
subprocess
import
sys
# Unlike the rest of the PyTorch this file must be python2 compliant.
# This script outputs relevant system environment info
# Run it with `python collect_env.py` or `python -m torch.utils.collect_env`
from
collections
import
namedtuple
from
vllm.envs
import
environment_variables
try
:
import
torch
TORCH_AVAILABLE
=
True
...
...
@@ -52,6 +54,7 @@ SystemEnv = namedtuple(
'vllm_version'
,
# vllm specific field
'vllm_build_flags'
,
# vllm specific field
'gpu_topo'
,
# vllm specific field
'env_vars'
,
])
DEFAULT_CONDA_PATTERNS
=
{
...
...
@@ -512,6 +515,22 @@ def is_xnnpack_available():
else
:
return
"N/A"
def
get_env_vars
():
env_vars
=
''
secret_terms
=
(
'secret'
,
'token'
,
'api'
,
'access'
,
'password'
)
report_prefix
=
(
"TORCH"
,
"NCCL"
,
"PYTORCH"
,
"CUDA"
,
"CUBLAS"
,
"CUDNN"
,
"OMP_"
,
"MKL_"
,
"NVIDIA"
)
for
k
,
v
in
os
.
environ
.
items
():
if
any
(
term
in
k
.
lower
()
for
term
in
secret_terms
):
continue
if
k
in
environment_variables
:
env_vars
=
env_vars
+
"{}={}"
.
format
(
k
,
v
)
+
"
\n
"
if
k
.
startswith
(
report_prefix
):
env_vars
=
env_vars
+
"{}={}"
.
format
(
k
,
v
)
+
"
\n
"
return
env_vars
def
get_env_info
():
run_lambda
=
run
...
...
@@ -583,6 +602,7 @@ def get_env_info():
vllm_version
=
vllm_version
,
vllm_build_flags
=
vllm_build_flags
,
gpu_topo
=
gpu_topo
,
env_vars
=
get_env_vars
(),
)
...
...
@@ -631,6 +651,8 @@ vLLM Build Flags:
{vllm_build_flags}
GPU Topology:
{gpu_topo}
{env_vars}
"""
.
strip
()
...
...
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