Repository navigation
Revert "feat: added p90 step time logic for GEMM and HBM tail latencies" #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -858,7 +858,6 @@ def _calculate_statistics(self) -> Dict[str, float]: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if not self.metrics_list: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return {} # Return an empty dict if metrics_list is empty | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "p10": np.percentile(self.metrics_list, 10), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "p50": np.percentile(self.metrics_list, 50), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "p90": np.percentile(self.metrics_list, 90), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "p95": np.percentile(self.metrics_list, 95), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1289,34 +1288,15 @@ def unified_flops_metrics( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dtype_prefix = f"[{dtype}] " if dtype is not None else "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{dtype_prefix}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Total floating-point ops: {total_flops}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Step Time (p10): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{average_time_ms_statistics.statistics["p10"]:.2f}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Step Time (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Total floating-point ops: {total_flops}, Step Time (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{average_time_ms_statistics.statistics["p50"]:.2f}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Step Time (p90): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{average_time_ms_statistics.statistics["p90"]:.2f}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (p10): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{tflops_per_sec_statistics.statistics["p10"]:.2f}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f" TFLOP / second / device, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{tflops_per_sec_statistics.statistics["p50"]:.2f}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f" TFLOP / second / device, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (p90): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{tflops_per_sec_statistics.statistics["p90"]:.2f}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f" TFLOP / second / device, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TotalThroughput (p10): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{tflops_per_sec_all_devices_statistics.statistics["p10"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TFLOP / second, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TotalThroughput (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{tflops_per_sec_all_devices_statistics.statistics["p50"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TFLOP / second, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TotalThroughput (p90): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{tflops_per_sec_all_devices_statistics.statistics["p90"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TFLOP / second, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"MFU (p10): {mfu_statistics.statistics["p10"]:.2%}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"MFU (median): {mfu_statistics.statistics["p50"]:.2%}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"MFU (p90): {mfu_statistics.statistics["p90"]:.2%}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"MFU: {mfu_statistics.statistics["p50"]:.2%}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1291
to
+1299
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using double quotes inside a double-quoted f-string expression (e.g.,
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Gather the metrics to report. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1393,30 +1373,13 @@ def unified_bytes_metrics( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type_prefix = f"[d={dtype}] " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{type_prefix}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Total bytes: {total_bytes}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Step Time (p10): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{average_time_ms_statistics.statistics["p10"]:.2f}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Step Time (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Total bytes: {total_bytes}, Step Time (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{average_time_ms_statistics.statistics["p50"]:.2f}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Step Time (p90): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{average_time_ms_statistics.statistics["p90"]:.2f}, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (p10): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{gigabytes_per_sec_statistics.statistics["p10"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"GBytes / second / device, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (median):" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{gigabytes_per_sec_statistics.statistics["p50"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"GBytes / second / device, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"Throughput (p90): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{gigabytes_per_sec_statistics.statistics["p90"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"GBytes / second / device, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TotalThroughput (p10): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{gigabytes_per_sec_all_devices_statistics.statistics["p10"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"GBytes / second, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TotalThroughput (median): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{gigabytes_per_sec_all_devices_statistics.statistics["p50"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"GBytes / second, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"TotalThroughput (p90): " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"{gigabytes_per_sec_all_devices_statistics.statistics["p90"]:.2f} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f"GBytes / second" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1376
to
1383
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two issues here:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using double quotes inside a double-quoted f-string expression (e.g.,
statistics["p50"]) is only supported in Python 3.12+. For backward compatibility with Python < 3.12 (which is common in many ML environments), use single quotes for dictionary keys inside double-quoted f-strings.