Unverified Commit 682e0b6d authored by Richard Zou's avatar Richard Zou Committed by GitHub
Browse files

Log how much time loading a compiled artifact takes (#16848)


Signed-off-by: default avatarrzou <zou3519@gmail.com>
parent d6195a74
......@@ -110,10 +110,14 @@ class CompilerManager:
compiled_graph = self.load(graph, example_inputs, graph_index,
runtime_shape)
if compiled_graph is not None:
if graph_index == 0:
# adds some info logging for the first graph
logger.info("Directly load the compiled graph for shape %s "
"from the cache", str(runtime_shape)) # noqa
if graph_index == num_graphs - 1:
# after loading the last graph for this shape, record the time.
# there can be multiple graphs due to piecewise compilation.
now = time.time()
elapsed = now - compilation_start_time
logger.info(
"Directly load the compiled graph(s) for shape %s "
"from the cache, took %.3f s", str(runtime_shape), elapsed)
return compiled_graph
# no compiler cached the graph, or the cache is disabled,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment