@@ -57,6 +57,36 @@ def is_non_backend_failure(self):
5757
5858 def is_backend_failure (self ):
5959 return not self .is_success () and not self .is_non_backend_failure ()
60+
61+ def to_short_str (self ):
62+ if self in { TestResult .SUCCESS , TestResult .SUCCESS_UNDELEGATED }:
63+ return "Pass"
64+ elif self == TestResult .SKIPPED :
65+ return "Skip"
66+ else :
67+ return "Fail"
68+
69+ def to_detail_str (self ):
70+ if self == TestResult .SUCCESS :
71+ return ""
72+ elif self == TestResult .SUCCESS_UNDELEGATED :
73+ return ""
74+ elif self == TestResult .SKIPPED :
75+ return ""
76+ elif self == TestResult .QUANTIZE_FAIL :
77+ return "Quantization Failed"
78+ elif self == TestResult .LOWER_FAIL :
79+ return "Lowering Failed"
80+ elif self == TestResult .PTE_LOAD_FAIL :
81+ return "PTE Load Failed"
82+ elif self == TestResult .PTE_RUN_FAIL :
83+ return "PTE Run Failed"
84+ elif self == TestResult .OUTPUT_MISMATCH_FAIL :
85+ return "Output Mismatch"
86+ elif self == TestResult .UNKNOWN_FAIL :
87+ return "Unknown Failure"
88+ else :
89+ raise ValueError (f"Invalid TestResult value: { self } ." )
6090
6191 def display_name (self ):
6292 if self == TestResult .SUCCESS :
@@ -129,6 +159,9 @@ class TestCaseSummary:
129159 pte_size_bytes : int | None = None
130160 """ The size of the PTE file in bytes. """
131161
162+ def is_delegated (self ):
163+ return any (v > 0 for v in self .delegated_op_counts .values ()) if self .delegated_op_counts else False
164+
132165
133166class TestSessionState :
134167 test_case_summaries : list [TestCaseSummary ]
@@ -260,11 +293,12 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
260293 field_names = [
261294 "Test ID" ,
262295 "Test Case" ,
263- "Backend" ,
264296 "Flow" ,
265297 "Result" ,
298+ "Result Detail" ,
299+ "Delegated" ,
266300 "Quantize Time (s)" ,
267- "Lowering Time (s)" ,
301+ "Lower Time (s)" ,
268302 ]
269303
270304 # Tests can have custom parameters. We'll want to report them here, so we need
@@ -289,9 +323,7 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
289323 [
290324 f"Output { i } Error Max" ,
291325 f"Output { i } Error MAE" ,
292- f"Output { i } Error MSD" ,
293- f"Output { i } Error L2" ,
294- f"Output { i } SQNR" ,
326+ f"Output { i } SNR" ,
295327 ]
296328 )
297329 field_names .extend (
@@ -311,32 +343,31 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
311343 row = {
312344 "Test ID" : record .name ,
313345 "Test Case" : record .base_name ,
314- "Backend" : record .backend ,
315346 "Flow" : record .flow ,
316- "Result" : record .result .display_name (),
347+ "Result" : record .result .to_short_str (),
348+ "Result Detail" : record .result .to_detail_str (),
349+ "Delegated" : "True" if record .is_delegated () else "False" ,
317350 "Quantize Time (s)" : (
318- record .quantize_time .total_seconds () if record .quantize_time else None
351+ f" { record .quantize_time .total_seconds ():.3f } " if record .quantize_time else None
319352 ),
320- "Lowering Time (s)" : (
321- record .lower_time .total_seconds () if record .lower_time else None
353+ "Lower Time (s)" : (
354+ f" { record .lower_time .total_seconds ():.3f } " if record .lower_time else None
322355 ),
323356 }
324357 if record .params is not None :
325358 row .update ({k .capitalize (): v for k , v in record .params .items ()})
326359
327360 for output_idx , error_stats in enumerate (record .tensor_error_statistics ):
328- row [f"Output { output_idx } Error Max" ] = error_stats .error_max
329- row [f"Output { output_idx } Error MAE" ] = error_stats .error_mae
330- row [f"Output { output_idx } Error MSD" ] = error_stats .error_msd
331- row [f"Output { output_idx } Error L2" ] = error_stats .error_l2_norm
332- row [f"Output { output_idx } SQNR" ] = error_stats .sqnr
361+ row [f"Output { output_idx } Error Max" ] = f"{ error_stats .error_max :.3f} "
362+ row [f"Output { output_idx } Error MAE" ] = f"{ error_stats .error_mae :.3f} "
363+ row [f"Output { output_idx } SNR" ] = f"{ error_stats .sqnr :.3f} "
333364
334365 row ["Delegated Nodes" ] = _sum_op_counts (record .delegated_op_counts )
335366 row ["Undelegated Nodes" ] = _sum_op_counts (record .undelegated_op_counts )
336367 row ["Delegated Ops" ] = _serialize_op_counts (record .delegated_op_counts )
337368 row ["Undelegated Ops" ] = _serialize_op_counts (record .undelegated_op_counts )
338369 row ["PTE Size (Kb)" ] = (
339- record .pte_size_bytes / 1000.0 if record .pte_size_bytes else ""
370+ f" { record .pte_size_bytes / 1000.0 :.3f } " if record .pte_size_bytes else ""
340371 )
341372
342373 writer .writerow (row )
0 commit comments