@@ -57,6 +57,36 @@ def is_non_backend_failure(self):
57
57
58
58
def is_backend_failure (self ):
59
59
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 } ." )
60
90
61
91
def display_name (self ):
62
92
if self == TestResult .SUCCESS :
@@ -129,6 +159,9 @@ class TestCaseSummary:
129
159
pte_size_bytes : int | None = None
130
160
""" The size of the PTE file in bytes. """
131
161
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
+
132
165
133
166
class TestSessionState :
134
167
test_case_summaries : list [TestCaseSummary ]
@@ -260,11 +293,12 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
260
293
field_names = [
261
294
"Test ID" ,
262
295
"Test Case" ,
263
- "Backend" ,
264
296
"Flow" ,
265
297
"Result" ,
298
+ "Result Detail" ,
299
+ "Delegated" ,
266
300
"Quantize Time (s)" ,
267
- "Lowering Time (s)" ,
301
+ "Lower Time (s)" ,
268
302
]
269
303
270
304
# 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):
289
323
[
290
324
f"Output { i } Error Max" ,
291
325
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" ,
295
327
]
296
328
)
297
329
field_names .extend (
@@ -311,32 +343,31 @@ def generate_csv_report(summary: RunSummary, output: TextIO):
311
343
row = {
312
344
"Test ID" : record .name ,
313
345
"Test Case" : record .base_name ,
314
- "Backend" : record .backend ,
315
346
"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" ,
317
350
"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
319
352
),
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
322
355
),
323
356
}
324
357
if record .params is not None :
325
358
row .update ({k .capitalize (): v for k , v in record .params .items ()})
326
359
327
360
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} "
333
364
334
365
row ["Delegated Nodes" ] = _sum_op_counts (record .delegated_op_counts )
335
366
row ["Undelegated Nodes" ] = _sum_op_counts (record .undelegated_op_counts )
336
367
row ["Delegated Ops" ] = _serialize_op_counts (record .delegated_op_counts )
337
368
row ["Undelegated Ops" ] = _serialize_op_counts (record .undelegated_op_counts )
338
369
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 ""
340
371
)
341
372
342
373
writer .writerow (row )
0 commit comments