ttnn-visualizer 0.51.0__py3-none-any.whl → 0.52.0__py3-none-any.whl

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.
ttnn_visualizer/app.py CHANGED
@@ -80,6 +80,7 @@ def create_app(settings_override=None):
80
80
  "SERVER_MODE": app.config["SERVER_MODE"],
81
81
  "BASE_PATH": app.config["BASE_PATH"],
82
82
  "TT_METAL_HOME": app.config["TT_METAL_HOME"],
83
+ "REPORT_DATA_DIRECTORY": str(app.config["REPORT_DATA_DIRECTORY"]),
83
84
  }
84
85
  js = f"window.TTNN_VISUALIZER_CONFIG = {json.dumps(js_config)};"
85
86
 
@@ -100,7 +100,6 @@ class NPEQueries:
100
100
 
101
101
  @staticmethod
102
102
  def get_npe_manifest(instance: Instance):
103
-
104
103
  file_path = Path(
105
104
  instance.performance_path,
106
105
  NPEQueries.NPE_FOLDER,
@@ -417,6 +416,17 @@ class OpsPerformanceReportQueries:
417
416
  "raw_op_code",
418
417
  ]
419
418
 
419
+ STACKED_REPORT_COLUMNS = [
420
+ "percent",
421
+ "op_code",
422
+ "device_time_sum_us",
423
+ "ops_count",
424
+ "flops_min",
425
+ "flops_max",
426
+ "flops_mean",
427
+ "flops_std",
428
+ ]
429
+
420
430
  PASSTHROUGH_COLUMNS = {
421
431
  "pm_ideal_ns": "PM IDEAL [ns]",
422
432
  }
@@ -433,6 +443,9 @@ class OpsPerformanceReportQueries:
433
443
  raw_csv = OpsPerformanceQueries.get_raw_csv(instance)
434
444
  csv_file = StringIO(raw_csv)
435
445
  csv_output_file = tempfile.mktemp(suffix=".csv")
446
+ csv_stacked_output_file = tempfile.mktemp(suffix=".csv")
447
+ # perf_report currently generates a PNG alongside the CSV using the same temp name - we'll just delete it afterwards
448
+ stacked_png_file = os.path.splitext(csv_output_file)[0] + ".png"
436
449
 
437
450
  try:
438
451
  perf_report.generate_perf_report(
@@ -446,9 +459,9 @@ class OpsPerformanceReportQueries:
446
459
  cls.DEFAULT_TRACING_MODE,
447
460
  True,
448
461
  True,
449
- True,
450
- True,
451
462
  False,
463
+ True, # no_stack_by_in0 - need to ask what this is
464
+ csv_stacked_output_file,
452
465
  )
453
466
  except Exception as e:
454
467
  raise DataFormatError(f"Error generating performance report: {e}") from e
@@ -489,4 +502,26 @@ class OpsPerformanceReportQueries:
489
502
  finally:
490
503
  os.unlink(csv_output_file)
491
504
 
492
- return report
505
+ stacked_report = []
506
+
507
+ try:
508
+ with open(csv_stacked_output_file, newline="") as csvfile:
509
+ reader = csv.reader(csvfile, delimiter=",")
510
+ next(reader, None)
511
+
512
+ for row in reader:
513
+ processed_row = {
514
+ column: row[index]
515
+ for index, column in enumerate(cls.STACKED_REPORT_COLUMNS)
516
+ if index < len(row)
517
+ }
518
+
519
+ stacked_report.append(processed_row)
520
+ except csv.Error as e:
521
+ raise DataFormatError() from e
522
+ finally:
523
+ os.unlink(csv_stacked_output_file)
524
+ if os.path.exists(stacked_png_file):
525
+ os.unlink(stacked_png_file)
526
+
527
+ return {"report": report, "stacked_report": stacked_report}
@@ -14,7 +14,6 @@ from ttnn_visualizer.exceptions import (
14
14
  NoProjectsException,
15
15
  NoValidConnectionsError,
16
16
  RemoteConnectionException,
17
- RemoteSqliteException,
18
17
  SSHException,
19
18
  )
20
19
  from ttnn_visualizer.instances import get_or_create_instance
@@ -115,14 +114,6 @@ def remote_exception_handler(func):
115
114
  message=user_message,
116
115
  )
117
116
 
118
- except RemoteSqliteException as err:
119
- current_app.logger.error(f"Remote Sqlite exception: {str(err)}")
120
- message = err.message
121
- if "No such file" in str(err):
122
- message = "Unable to open SQLite binary, check path"
123
- raise RemoteConnectionException(
124
- status=ConnectionTestStates.FAILED, message=message
125
- )
126
117
  except IOError as err:
127
118
  message = f"Error opening remote folder: {str(err)}"
128
119
  if "Name or service not known" in str(err):
@@ -56,13 +56,6 @@ class NoProjectsException(RemoteConnectionException):
56
56
  pass
57
57
 
58
58
 
59
- class RemoteSqliteException(Exception):
60
- def __init__(self, message, status):
61
- super().__init__(message)
62
- self.message = message
63
- self.status = status
64
-
65
-
66
59
  class DatabaseFileNotFoundException(Exception):
67
60
  pass
68
61
 
ttnn_visualizer/models.py CHANGED
@@ -169,7 +169,6 @@ class RemoteConnection(SerializeableModel):
169
169
  port: int = Field(ge=1, le=65535)
170
170
  profilerPath: str
171
171
  performancePath: Optional[str] = None
172
- sqliteBinaryPath: Optional[str] = None
173
172
 
174
173
 
175
174
  class StatusMessage(SerializeableModel):
@@ -1 +1 @@
1
- import{I as s}from"./index-CnPrfHYh.js";import{I as r}from"./index-Cnc1EkDo.js";import{p as n,I as c}from"./index-DFKuZosj.js";function p(t,a){const o=n(t);return a===c.STANDARD?s[o]:r[o]}export{s as IconSvgPaths16,r as IconSvgPaths20,p as getIconPaths};
1
+ import{I as s}from"./index-CnPrfHYh.js";import{I as r}from"./index-Cnc1EkDo.js";import{p as n,I as c}from"./index-DpyzM7Uz.js";function p(t,a){const o=n(t);return a===c.STANDARD?s[o]:r[o]}export{s as IconSvgPaths16,r as IconSvgPaths20,p as getIconPaths};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/allPaths-BoDgVavt.js","assets/index-CnPrfHYh.js","assets/index-Cnc1EkDo.js","assets/index-DpyzM7Uz.js","assets/index-BxeIYL6g.css"])))=>i.map(i=>d[i]);
2
+ import{_ as e}from"./index-DpyzM7Uz.js";const s=async(t,a)=>{const{getIconPaths:o}=await e(async()=>{const{getIconPaths:r}=await import("./allPaths-BoDgVavt.js");return{getIconPaths:r}},__vite__mapDeps([0,1,2,3,4]));return o(t,a)};export{s as allPathsLoader};