@@ -538,6 +538,8 @@ def output_signpost(data, args, suite, error=None):
538
538
539
539
from torch ._dynamo .utils import calculate_time_spent , compilation_time_metrics
540
540
541
+ wall_time_by_phase = calculate_time_spent ()
542
+
541
543
open_source_signpost (
542
544
subsystem = "dynamo_benchmark" ,
543
545
name = event_name ,
@@ -550,7 +552,7 @@ def output_signpost(data, args, suite, error=None):
550
552
# NB: Externally, compilation_metrics colloquially refers to
551
553
# the coarse-grained phase timings, even though internally
552
554
# they are called something else
553
- "compilation_metrics" : calculate_time_spent () ,
555
+ "compilation_metrics" : wall_time_by_phase ,
554
556
"agg_compilation_metrics" : {
555
557
k : sum (v ) for k , v in compilation_time_metrics .items ()
556
558
},
@@ -563,6 +565,8 @@ def output_signpost(data, args, suite, error=None):
563
565
),
564
566
)
565
567
568
+ return wall_time_by_phase ["total_wall_time" ]
569
+
566
570
567
571
def nothing (f ):
568
572
return f
@@ -2917,13 +2921,17 @@ def record_status(accuracy_status, dynamo_start_stats):
2917
2921
headers .append (k )
2918
2922
fields .append (v )
2919
2923
2920
- write_outputs (output_filename , headers , fields )
2921
-
2922
- output_signpost (
2924
+ total_wall_time = output_signpost (
2923
2925
dict (zip (o_headers , o_fields )),
2924
2926
self .args ,
2925
2927
self .suite_name ,
2926
2928
)
2929
+ headers .append ("compilation_latency" )
2930
+ fields .append (total_wall_time )
2931
+ write_outputs (output_filename , headers , fields )
2932
+
2933
+ if self .args .print_compilation_time :
2934
+ print (f"Compilation time (from dynamo_timed): { total_wall_time } " )
2927
2935
2928
2936
return accuracy_status
2929
2937
0 commit comments