-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[BugFix] respect VLLM_LOGGING_LEVEL in logger #29761
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
Conversation
Signed-off-by: Boyuan Feng <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
Code Review
This pull request removes a debug logging statement from the execute_model function to reduce latency on a performance-critical path. While this change achieves its performance goal, I have raised a high-severity concern regarding maintainability. The removed log provides valuable information for debugging complex features like CUDA graphs and distributed execution. I've suggested an alternative approach to conditionally enable this log via an environment variable, which would preserve debuggability for developers without impacting production performance.
| use_cascade_attn=cascade_attn_prefix_lens is not None, | ||
| ) | ||
|
|
||
| logger.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.
What if we save a bool property on the object that controls this log and use an if statement on the hot path, perhaps that's better?
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.
yes added an observability_config to control that.
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 was actually referring to using if logger.isEnabledFor(logging.DEBUG):, but I see that you're having issues with that
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.
|
@BoyuanFeng is the concern overhead when debug level logging is enabled, or even when it's disabled (default case)? The latter would be quite surprising, the function call should really be a no-op. |
|
@njhill when running So the |
Signed-off-by: Boyuan Feng <[email protected]>
|
@BoyuanFeng I'm still confused why debug logging is enabled. It's probably best for that to be disabled when benchmarking. Are you sure you aren't separately setting the env var |
|
I agree with @njhill, I am confused why the logging level is debug by default, it isn't for me |
Signed-off-by: Boyuan Feng <[email protected]>
|
@njhill @ProExpertProg I found that vLLM defaults logger Lines 40 to 71 in 1336a1e
|
|
Huh this seems like a big issue - we should update this as there are other places in the code we assume that debug logs are noops (and clearly they aren't). Can you open a new PR where we just update the logger level? |
|
Wow, nice find! Looks like it has been this way all along and we've been paying more for debug logs than we should have been (even though the output is blocked by the handler, some processing is still done for each log record). It should be a trivial fix hopefully, let's get it into the upcoming release. |
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.
Please revert all the changes apart from those in logger.py. Then this looks good! (or open a separate PR for that as @ProExpertProg suggested)
Signed-off-by: Boyuan Feng <[email protected]>
|
@njhill cleaned this pr to only contain changes in logger.py. I will open another pr for logger.debug overhead |
|
Thanks @BoyuanFeng! I'm hoping this change should be sufficient. |
|
@BoyuanFeng it looks like there's some tests which rely on capturing debug logs and so also need to be updated. |
|
We can probably get around this quickly by adding |
Signed-off-by: Boyuan Feng <[email protected]>
Head branch was pushed to by a user without write access
|
@njhill yeah fixed the tests. let's see if something is missed. |
Signed-off-by: Boyuan Feng <[email protected]> Signed-off-by: Bofeng BF1 Xue <[email protected]>
Signed-off-by: Boyuan Feng <[email protected]> Signed-off-by: Xingyu Liu <[email protected]>

Issue: vLLM defaults logger vllm to be DEBUG (Line 65).
envs.VLLM_LOGGING_LEVELis used to updateDEFAULT_LOGGING_CONFIG["handlers"]["vllm"](akalogging.StreamHandler), but notDEFAULT_LOGGING_CONFIG["loggers"]["vllm"](akalogging.vllm).logging.vllmis DEBUG and used as the parent of all other loggers, including execute_model.vllm/vllm/logger.py
Lines 40 to 71 in 1336a1e
This PR fixed the issue.