-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[Misc] Separate prompt logging to debug #26713
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
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 improves logging by separating verbose prompt details into a DEBUG level log, which is a good change for reducing log noise in production. My review includes a suggestion to further improve log clarity by making the new DEBUG log message more distinct from the INFO message, avoiding redundancy.
| logger.debug( | ||
| "Received request %s: prompt: %r, " | ||
| "params: %s, prompt_token_ids: %s, " | ||
| "prompt_embeds shape: %s, " | ||
| "lora_request: %s.", | ||
| "prompt_token_ids: %s, " | ||
| "prompt_embeds shape: %s.", | ||
| request_id, | ||
| prompt, | ||
| params, | ||
| prompt_token_ids, | ||
| prompt_embeds.shape if prompt_embeds is not None else None, | ||
| ) |
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.
The log message prefix "Received request %s" is duplicated in both the DEBUG and INFO level logs. This is redundant and can make logs harder to read when debugging, as two lines for the same request will start with the same text. To improve log clarity, the DEBUG log message should be distinct to indicate it provides supplementary details for the request announced in the INFO log.
| logger.debug( | |
| "Received request %s: prompt: %r, " | |
| "params: %s, prompt_token_ids: %s, " | |
| "prompt_embeds shape: %s, " | |
| "lora_request: %s.", | |
| "prompt_token_ids: %s, " | |
| "prompt_embeds shape: %s.", | |
| request_id, | |
| prompt, | |
| params, | |
| prompt_token_ids, | |
| prompt_embeds.shape if prompt_embeds is not None else None, | |
| ) | |
| logger.debug( | |
| "Request %s details: prompt: %r, " | |
| "prompt_token_ids: %s, " | |
| "prompt_embeds shape: %s.", | |
| request_id, | |
| prompt, | |
| prompt_token_ids, | |
| prompt_embeds.shape if prompt_embeds is not None else None, | |
| ) |
|
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
DarkLight1337
left a comment
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.
Makes sense, thanks
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: 1994 <1994@users.noreply.github.com>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: Dhruvil Bhatt <bhattdbh@amazon.com>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: bbartels <benjamin@bartels.dev>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Signed-off-by: Aleksei Tsvetkov <aitsvet@ya.ru>
Purpose
Split the
logger.infocall invllm/entrypoints/logger.pyto differentiate between verbose prompt-related details and essential request parameters.This change moves
request_id,prompt,prompt_token_ids, andprompt_embedsto a newlogger.debugcall. The originallogger.infonow only containsparamsandlora_request. This improves log clarity by:INFOlevel in production environments.Test Plan
request_id,prompt,prompt_token_ids,prompt_embeds) is correctly logged at theDEBUGlevel.paramsandlora_requestare logged by thelogger.infocall.Test Result
logger.infocall invllm/entrypoints/logger.pyhas been split.request_id,prompt,prompt_token_ids,prompt_embeds) are now logged vialogger.debug.params,lora_request) remain in thelogger.infocall.Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.