tt-perf-report 1.1.1__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tt-perf-report might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tt-perf-report
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: This tool analyzes performance traces from TT-Metal operations, providing insights into throughput, bottlenecks, and optimization opportunities.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tt-perf-report"
7
- version = "1.1.1"
7
+ version = "1.1.3"
8
8
  description = "This tool analyzes performance traces from TT-Metal operations, providing insights into throughput, bottlenecks, and optimization opportunities."
9
9
  license = {file = "LICENSE"}
10
10
  readme = "README.md"
@@ -4,10 +4,10 @@
4
4
  # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
5
5
  import argparse
6
6
  import csv
7
- from collections import defaultdict
8
7
  import os
9
8
  import re
10
9
  import sys
10
+ from collections import defaultdict
11
11
  from typing import Any, Optional, Union
12
12
 
13
13
  import matplotlib.pyplot as plt
@@ -168,11 +168,32 @@ def pad_string(string, length, align="left"):
168
168
  return padding + string if align == "right" else string + padding
169
169
 
170
170
 
171
- def evaluate_fidelity(input_0_datatype, input_1_datatype, output_datatype, math_fidelity):
172
- mantissa_bits = {"BFLOAT16": 8, "BFLOAT8_B": 7, "BFLOAT4_B": 3}
173
- in0_bits = mantissa_bits[input_0_datatype] # activations -> srcB (7 bits)
174
- in1_bits = mantissa_bits[input_1_datatype] # weights -> srcA (5 bits)
175
- out_bits = mantissa_bits[output_datatype]
171
+ def evaluate_fidelity(
172
+ input_0_datatype, input_1_datatype, output_datatype, math_fidelity
173
+ ):
174
+ integer_types = {"UINT8", "UINT16", "INT32", "UINT32"}
175
+
176
+ if (
177
+ input_0_datatype in integer_types
178
+ or input_1_datatype in integer_types
179
+ or output_datatype in integer_types
180
+ ):
181
+ return (
182
+ "not_applicable",
183
+ "Fidelity evaluation is not applicable for integer datatypes (UINT8, UINT16, INT32, UINT32).",
184
+ )
185
+
186
+ mantissa_bits = {"FLOAT32": 23, "BFLOAT16": 8, "BFLOAT8_B": 7, "BFLOAT4_B": 3}
187
+ try:
188
+ in0_bits = mantissa_bits[input_0_datatype] # activations -> srcB (7 bits)
189
+ in1_bits = mantissa_bits[input_1_datatype] # weights -> srcA (5 bits)
190
+ out_bits = mantissa_bits[output_datatype]
191
+ except KeyError as e:
192
+ return (
193
+ "unknown",
194
+ f"Datatype {e.args[0]} is not supported for fidelity evaluation.",
195
+ )
196
+
176
197
  if in0_bits == 8 and out_bits >= 7:
177
198
  if math_fidelity == "HiFi4":
178
199
  return (
@@ -435,7 +456,12 @@ def analyze_op(row, prev_row, csv_format="v2"):
435
456
  output_datatype_cell = Cell(output_datatype)
436
457
  input_0_datatype_cell = Cell(input_0_datatype)
437
458
  input_1_datatype_cell = Cell(input_1_datatype)
438
- short_name = lambda n: {"BFLOAT16": "BF16", "BFLOAT8_B": "BFP8", "BFLOAT4_B": "BFP4"}.get(n, n)
459
+ short_name = lambda n: {
460
+ "FLOAT32": "FP32",
461
+ "BFLOAT16": "BF16",
462
+ "BFLOAT8_B": "BFP8",
463
+ "BFLOAT4_B": "BFP4",
464
+ }.get(n, n)
439
465
 
440
466
  dram_speed = Cell(None, unit="GB/s", decimals=0)
441
467
  dram_percentage = Cell(None, unit="%", decimals=1)
@@ -1173,6 +1199,10 @@ def generate_perf_report(csv_file, signpost, ignore_signposts, min_percentage,
1173
1199
  row["Advice"] = " • ".join(advice)
1174
1200
  csv_writer.writerow(row)
1175
1201
  else:
1202
+ if not rows:
1203
+ print(colored("No operations to display after applying filters.", "yellow"))
1204
+ return
1205
+
1176
1206
  col_widths = [
1177
1207
  max(max(visible_length(str(row[header])) for row in rows), visible_length(header))
1178
1208
  for header in visible_headers
@@ -1182,7 +1212,7 @@ def generate_perf_report(csv_file, signpost, ignore_signposts, min_percentage,
1182
1212
  print_advice_section(rows, visible_headers, col_widths)
1183
1213
 
1184
1214
  # handle stacked report generation
1185
- if not(no_stacked_report):
1215
+ if not(no_stacked_report) and rows:
1186
1216
  stacked_report = generate_stacked_report(rows, visible_headers, not(no_stack_by_in0))
1187
1217
 
1188
1218
  if not(csv_output_file):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tt-perf-report
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: This tool analyzes performance traces from TT-Metal operations, providing insights into throughput, bottlenecks, and optimization opportunities.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
File without changes
File without changes
File without changes