[Core] Add dynamo_timed tracing for print_readable (#40834)
Signed-off-by: Frederik Gossen <frgossen@meta.com>
This commit is contained in:
@@ -1264,11 +1264,12 @@ class VllmBackend:
|
|||||||
# code adapted from
|
# code adapted from
|
||||||
# https://github.com/thuml/depyf/blob/dab831108a752d1facc00acdd6d4243891845c37/depyf/explain/patched_lazy_format_graph_code.py#L30
|
# https://github.com/thuml/depyf/blob/dab831108a752d1facc00acdd6d4243891845c37/depyf/explain/patched_lazy_format_graph_code.py#L30
|
||||||
# use `print_readable` because it can include submodules
|
# use `print_readable` because it can include submodules
|
||||||
src = (
|
with dynamo_timed("vllm_print_readable"):
|
||||||
"from __future__ import annotations\nimport torch\n"
|
src = (
|
||||||
+ self.split_gm.print_readable(print_output=False)
|
"from __future__ import annotations\nimport torch\n"
|
||||||
)
|
+ self.split_gm.print_readable(print_output=False)
|
||||||
src = src.replace("<lambda>", "GraphModule")
|
)
|
||||||
|
src = src.replace("<lambda>", "GraphModule")
|
||||||
with open(graph_path, "w") as f:
|
with open(graph_path, "w") as f:
|
||||||
f.write(src)
|
f.write(src)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user