From 47cd1c8885b79be4ea92bae8574a07e7b60f8a23 Mon Sep 17 00:00:00 2001 From: Frederik Gossen Date: Fri, 21 Aug 2026 12:07:21 -0400 Subject: [PATCH] [Core] Add dynamo_timed tracing for print_readable (#40834) Signed-off-by: Frederik Gossen --- vllm/compilation/backends.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vllm/compilation/backends.py b/vllm/compilation/backends.py index 3fbb4b2c33..8117be69f1 100644 --- a/vllm/compilation/backends.py +++ b/vllm/compilation/backends.py @@ -1264,11 +1264,12 @@ class VllmBackend: # code adapted from # https://github.com/thuml/depyf/blob/dab831108a752d1facc00acdd6d4243891845c37/depyf/explain/patched_lazy_format_graph_code.py#L30 # use `print_readable` because it can include submodules - src = ( - "from __future__ import annotations\nimport torch\n" - + self.split_gm.print_readable(print_output=False) - ) - src = src.replace("", "GraphModule") + with dynamo_timed("vllm_print_readable"): + src = ( + "from __future__ import annotations\nimport torch\n" + + self.split_gm.print_readable(print_output=False) + ) + src = src.replace("", "GraphModule") with open(graph_path, "w") as f: f.write(src)