@@ -858,13 +858,9 @@ def _calculate_statistics(self) -> Dict[str, float]:
858858 if not self .metrics_list :
859859 return {} # Return an empty dict if metrics_list is empty
860860 return {
861- "p05" : np .percentile (self .metrics_list , 5 ),
862861 "p10" : np .percentile (self .metrics_list , 10 ),
863- "p15" : np .percentile (self .metrics_list , 15 ),
864862 "p50" : np .percentile (self .metrics_list , 50 ),
865863 "p90" : np .percentile (self .metrics_list , 90 ),
866- "p95" : np .percentile (self .metrics_list , 95 ),
867- "p99" : np .percentile (self .metrics_list , 99 ),
868864 "avg" : np .mean (self .metrics_list ),
869865 "max" : np .max (self .metrics_list ),
870866 "num_runs" : len (self .metrics_list ),
@@ -1292,184 +1288,79 @@ def unified_flops_metrics(
12921288 print (
12931289 f"{ dtype_prefix } "
12941290 f"Total floating-point ops: { total_flops } , "
1295- f"Step Time (min): "
1296- f'{ average_time_ms_statistics .statistics ["min" ]:.2f} , '
1297- f"Step Time (p05): "
1298- f'{ average_time_ms_statistics .statistics ["p05" ]:.2f} , '
12991291 f"Step Time (p10): "
1300- f'{ average_time_ms_statistics .statistics ["p10" ]:.2f} , '
1301- f"Step Time (p15): "
1302- f'{ average_time_ms_statistics .statistics ["p15" ]:.2f} , '
1292+ f"{ average_time_ms_statistics .statistics ['p10' ]:.2f} , "
13031293 f"Step Time (median): "
1304- f'{ average_time_ms_statistics .statistics ["p50" ]:.2f} , '
1305- f"Step Time (avg): "
1306- f'{ average_time_ms_statistics .statistics ["avg" ]:.2f} , '
1294+ f"{ average_time_ms_statistics .statistics ['p50' ]:.2f} , "
13071295 f"Step Time (p90): "
1308- f'{ average_time_ms_statistics .statistics ["p90" ]:.2f} , '
1309- f"Step Time (p95): "
1310- f'{ average_time_ms_statistics .statistics ["p95" ]:.2f} , '
1311- f"Step Time (p99): "
1312- f'{ average_time_ms_statistics .statistics ["p99" ]:.2f} , '
1313- f"Step Time (max): "
1314- f'{ average_time_ms_statistics .statistics ["max" ]:.2f} , '
1315- f"Throughput (min): "
1316- f'{ tflops_per_sec_statistics .statistics ["min" ]:.2f} '
1296+ f"{ average_time_ms_statistics .statistics ['p90' ]:.2f} , "
13171297 f"TFLOP / second / device, "
1318- f"Throughput (p05): "
1319- f'{ tflops_per_sec_statistics .statistics ["p05" ]:.2f} '
13201298 f"TFLOP / second / device, "
13211299 f"Throughput (p10): "
1322- f' { tflops_per_sec_statistics .statistics [" p10" ]:.2f} '
1300+ f" { tflops_per_sec_statistics .statistics [' p10' ]:.2f} "
13231301 f"TFLOP / second / device, "
1324- f"Throughput (p15): "
1325- f'{ tflops_per_sec_statistics .statistics ["p15" ]:.2f} '
13261302 f"TFLOP / second / device, "
13271303 f"Throughput (median): "
1328- f' { tflops_per_sec_statistics .statistics [" p50" ]:.2f} '
1304+ f" { tflops_per_sec_statistics .statistics [' p50' ]:.2f} "
13291305 f"TFLOP / second / device, "
1330- f"Throughput (avg): "
1331- f'{ tflops_per_sec_statistics .statistics ["avg" ]:.2f} '
13321306 f"TFLOP / second / device, "
13331307 f"Throughput (p90): "
1334- f' { tflops_per_sec_statistics .statistics [" p90" ]:.2f} '
1308+ f" { tflops_per_sec_statistics .statistics [' p90' ]:.2f} "
13351309 f"TFLOP / second / device, "
1336- f"Throughput (p95): "
1337- f'{ tflops_per_sec_statistics .statistics ["p95" ]:.2f} '
13381310 f"TFLOP / second / device, "
1339- f"Throughput (p99): "
1340- f'{ tflops_per_sec_statistics .statistics ["p99" ]:.2f} '
13411311 f"TFLOP / second / device, "
1342- f"Throughput (max): "
1343- f'{ tflops_per_sec_statistics .statistics ["max" ]:.2f} '
13441312 f"TFLOP / second / device, "
1345- f"TotalThroughput (min): "
1346- f'{ tflops_per_sec_all_devices_statistics .statistics ["min" ]:.2f} '
13471313 f"TFLOP / second, "
1348- f"TotalThroughput (p05): "
1349- f'{ tflops_per_sec_all_devices_statistics .statistics ["p05" ]:.2f} '
13501314 f"TFLOP / second, "
13511315 f"TotalThroughput (p10): "
1352- f' { tflops_per_sec_all_devices_statistics .statistics [" p10" ]:.2f} '
1316+ f" { tflops_per_sec_all_devices_statistics .statistics [' p10' ]:.2f} "
13531317 f"TFLOP / second, "
1354- f"TotalThroughput (p15): "
1355- f'{ tflops_per_sec_all_devices_statistics .statistics ["p15" ]:.2f} '
13561318 f"TFLOP / second, "
13571319 f"TotalThroughput (median): "
1358- f' { tflops_per_sec_all_devices_statistics .statistics [" p50" ]:.2f} '
1320+ f" { tflops_per_sec_all_devices_statistics .statistics [' p50' ]:.2f} "
13591321 f"TFLOP / second, "
1360- f"TotalThroughput (avg): "
1361- f'{ tflops_per_sec_all_devices_statistics .statistics ["avg" ]:.2f} '
13621322 f"TFLOP / second, "
13631323 f"TotalThroughput (p90): "
1364- f' { tflops_per_sec_all_devices_statistics .statistics [" p90" ]:.2f} '
1324+ f" { tflops_per_sec_all_devices_statistics .statistics [' p90' ]:.2f} "
13651325 f"TFLOP / second, "
1366- f"TotalThroughput (p95): "
1367- f'{ tflops_per_sec_all_devices_statistics .statistics ["p95" ]:.2f} '
13681326 f"TFLOP / second, "
1369- f"TotalThroughput (p99): "
1370- f'{ tflops_per_sec_all_devices_statistics .statistics ["p99" ]:.2f} '
13711327 f"TFLOP / second, "
1372- f"TotalThroughput (max): "
1373- f'{ tflops_per_sec_all_devices_statistics .statistics ["max" ]:.2f} '
13741328 f"TFLOP / second, "
1375- f'MFU (min): { mfu_statistics .statistics ["min" ]:.2%} ' ,
1376- f'MFU (p05): { mfu_statistics .statistics ["p05" ]:.2%} ' ,
1377- f'MFU (p10): { mfu_statistics .statistics ["p10" ]:.2%} ' ,
1378- f'MFU (p15): { mfu_statistics .statistics ["p15" ]:.2%} ' ,
1379- f'MFU (median): { mfu_statistics .statistics ["p50" ]:.2%} ' ,
1380- f'MFU (avg): { mfu_statistics .statistics ["avg" ]:.2%} ' ,
1381- f'MFU (p90): { mfu_statistics .statistics ["p90" ]:.2%} ' ,
1382- f'MFU (p95): { mfu_statistics .statistics ["p95" ]:.2%} ' ,
1383- f'MFU (p99): { mfu_statistics .statistics ["p99" ]:.2%} ' ,
1384- f'MFU (max): { mfu_statistics .statistics ["max" ]:.2%} '
1329+ f"MFU (p10): { mfu_statistics .statistics ['p10' ]:.2%} " ,
1330+ f"MFU (median): { mfu_statistics .statistics ['p50' ]:.2%} " ,
1331+ f"MFU (p90): { mfu_statistics .statistics ['p90' ]:.2%} " ,
13851332 )
13861333
13871334 # Gather the metrics to report.
13881335 metadata .update (
13891336 {
1390- "StepTime(min,ms)" : average_time_ms_statistics .statistics ["min" ],
1391- "StepTime(p05,ms)" : average_time_ms_statistics .statistics ["p05" ],
13921337 "StepTime(p10,ms)" : average_time_ms_statistics .statistics ["p10" ],
1393- "StepTime(p15,ms)" : average_time_ms_statistics .statistics ["p15" ],
13941338 "StepTime(median,ms)" : average_time_ms_statistics .statistics ["p50" ],
1395- "StepTime(avg,ms)" : average_time_ms_statistics .statistics ["avg" ],
13961339 "StepTime(p90,ms)" : average_time_ms_statistics .statistics ["p90" ],
1397- "StepTime(p95,ms)" : average_time_ms_statistics .statistics ["p95" ],
1398- "StepTime(p99,ms)" : average_time_ms_statistics .statistics ["p99" ],
1399- "StepTime(max,ms)" : average_time_ms_statistics .statistics ["max" ],
1400- "Throughput(min,TFLOP/s/device)" : (
1401- tflops_per_sec_statistics .statistics ["min" ]
1402- ),
1403- "Throughput(p05,TFLOP/s/device)" : (
1404- tflops_per_sec_statistics .statistics ["p05" ]
1405- ),
14061340 "Throughput(p10,TFLOP/s/device)" : (
14071341 tflops_per_sec_statistics .statistics ["p10" ]
14081342 ),
1409- "Throughput(p15,TFLOP/s/device)" : (
1410- tflops_per_sec_statistics .statistics ["p15" ]
1411- ),
14121343 "Throughput(median,TFLOP/s/device)" : (
14131344 tflops_per_sec_statistics .statistics ["p50" ]
14141345 ),
1415- "Throughput(avg,TFLOP/s/device)" : (
1416- tflops_per_sec_statistics .statistics ["avg" ]
1417- ),
14181346 "Throughput(p90,TFLOP/s/device)" : (
14191347 tflops_per_sec_statistics .statistics ["p90" ]
14201348 ),
1421- "Throughput(p95,TFLOP/s/device)" : (
1422- tflops_per_sec_statistics .statistics ["p95" ]
1423- ),
1424- "Throughput(p99,TFLOP/s/device)" : (
1425- tflops_per_sec_statistics .statistics ["p99" ]
1426- ),
1427- "Throughput(max,TFLOP/s/device)" : (
1428- tflops_per_sec_statistics .statistics ["max" ]
1429- ),
14301349 "TotalThroughput(median,TFLOP/s)" : (
14311350 tflops_per_sec_all_devices_statistics .statistics ["p50" ]
14321351 ),
1433- "TotalThroughput(avg,TFLOP/s)" : (
1434- tflops_per_sec_all_devices_statistics .statistics ["avg" ]
1435- ),
14361352 "TotalThroughput(p90,TFLOP/s)" : (
14371353 tflops_per_sec_all_devices_statistics .statistics ["p90" ]
14381354 ),
1439- "TotalThroughput(p95,TFLOP/s)" : (
1440- tflops_per_sec_all_devices_statistics .statistics ["p95" ]
1441- ),
1442- "TotalThroughput(p99,TFLOP/s)" : (
1443- tflops_per_sec_all_devices_statistics .statistics ["p99" ]
1444- ),
1445- "TotalThroughput(min,TFLOP/s)" : (
1446- tflops_per_sec_all_devices_statistics .statistics ["min" ]
1447- ),
1448- "TotalThroughput(max,TFLOP/s)" : (
1449- tflops_per_sec_all_devices_statistics .statistics ["max" ]
1450- ),
1451- "TotalThroughput(p05,TFLOP/s)" : (
1452- tflops_per_sec_all_devices_statistics .statistics ["p05" ]
1453- ),
14541355 "TotalThroughput(p10,TFLOP/s)" : (
14551356 tflops_per_sec_all_devices_statistics .statistics ["p10" ]
14561357 ),
1457- "TotalThroughput(p15,TFLOP/s)" : (
1458- tflops_per_sec_all_devices_statistics .statistics ["p15" ]
1459- ),
14601358 "TotalThroughput(median,TFLOP/s)" : (
14611359 tflops_per_sec_all_devices_statistics .statistics ["p50" ]
14621360 ),
1463- "MFU(min)" : mfu_statistics .statistics ["min" ],
1464- "MFU(p05)" : mfu_statistics .statistics ["p05" ],
14651361 "MFU(p10)" : mfu_statistics .statistics ["p10" ],
1466- "MFU(p15)" : mfu_statistics .statistics ["p15" ],
14671362 "MFU(median)" : mfu_statistics .statistics ["p50" ],
1468- "MFU(avg)" : mfu_statistics .statistics ["avg" ],
14691363 "MFU(p90)" : mfu_statistics .statistics ["p90" ],
1470- "MFU(p95)" : mfu_statistics .statistics ["p95" ],
1471- "MFU(p99)" : mfu_statistics .statistics ["p99" ],
1472- "MFU(max)" : mfu_statistics .statistics ["max" ],
14731364 "total_flops" : total_flops ,
14741365 }
14751366 )
@@ -1534,44 +1425,23 @@ def unified_bytes_metrics(
15341425 print (
15351426 f"{ type_prefix } "
15361427 f"Total bytes: { total_bytes } , "
1537- f"Step Time (min): { average_time_ms_statistics .statistics ["min" ]:.2f} , "
1538- f"Step Time (p05): { average_time_ms_statistics .statistics ["p05" ]:.2f} , "
15391428 f"Step Time (p10): { average_time_ms_statistics .statistics ["p10" ]:.2f} , "
1540- f"Step Time (p15): { average_time_ms_statistics .statistics ["p15" ]:.2f} , "
15411429 f"Step Time (median): { average_time_ms_statistics .statistics ["p50" ]:.2f} , "
1542- f"Step Time (avg): { average_time_ms_statistics .statistics ["avg" ]:.2f} , "
15431430 f"Step Time (p90): { average_time_ms_statistics .statistics ["p90" ]:.2f} , "
1544- f"Step Time (p95): { average_time_ms_statistics .statistics ["p95" ]:.2f} , "
1545- f"Step Time (p99): { average_time_ms_statistics .statistics ["p99" ]:.2f} , "
1546- f"Step Time (max): { average_time_ms_statistics .statistics ["max" ]:.2f} , "
1547- f"Throughput (min): { gigabytes_per_sec_statistics .statistics ["min" ]:.2f} GBytes / second / device, "
1548- f"Throughput (p05): { gigabytes_per_sec_statistics .statistics ["p05" ]:.2f} GBytes / second / device, "
15491431 f"Throughput (p10): { gigabytes_per_sec_statistics .statistics ["p10" ]:.2f} GBytes / second / device, "
1550- f"Throughput (p15): { gigabytes_per_sec_statistics .statistics ["p15" ]:.2f} GBytes / second / device, "
15511432 f"Throughput (median): { gigabytes_per_sec_statistics .statistics ["p50" ]:.2f} GBytes / second / device, "
1552- f"Throughput (avg): { gigabytes_per_sec_statistics .statistics ["avg" ]:.2f} GBytes / second / device, "
15531433 f"Throughput (p90): { gigabytes_per_sec_statistics .statistics ["p90" ]:.2f} GBytes / second / device, "
1554- f"Throughput (p95): { gigabytes_per_sec_statistics .statistics ["p95" ]:.2f} GBytes / second / device, "
1555- f"Throughput (p99): { gigabytes_per_sec_statistics .statistics ["p99" ]:.2f} GBytes / second / device, "
1556- f"Throughput (max): { gigabytes_per_sec_statistics .statistics ["max" ]:.2f} GBytes / second / device, "
1557- f"TotalThroughput (min): { gigabytes_per_sec_all_devices_statistics .statistics ["min" ]:.2f} GBytes / second, "
1558- f"TotalThroughput (p05): { gigabytes_per_sec_all_devices_statistics .statistics ["p05" ]:.2f} GBytes / second, "
15591434 f"TotalThroughput (p10): { gigabytes_per_sec_all_devices_statistics .statistics ["p10" ]:.2f} GBytes / second, "
1560- f"TotalThroughput (p15): { gigabytes_per_sec_all_devices_statistics .statistics ["p15" ]:.2f} GBytes / second, "
15611435 f"TotalThroughput (median): { gigabytes_per_sec_all_devices_statistics .statistics ["p50" ]:.2f} GBytes / second, "
1562- f"TotalThroughput (avg): { gigabytes_per_sec_all_devices_statistics .statistics ["avg" ]:.2f} GBytes / second, "
15631436 f"TotalThroughput (p90): { gigabytes_per_sec_all_devices_statistics .statistics ["p90" ]:.2f} GBytes / second, "
1564- f"TotalThroughput (p95): { gigabytes_per_sec_all_devices_statistics .statistics ["p95" ]:.2f} GBytes / second, "
1565- f"TotalThroughput (p99): { gigabytes_per_sec_all_devices_statistics .statistics ["p99" ]:.2f} GBytes / second, "
1566- f"TotalThroughput (max): { gigabytes_per_sec_all_devices_statistics .statistics ["max" ]:.2f} GBytes / second"
15671437 )
15681438 print ()
15691439 metadata .update (
15701440 {
15711441 "total_bytes" : total_bytes ,
15721442 }
15731443 )
1574- for p_name in ["min" , "p05" , " p10" , "p15" , " p50" , "avg" , " p90" , "p95" , "p99" , "max " ]:
1444+ for p_name in ["p10" , "p50" , "p90" ]:
15751445 metadata [f"StepTime({ p_name } ,ms)" ] = average_time_ms_statistics .statistics [p_name ]
15761446 metadata [f"Throughput({ p_name } ,GBytes/s/device)" ] = gigabytes_per_sec_statistics .statistics [p_name ]
15771447 metadata [f"TotalThroughput({ p_name } ,GBytes/s)" ] = gigabytes_per_sec_all_devices_statistics .statistics [p_name ]
0 commit comments