-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Misc] Add environment variables collection in collect_env.py tool #9293
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
Cool! Could we maybe restrict this to the env vars Edit: looks like |
Good point. Updated to use vllm related env variables as white list to collect. |
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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this text get moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without moving, It fails ruff style check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, thanks.
collect_env.py
Outdated
v = '***' | ||
if k not in environment_variables: | ||
v = '***' | ||
env_vars = env_vars + "{}={}".format(k, v) + "\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of just overwriting the value, I would exclude the env var completely from the output if it's not a VLLM related env var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At beginning, it implements this way. Later joerunde suggested We could use v = *** or something like that to denote that the environment variable was set, but redacted here
. I think it makes sense to make it easier to debug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see ... it makes me a little uncomfortable from a privacy perspective, but really anyone running this should be inspecting the output before they post it publicly.
There are also lots of env vars directly related to vLLM that won't be in vllm's list, like https://pytorch.org/docs/stable/torch_environment_variables.html ... so overall I'm convinced. Thanks for pointing me to the history on the topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my questions were answered - this lgtm!
collect_env.py
Outdated
if any(term in k.lower() for term in secret_terms): | ||
v = '***' | ||
if k not in environment_variables: | ||
v = '***' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is too aggresive. let's only report:
- env vars in
environment_variables
- env vars starting with
TORCH
orNCCL
.
we can expand the list later as needed. sometimes, even exposing the name of env var is very risky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe with a variable named report_prefix = ["TORCH", "NCCL"]
, and later we can just expand this list with one line change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution! please fix the comment.
…place the value with dummy string
collect_env.py
Outdated
def get_env_vars(): | ||
env_vars = '' | ||
secret_terms=('secret', 'token', 'api', 'access', 'password') | ||
report_prefix = ("TORCH", "NCCL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some torch env vars start with PYTORCH
report_prefix = ("TORCH", "NCCL") | |
report_prefix = ("TORCH", "NCCL", "PYTORCH") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and actually, from https://pytorch.org/docs/stable/cuda_environment_variables.html
CUDA
CUBLAS
CUDNN
NVIDIA
more here https://pytorch.org/docs/stable/threading_environment_variables.html ...
not sure how far to go here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. If there are some important env variables missing in the future, it is easy to append more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution!
…9293) Signed-off-by: Isotr0py <[email protected]>
…9293) Signed-off-by: Loc Huynh <[email protected]>
…9293) Signed-off-by: Sumit Dubey <[email protected]>
…9293) Signed-off-by: Maxime Fournioux <[email protected]>
…9293) Signed-off-by: Tyler Michael Smith <[email protected]>
Add environment variables collection in collect_env.py tool
Many user problems are related to environment variables (https://docs.vllm.ai/en/latest/serving/env_vars.html#environment-variables). By integrating this info in to collect_env.py tool, make it easier to debug user problems.
Here is one sample output:
PR Checklist (Click to Expand)
Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Model]
for adding a new model or improving an existing model. Model name should appear in the title.[Frontend]
For changes on the vLLM frontend (e.g., OpenAI API server,LLM
class, etc.)[Kernel]
for changes affecting CUDA kernels or other compute kernels.[Core]
for changes in the core vLLM logic (e.g.,LLMEngine
,AsyncLLMEngine
,Scheduler
, etc.)[Hardware][Vendor]
for hardware-specific changes. Vendor name should appear in the prefix (e.g.,[Hardware][AMD]
).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
format.sh
to format your code.docs/source/
if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.Adding or changing kernels
Each custom kernel needs a schema and one or more implementations to be registered with PyTorch.
Tensors
require meta-functions. Meta-functions should be implemented and registered in python so that dynamic dims can be handled automatically. See above documents for a description of meta-functions.torch.libary.opcheck()
to test the function registration and meta-function for any registered ops. Seetests/kernels
for examples.Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with
rfc-required
and might not go through the PR.What to Expect for the Reviews
The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:
action-required
label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!