[Core] Add dynamo_timed tracing for print_readable (#40834)

Signed-off-by: Frederik Gossen <frgossen@meta.com>

Frederik Gossen committed Aug 21, 2026 at 12:07 UTC 47cd1c8885b79be4ea92bae8574a07e7b60f8a23
1 file changed +6 -5
vllm/compilation/backends.py
+6 -5
@@ -1264,11 +1264,12 @@ class VllmBackend:
1264 # code adapted from
1265 # https://github.com/thuml/depyf/blob/dab831108a752d1facc00acdd6d4243891845c37/depyf/explain/patched_lazy_format_graph_code.py#L30
1266 # use `print_readable` because it can include submodules
1267 - src = (
1268 - "from __future__ import annotations\nimport torch\n"
1269 - + self.split_gm.print_readable(print_output=False)
1270 - )
1271 - src = src.replace("<lambda>", "GraphModule")
1267 + with dynamo_timed("vllm_print_readable"):
1268 + src = (
1269 + "from __future__ import annotations\nimport torch\n"
1270 + + self.split_gm.print_readable(print_output=False)
1271 + )
1272 + src = src.replace("<lambda>", "GraphModule")
1273 with open(graph_path, "w") as f:
1274 f.write(src)
1275