File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,14 @@ def compile(self,
110
110
compiled_graph = self .load (graph , example_inputs , graph_index ,
111
111
runtime_shape )
112
112
if compiled_graph is not None :
113
- if graph_index == 0 :
114
- # adds some info logging for the first graph
115
- logger .info ("Directly load the compiled graph for shape %s "
116
- "from the cache" , str (runtime_shape )) # noqa
113
+ if graph_index == num_graphs - 1 :
114
+ # after loading the last graph for this shape, record the time.
115
+ # there can be multiple graphs due to piecewise compilation.
116
+ now = time .time ()
117
+ elapsed = now - compilation_start_time
118
+ logger .info (
119
+ "Directly load the compiled graph(s) for shape %s "
120
+ "from the cache, took %.3f s" , str (runtime_shape ), elapsed )
117
121
return compiled_graph
118
122
119
123
# no compiler cached the graph, or the cache is disabled,
You can’t perform that action at this time.
0 commit comments