mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-03 17:27:05 +08:00
[Misc] report relevant env vars in collect_env.py tool (#9293)
This commit is contained in:
parent
93bff421bc
commit
073a472728
@ -1,17 +1,19 @@
|
|||||||
# ruff: noqa
|
# ruff: noqa
|
||||||
# code borrowed from https://github.com/pytorch/pytorch/blob/main/torch/utils/collect_env.py
|
# 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 datetime
|
||||||
import locale
|
import locale
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
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 collections import namedtuple
|
||||||
|
|
||||||
|
from vllm.envs import environment_variables
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import torch
|
import torch
|
||||||
TORCH_AVAILABLE = True
|
TORCH_AVAILABLE = True
|
||||||
@ -52,6 +54,7 @@ SystemEnv = namedtuple(
|
|||||||
'vllm_version', # vllm specific field
|
'vllm_version', # vllm specific field
|
||||||
'vllm_build_flags', # vllm specific field
|
'vllm_build_flags', # vllm specific field
|
||||||
'gpu_topo', # vllm specific field
|
'gpu_topo', # vllm specific field
|
||||||
|
'env_vars',
|
||||||
])
|
])
|
||||||
|
|
||||||
DEFAULT_CONDA_PATTERNS = {
|
DEFAULT_CONDA_PATTERNS = {
|
||||||
@ -512,6 +515,22 @@ def is_xnnpack_available():
|
|||||||
else:
|
else:
|
||||||
return "N/A"
|
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():
|
def get_env_info():
|
||||||
run_lambda = run
|
run_lambda = run
|
||||||
@ -583,6 +602,7 @@ def get_env_info():
|
|||||||
vllm_version=vllm_version,
|
vllm_version=vllm_version,
|
||||||
vllm_build_flags=vllm_build_flags,
|
vllm_build_flags=vllm_build_flags,
|
||||||
gpu_topo=gpu_topo,
|
gpu_topo=gpu_topo,
|
||||||
|
env_vars=get_env_vars(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -631,6 +651,8 @@ vLLM Build Flags:
|
|||||||
{vllm_build_flags}
|
{vllm_build_flags}
|
||||||
GPU Topology:
|
GPU Topology:
|
||||||
{gpu_topo}
|
{gpu_topo}
|
||||||
|
|
||||||
|
{env_vars}
|
||||||
""".strip()
|
""".strip()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user