Skip to content

[Misc] Improve logging for dynamic shape cache compilation #20573

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

Merged
merged 4 commits into from
Jul 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion vllm/compilation/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def compile(self,
self.is_cache_updated = True
if graph_index == 0:
# adds some info logging for the first graph
logger.info("Cache the graph of shape %s for later use",
if runtime_shape is None:
logger.info("Cache the graph for DYNAMIC shape for later use")
else:
logger.info("Cache the graph of shape %s for later use",
str(runtime_shape))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This if/else block can be simplified using a conditional expression for constructing the log message, improving readability.

                shape_log_msg = "for DYNAMIC shape" if runtime_shape is None else f"of shape {runtime_shape}"
                logger.info(f"Cache the graph {shape_log_msg} for later use")

logger.debug(
"store the %s-th graph for shape %s from %s via handle %s",
Expand Down
Loading