Skip to content
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

Introduce VLLM_VERBOSITY environment variable #1165

Closed
wants to merge 7 commits into from

Conversation

danilopeixoto
Copy link
Contributor

@danilopeixoto danilopeixoto commented Sep 24, 2023

Introduce VLLM_VERBOSITY environment variable and use info log level by default to reduce IO operations in production.
For dependencies use warning level.

@danilopeixoto danilopeixoto changed the title Use warning log level Introduce VLLM_VERBOSITY environment variable Sep 24, 2023
@@ -76,5 +76,5 @@ async def stream_results() -> AsyncGenerator[bytes, None]:
uvicorn.run(app,
host=args.host,
port=args.port,
log_level="debug",
log_level="warning",
Copy link
Contributor Author

@danilopeixoto danilopeixoto Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we log only warnings and critical errors for uvicorn dependency (internal).

Copy link

@sd109 sd109 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to omit this argument completely so that the uvicorn log level can be set with its own environment variable? See https://www.uvicorn.org/settings/

@@ -26,15 +36,23 @@ def format(self, record):
_default_handler = None


def _get_default_logging_level():
verbosity = os.getenv("VLLM_VERBOSITY", "info").lower()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For vLLM logs, we allow debug, info, warning, error and critical levels.
The default is info. The default can be overridden by VLLM_VERBOSITY variable.

Users may want to set it to warning in production.

global _default_handler
if _default_handler is None:
_default_handler = logging.StreamHandler(sys.stdout)
_default_handler.flush = sys.stdout.flush # type: ignore
_default_handler.setLevel(logging.INFO)
_default_handler.setLevel(logging.DEBUG)
Copy link
Contributor Author

@danilopeixoto danilopeixoto Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default handler goes down to debug level, however, the root is defining the effective level from user selection (VLLM_VERBOSITY) or default.

@danilopeixoto
Copy link
Contributor Author

Hi @zhuohan123!
Would you provide your thoughts on this? It is fine if this is not the implementation plan for logging.

@sd109
Copy link

sd109 commented Dec 13, 2023

+1 for this change, being able to change the log level via environment variable would be very useful.

@DarkLight1337
Copy link
Member

Closing as it is superseded by #4273 and #4377.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants